skypiax: indent -gnu -ts4 -br -brs -cdw -lp -ce -nbfda -npcs -nprs -npsl -nbbo -saf -sai -saw -cs -bbo -nhnl -nut -sob -l90

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12416 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Giovanni Maruzzelli 2009-03-04 20:18:37 +00:00
parent 123840f7ef
commit a9fcad1aca
3 changed files with 74 additions and 55 deletions

View File

@ -1124,8 +1124,7 @@ struct skypiax_pvt *skypiax_mkif(struct ast_config *cfg, char *ctg, int is_first
skypiax_store_boost(v->value, &skypiax_default.capture_boost)) skypiax_store_boost(v->value, &skypiax_default.capture_boost))
M_UINT("skypiax_dir_entry_extension_prefix", M_UINT("skypiax_dir_entry_extension_prefix",
skypiax_default.skypiax_dir_entry_extension_prefix) skypiax_default.skypiax_dir_entry_extension_prefix)
M_END(; M_END(;);
);
} }
} }
@ -1161,8 +1160,7 @@ struct skypiax_pvt *skypiax_mkif(struct ast_config *cfg, char *ctg, int is_first
M_STR("skype_user", tmp->skype_user) M_STR("skype_user", tmp->skype_user)
M_UINT("skypiax_dir_entry_extension_prefix", M_UINT("skypiax_dir_entry_extension_prefix",
tmp->skypiax_dir_entry_extension_prefix) tmp->skypiax_dir_entry_extension_prefix)
M_END(; M_END(;);
);
} }
if (debug_all) { if (debug_all) {
@ -1861,7 +1859,9 @@ int new_inbound_channel(private_t * p)
switch_core_session_t *session = NULL; switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL; switch_channel_t *channel = NULL;
if ((session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) { if ((session =
switch_core_session_request(skypiax_endpoint_interface,
SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
switch_core_session_add_stream(session, NULL); switch_core_session_add_stream(session, NULL);
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
skypiax_tech_init(tech_pvt, session); skypiax_tech_init(tech_pvt, session);
@ -1889,6 +1889,7 @@ int new_inbound_channel(private_t * p)
#endif #endif
return 0; return 0;
} }
int remote_party_is_ringing(private_t * p) int remote_party_is_ringing(private_t * p)
{ {
if (p->owner) { if (p->owner) {
@ -1897,6 +1898,7 @@ int remote_party_is_ringing(private_t * p)
return 0; return 0;
} }
int remote_party_is_early_media(private_t * p) int remote_party_is_early_media(private_t * p)
{ {
if (p->owner) { if (p->owner) {
@ -1906,7 +1908,6 @@ int remote_party_is_early_media(private_t * p)
return 0; return 0;
} }
int outbound_channel_answered(private_t * p) int outbound_channel_answered(private_t * p)
{ {

View File

@ -506,7 +506,9 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t * sess
switch_memory_pool_t ** pool, switch_memory_pool_t ** pool,
switch_originate_flag_t flags) switch_originate_flag_t flags)
{ {
if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) { if ((*new_session =
switch_core_session_request(skypiax_endpoint_interface,
SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
private_t *tech_pvt; private_t *tech_pvt;
switch_channel_t *channel; switch_channel_t *channel;
switch_caller_profile_t *caller_profile; switch_caller_profile_t *caller_profile;
@ -940,29 +942,43 @@ static switch_status_t load_config(void)
skypiax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]); skypiax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]);
NOTICA("WAITING roughly 10/15 seconds to find a running Skype client and connect to its SKYPE API for interface_id=%d. NB: on XP will wait for much much more! (on Vista and Linux is OK)\n", SKYPIAX_P_LOG, interface_id); NOTICA
("WAITING roughly 10 seconds to find a running Skype client and connect to its SKYPE API for interface_id=%d\n",
SKYPIAX_P_LOG, interface_id);
i = 0; i = 0;
while (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.api_connected == 0 && running && i < 200) { // 10 seconds? thanks Jeff Lenk while (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.api_connected == 0 && running && i < 200) { // 10 seconds! thanks Jeff Lenk
switch_sleep(50000); switch_sleep(50000);
i++; i++;
} }
if (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.api_connected) { if (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.api_connected) {
NOTICA("Found a running Skype client, connected to its SKYPE API for interface_id=%d, waiting roughly 60/90 seconds for CURRENTUSERHANDLE==%s. NB: on XP will wait for much much more! (on Vista and Linux is OK)\n", SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user); NOTICA
("Found a running Skype client, connected to its SKYPE API for interface_id=%d, waiting 60 seconds for CURRENTUSERHANDLE==%s\n",
SKYPIAX_P_LOG, interface_id,
globals.SKYPIAX_INTERFACES[interface_id].skype_user);
} else { } else {
ERRORA("Failed to connect to a SKYPE API for interface_id=%d, no SKYPE client running, please (re)start Skype client. Skypiax exiting\n", SKYPIAX_P_LOG, interface_id); ERRORA
("Failed to connect to a SKYPE API for interface_id=%d, no SKYPE client running, please (re)start Skype client. Skypiax exiting\n",
SKYPIAX_P_LOG, interface_id);
running = 0; running = 0;
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
i = 0; i = 0;
while (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.currentuserhandle == 0 && running && i < 1200) { // 60 seconds? thanks Jeff Lenk while (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.currentuserhandle == 0 && running && i < 1200) { // 60 seconds! thanks Jeff Lenk
switch_sleep(50000); switch_sleep(50000);
i++; i++;
} }
if (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.currentuserhandle) { if (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.currentuserhandle) {
WARNINGA("Interface_id=%d is now STARTED, the Skype client to which we are connected gave us the correct CURRENTUSERHANDLE (%s)\n", SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user); WARNINGA
("Interface_id=%d is now STARTED, the Skype client to which we are connected gave us the correct CURRENTUSERHANDLE (%s)\n",
SKYPIAX_P_LOG, interface_id,
globals.SKYPIAX_INTERFACES[interface_id].skype_user);
} else { } else {
ERRORA("The Skype client to which we are connected FAILED to gave us CURRENTUSERHANDLE=%s, interface_id=%d FAILED to start. No Skype client logged in as '%s' has been found. Please (re)launch a Skype client logged in as '%s'. Skypiax exiting now\n", SKYPIAX_P_LOG, globals.SKYPIAX_INTERFACES[interface_id].skype_user, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user, globals.SKYPIAX_INTERFACES[interface_id].skype_user); ERRORA
("The Skype client to which we are connected FAILED to gave us CURRENTUSERHANDLE=%s, interface_id=%d FAILED to start. No Skype client logged in as '%s' has been found. Please (re)launch a Skype client logged in as '%s'. Skypiax exiting now\n",
SKYPIAX_P_LOG, globals.SKYPIAX_INTERFACES[interface_id].skype_user,
interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user,
globals.SKYPIAX_INTERFACES[interface_id].skype_user);
running = 0; running = 0;
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
@ -1164,7 +1180,9 @@ int new_inbound_channel(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 ((session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) { if ((session =
switch_core_session_request(skypiax_endpoint_interface,
SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
switch_core_session_add_stream(session, NULL); switch_core_session_add_stream(session, NULL);
channel = switch_core_session_get_channel(session); channel = switch_core_session_get_channel(session);
skypiax_tech_init(tech_pvt, session); skypiax_tech_init(tech_pvt, session);
@ -1221,7 +1239,6 @@ int remote_party_is_ringing(private_t * tech_pvt)
return 0; return 0;
} }
int remote_party_is_early_media(private_t * tech_pvt) int remote_party_is_early_media(private_t * tech_pvt)
{ {
switch_core_session_t *session = NULL; switch_core_session_t *session = NULL;

View File

@ -273,8 +273,8 @@ int skypiax_signaling_read(private_t * tech_pvt)
char msg_to_skype[1024]; char msg_to_skype[1024];
tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA; tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING; tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
NOTICA("Our remote party in skype_call %s is EARLYMEDIA\n", NOTICA("Our remote party in skype_call %s is EARLYMEDIA\n", SKYPIAX_P_LOG,
SKYPIAX_P_LOG, id); id);
sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id,
tech_pvt->tcp_cli_port); tech_pvt->tcp_cli_port);
skypiax_signaling_write(tech_pvt, msg_to_skype); skypiax_signaling_write(tech_pvt, msg_to_skype);
@ -607,7 +607,8 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
if (!running) if (!running)
break; break;
while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN
&& (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|| tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
unsigned int fdselect; unsigned int fdselect;
int rt; int rt;