skypopen: indented

This commit is contained in:
Giovanni Maruzzelli 2010-10-28 04:21:52 -05:00
parent bc067ebc69
commit 38215f9d5c
2 changed files with 82 additions and 80 deletions

View File

@ -484,21 +484,21 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session)
switch_mutex_unlock(tech_pvt->flag_mutex); switch_mutex_unlock(tech_pvt->flag_mutex);
DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG); DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG);
conta=0; conta = 0;
while(tech_pvt->tcp_srv_thread){ while (tech_pvt->tcp_srv_thread) {
switch_sleep(5000); switch_sleep(5000);
conta++; conta++;
if(conta==200){ if (conta == 200) {
ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG); ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
break; break;
} }
} }
DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta); DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta);
conta=0; conta = 0;
while(tech_pvt->tcp_cli_thread){ while (tech_pvt->tcp_cli_thread) {
switch_sleep(5000); switch_sleep(5000);
conta++; conta++;
if(conta==200){ if (conta == 200) {
ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG); ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
break; break;
} }
@ -618,7 +618,6 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session)
if (globals.calls < 0) { if (globals.calls < 0) {
globals.calls = 0; globals.calls = 0;
} }
//DEBUGA_SKYPE("debugging_hangup 9\n", SKYPOPEN_P_LOG); //DEBUGA_SKYPE("debugging_hangup 9\n", SKYPOPEN_P_LOG);
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
if (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED) { if (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED) {
@ -1406,21 +1405,21 @@ static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t *
tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; tech_pvt->interface_state = SKYPOPEN_STATE_DOWN;
DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG); DEBUGA_SKYPE("audio tcp threads to DIE\n", SKYPOPEN_P_LOG);
conta=0; conta = 0;
while(tech_pvt->tcp_srv_thread){ while (tech_pvt->tcp_srv_thread) {
switch_sleep(5000); switch_sleep(5000);
conta++; conta++;
if(conta==200){ if (conta == 200) {
ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG); ERRORA("tcp_srv_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
break; break;
} }
} }
DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta); DEBUGA_SKYPE("audio tcp srv thread DEAD %d\n", SKYPOPEN_P_LOG, conta);
conta=0; conta = 0;
while(tech_pvt->tcp_cli_thread){ while (tech_pvt->tcp_cli_thread) {
switch_sleep(5000); switch_sleep(5000);
conta++; conta++;
if(conta==200){ if (conta == 200) {
ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG); ERRORA("tcp_cli_thread is NOT dead, this can LEAK MEMORY\n", SKYPOPEN_P_LOG);
break; break;
} }
@ -3073,7 +3072,7 @@ struct SkypopenHandles *skypopen_list_remove_by_value(struct SkypopenList *list,
// CLOUDTREE (THomas Hazel) - is there a capable freeswitch list? // CLOUDTREE (THomas Hazel) - is there a capable freeswitch list?
struct SkypopenHandles *skypopen_list_remove_by_reference(struct SkypopenList *list, struct SkypopenHandles *handle) struct SkypopenHandles *skypopen_list_remove_by_reference(struct SkypopenList *list, struct SkypopenHandles *handle)
{ {
private_t *tech_pvt=NULL; private_t *tech_pvt = NULL;
switch_mutex_lock(globals.list_mutex); switch_mutex_lock(globals.list_mutex);

View File

@ -227,12 +227,13 @@ int skypopen_signaling_read(private_t *tech_pvt)
} }
} else if (!strncasecmp(message, "ERROR 36 Not online", 18)) { } else if (!strncasecmp(message, "ERROR 36 Not online", 18)) {
char msg_to_skype[256]; char msg_to_skype[256];
ERRORA("Skype client is not online, eg: not connected to Skype network, probably got a temporary net outage: |||%s|||\n", SKYPOPEN_P_LOG, message); ERRORA("Skype client is not online, eg: not connected to Skype network, probably got a temporary net outage: |||%s|||\n",
if(strlen(tech_pvt->skype_call_id)){ SKYPOPEN_P_LOG, message);
if (strlen(tech_pvt->skype_call_id)) {
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id); sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id);
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
} }
if(strlen(tech_pvt->ring_id)){ if (strlen(tech_pvt->ring_id)) {
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->ring_id); sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->ring_id);
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
} }
@ -240,12 +241,13 @@ int skypopen_signaling_read(private_t *tech_pvt)
return CALLFLOW_INCOMING_HANGUP; return CALLFLOW_INCOMING_HANGUP;
} else if (!strncasecmp(message, "ERROR 589 ALTER CALL", 19)) { } else if (!strncasecmp(message, "ERROR 589 ALTER CALL", 19)) {
char msg_to_skype[256]; char msg_to_skype[256];
DEBUGA_SKYPE("Skype client was not able to correctly manage tcp audio sockets, probably got a local or remote hangup: |||%s|||\n", SKYPOPEN_P_LOG, message); DEBUGA_SKYPE("Skype client was not able to correctly manage tcp audio sockets, probably got a local or remote hangup: |||%s|||\n",
if(strlen(tech_pvt->skype_call_id)){ SKYPOPEN_P_LOG, message);
if (strlen(tech_pvt->skype_call_id)) {
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id); sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id);
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
} }
if(strlen(tech_pvt->ring_id)){ if (strlen(tech_pvt->ring_id)) {
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->ring_id); sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", tech_pvt->ring_id);
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
} }
@ -497,7 +499,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
//SKYPOPEN_P_LOG, message, obj, id, prop, value, where ? where : "NULL"); //SKYPOPEN_P_LOG, message, obj, id, prop, value, where ? where : "NULL");
if (!strcasecmp(prop, "PARTNER_HANDLE")) { if (!strcasecmp(prop, "PARTNER_HANDLE")) {
if (tech_pvt->interface_state == SKYPOPEN_STATE_IDLE){ if (tech_pvt->interface_state == SKYPOPEN_STATE_IDLE) {
/* we are NOT inside an active call */ /* we are NOT inside an active call */
DEBUGA_SKYPE("Call %s go to skypopen_partner_handle_ring\n", SKYPOPEN_P_LOG, id); DEBUGA_SKYPE("Call %s go to skypopen_partner_handle_ring\n", SKYPOPEN_P_LOG, id);
skypopen_strncpy(tech_pvt->ring_id, id, sizeof(tech_pvt->ring_id)); skypopen_strncpy(tech_pvt->ring_id, id, sizeof(tech_pvt->ring_id));
@ -579,7 +581,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
if (!strcasecmp(value, "RINGING")) { if (!strcasecmp(value, "RINGING")) {
char msg_to_skype[1024]; char msg_to_skype[1024];
if (tech_pvt->interface_state == SKYPOPEN_STATE_IDLE){ if (tech_pvt->interface_state == SKYPOPEN_STATE_IDLE) {
// CLOUDTREE (Thomas Hazel) // CLOUDTREE (Thomas Hazel)
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
@ -604,7 +606,8 @@ int skypopen_signaling_read(private_t *tech_pvt)
skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", SKYPOPEN_P_LOG, id); DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", SKYPOPEN_P_LOG, id);
if (remote_party_is_ringing(tech_pvt) != SWITCH_STATUS_SUCCESS) { if (remote_party_is_ringing(tech_pvt) != SWITCH_STATUS_SUCCESS) {
DEBUGA_SKYPE("We are getting the RINGING from a call we probably canceled, trying to get out hanging up call id: %s.\n", DEBUGA_SKYPE
("We are getting the RINGING from a call we probably canceled, trying to get out hanging up call id: %s.\n",
SKYPOPEN_P_LOG, id); SKYPOPEN_P_LOG, id);
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id); sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
@ -735,7 +738,7 @@ int skypopen_signaling_read(private_t *tech_pvt)
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
} }
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS; tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
if(skypopen_answered(tech_pvt)!= SWITCH_STATUS_SUCCESS){ if (skypopen_answered(tech_pvt) != SWITCH_STATUS_SUCCESS) {
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id); sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
skypopen_signaling_write(tech_pvt, msg_to_skype); skypopen_signaling_write(tech_pvt, msg_to_skype);
} }
@ -1938,7 +1941,7 @@ int skypopen_answered(private_t *tech_pvt)
switch_core_session_t *session = NULL; switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
if(strlen(tech_pvt->session_uuid_str)){ if (strlen(tech_pvt->session_uuid_str)) {
session = switch_core_session_locate(tech_pvt->session_uuid_str); session = switch_core_session_locate(tech_pvt->session_uuid_str);
if (session) { if (session) {
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);