From: Giovanni Maruzzelli Date: Sat, 6 Jun 2009 20:31:01 +0000 (+0000) Subject: skypiax: insert the delay ONLY if the broken message is 'ERROR 92 CALL: Unrecognised... X-Git-Tag: v1.0.4~577 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8a262b729d38c1c2514eaf857230615343ac4f6;p=thirdparty%2Ffreeswitch.git skypiax: insert the delay ONLY if the broken message is 'ERROR 92 CALL: Unrecognised identity': when repeatedly you try to connect to non-existing Skype account in a short period, the Skype client send you back the two halves of the message 'ERROR 92 CALL: Unrecognised identity' inverted in a way that breaks the flux of the API messages. Maybe an anti-spam feature? Anyway, let's try to work around it and restore sanity with a 1 second delay git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13666 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/endpoints/mod_skypiax/skypiax_protocol.c b/src/mod/endpoints/mod_skypiax/skypiax_protocol.c index ee0285f033..f132b88b47 100644 --- a/src/mod/endpoints/mod_skypiax/skypiax_protocol.c +++ b/src/mod/endpoints/mod_skypiax/skypiax_protocol.c @@ -381,10 +381,11 @@ int skypiax_signaling_read(private_t * tech_pvt) tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS; tech_pvt->interface_state = SKYPIAX_STATE_UP; start_audio_threads(tech_pvt); - skypiax_sleep(1000); + skypiax_sleep(1000); //FIXME sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port); skypiax_signaling_write(tech_pvt, msg_to_skype); + skypiax_sleep(1000); //FIXME sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port); skypiax_signaling_write(tech_pvt, msg_to_skype); @@ -1469,6 +1470,8 @@ void *skypiax_do_skypeapi_thread_func(void *obj) buf[i] = '\0'; + DEBUGA_SKYPE ("BUF=|||%s|||\n", SKYPIAX_P_LOG, buf); + if(an_event.xclient.message_type == atom_begin){ if(strlen(buffer)){ @@ -1482,9 +1485,12 @@ void *skypiax_do_skypeapi_thread_func(void *obj) if(an_event.xclient.message_type == atom_continue){ if(!strlen(buffer)){ - WARNINGA("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||. Let's introduce a 1 second delay.\n", SKYPIAX_P_LOG, buf); + DEBUGA_SKYPE("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||\n", SKYPIAX_P_LOG, buf); continue_is_broken=1; - skypiax_sleep(1000000); //1 sec + if(!strncmp(buf, "ognised identity", 15)) { + WARNINGA("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||. Let's introduce a 1 second delay.\n", SKYPIAX_P_LOG, buf); + skypiax_sleep(1000000); //1 sec + } break; } }