mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-14 08:05:37 +00:00
skypopen: indented
This commit is contained in:
parent
56f415a164
commit
00a6f61a67
@ -112,6 +112,7 @@ char *interface_status[] = { /* should match SKYPOPEN_STATE_xxx in skypopen.h */
|
||||
"PREANSW",
|
||||
"DEAD"
|
||||
};
|
||||
|
||||
char *skype_callflow[] = { /* should match CALLFLOW_XXX in skypopen.h */
|
||||
"IDLE",
|
||||
"DOWN",
|
||||
@ -739,6 +740,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t channel_on_consume_media(switch_core_session_t *session)
|
||||
{
|
||||
private_t *tech_pvt = NULL;
|
||||
@ -765,6 +767,7 @@ static switch_status_t channel_on_soft_execute(switch_core_session_t *session)
|
||||
DEBUGA_SKYPE("%s CHANNEL SOFT_EXECUTE\n", SKYPOPEN_P_LOG, tech_pvt->name);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t channel_on_reset(switch_core_session_t *session)
|
||||
{
|
||||
private_t *tech_pvt = NULL;
|
||||
@ -949,8 +952,8 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
|
||||
switch_channel_queue_dtmf(channel, &dtmf);
|
||||
p++;
|
||||
}
|
||||
NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp,
|
||||
(unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp));
|
||||
NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPOPEN_P_LOG, digit_str,
|
||||
(unsigned int) new_dtmf_timestamp, (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp));
|
||||
tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp;
|
||||
} else {
|
||||
WARNINGA("NO CHANNEL ?\n", SKYPOPEN_P_LOG);
|
||||
@ -1751,8 +1754,7 @@ static switch_status_t load_config(int reload_type)
|
||||
switch_threadattr_detach_set(skypopen_signaling_thread_attr, 0);
|
||||
switch_threadattr_stacksize_set(skypopen_signaling_thread_attr, SWITCH_THREAD_STACKSIZE);
|
||||
//switch_threadattr_priority_increase(skypopen_signaling_thread_attr);
|
||||
switch_thread_create(&globals.SKYPOPEN_INTERFACES[interface_id].
|
||||
skypopen_signaling_thread, skypopen_signaling_thread_attr,
|
||||
switch_thread_create(&globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread, skypopen_signaling_thread_attr,
|
||||
skypopen_signaling_thread_func, &globals.SKYPOPEN_INTERFACES[interface_id], skypopen_module_pool);
|
||||
|
||||
switch_sleep(100000);
|
||||
@ -1858,8 +1860,8 @@ static switch_status_t load_config(int reload_type)
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
static switch_status_t chat_send(switch_event_t *message_event)
|
||||
|
||||
static switch_status_t chat_send(switch_event_t *message_event)
|
||||
{
|
||||
char *user = NULL, *host, *f_user = NULL, *f_host = NULL, *f_resource = NULL;
|
||||
private_t *tech_pvt = NULL;
|
||||
@ -1912,7 +1914,6 @@ static switch_status_t chat_send(switch_event_t *message_event)
|
||||
if ((host = strchr(user, '@'))) {
|
||||
*host++ = '\0';
|
||||
}
|
||||
|
||||
//DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, type,
|
||||
// hint ? hint : "NULL");
|
||||
DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body,
|
||||
@ -1970,7 +1971,9 @@ static switch_status_t chat_send(switch_event_t *message_event)
|
||||
}
|
||||
tried++;
|
||||
if (tried > 20) {
|
||||
ERRORA("No chat with dialog_partner='%s' was found. (If you're using mod_sms this is a bug of mod_skypopen when using mod_sms, from next incoming message it will probably work...)\n", SKYPOPEN_P_LOG, to);
|
||||
ERRORA
|
||||
("No chat with dialog_partner='%s' was found. (If you're using mod_sms this is a bug of mod_skypopen when using mod_sms, from next incoming message it will probably work...)\n",
|
||||
SKYPOPEN_P_LOG, to);
|
||||
break;
|
||||
}
|
||||
switch_sleep(50000);
|
||||
@ -2274,7 +2277,8 @@ int start_audio_threads(private_t *tech_pvt)
|
||||
switch_threadattr_priority_increase(tcp_srv_thread_thd_attr);
|
||||
switch_mutex_lock(tech_pvt->mutex_thread_audio_srv);
|
||||
//DEBUGA_SKYPE("debugging_hangup srv lock\n", SKYPOPEN_P_LOG);
|
||||
if (switch_thread_create(&tech_pvt->tcp_srv_thread, tcp_srv_thread_thd_attr, skypopen_do_tcp_srv_thread, tech_pvt, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_thread_create(&tech_pvt->tcp_srv_thread, tcp_srv_thread_thd_attr, skypopen_do_tcp_srv_thread, tech_pvt, skypopen_module_pool) ==
|
||||
SWITCH_STATUS_SUCCESS) {
|
||||
DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPOPEN_P_LOG);
|
||||
} else {
|
||||
ERRORA("failed to start tcp_srv_thread thread.\n", SKYPOPEN_P_LOG);
|
||||
@ -2291,7 +2295,8 @@ int start_audio_threads(private_t *tech_pvt)
|
||||
switch_threadattr_priority_increase(tcp_cli_thread_thd_attr);
|
||||
switch_mutex_lock(tech_pvt->mutex_thread_audio_cli);
|
||||
//DEBUGA_SKYPE("debugging_hangup cli lock\n", SKYPOPEN_P_LOG);
|
||||
if (switch_thread_create(&tech_pvt->tcp_cli_thread, tcp_cli_thread_thd_attr, skypopen_do_tcp_cli_thread, tech_pvt, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) {
|
||||
if (switch_thread_create(&tech_pvt->tcp_cli_thread, tcp_cli_thread_thd_attr, skypopen_do_tcp_cli_thread, tech_pvt, skypopen_module_pool) ==
|
||||
SWITCH_STATUS_SUCCESS) {
|
||||
DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPOPEN_P_LOG);
|
||||
} else {
|
||||
ERRORA("failed to start tcp_cli_thread thread.\n", SKYPOPEN_P_LOG);
|
||||
@ -2524,7 +2529,8 @@ SWITCH_STANDARD_API(sk_function)
|
||||
skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[tmp_i], "GET PROFILE PSTN_BALANCE_CURRENCY");
|
||||
switch_sleep(20000);
|
||||
if (strlen(tmp_message) > 21 && strlen(globals.SKYPOPEN_INTERFACES[tmp_i].message) > 30)
|
||||
stream->write_function(stream, " %s \t%s\t%s\n", globals.SKYPOPEN_INTERFACES[tmp_i].name, tmp_message+21, globals.SKYPOPEN_INTERFACES[tmp_i].message+30);
|
||||
stream->write_function(stream, " %s \t%s\t%s\n", globals.SKYPOPEN_INTERFACES[tmp_i].name, tmp_message + 21,
|
||||
globals.SKYPOPEN_INTERFACES[tmp_i].message + 30);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3164,8 +3170,9 @@ SWITCH_STANDARD_API(skypopen_chat_function)
|
||||
goto end;
|
||||
} else {
|
||||
|
||||
NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", SKYPOPEN_P_LOG, SKYPE_CHAT_PROTO, tech_pvt->skype_user,
|
||||
argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), tech_pvt->name);
|
||||
NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", SKYPOPEN_P_LOG, SKYPE_CHAT_PROTO,
|
||||
tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]),
|
||||
tech_pvt->name);
|
||||
|
||||
compat_chat_send(SKYPE_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE",
|
||||
switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), NULL, tech_pvt->name);
|
||||
|
@ -1970,7 +1970,6 @@ void *skypopen_do_skypeapi_thread_func(void *obj)
|
||||
//XFlush(disp);
|
||||
there_were_continues = 0;
|
||||
}
|
||||
|
||||
//skypopen_sleep(1000); //0.1 msec
|
||||
break;
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user