static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id);
static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig);
-static switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *session);
+static switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *session);
static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms)
{
session = switch_core_session_locate(tech_pvt->session_uuid_str);
- if(session){
+ if (session) {
switch_core_session_set_read_codec(session, &tech_pvt->read_codec);
switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
switch_core_session_rwunlock(session);
switch_mutex_init(&tech_pvt->flag_mutex, SWITCH_MUTEX_NESTED, switch_core_session_get_pool(session));
switch_core_session_set_private(session, tech_pvt);
switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(session), sizeof(tech_pvt->session_uuid_str));
- if(!strlen(tech_pvt->session_uuid_str)){
+ if (!strlen(tech_pvt->session_uuid_str)) {
ERRORA("no tech_pvt->session_uuid_str\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
switch_caller_profile_t *outbound_profile,
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
{
- private_t *tech_pvt = NULL;
+ private_t *tech_pvt = NULL;
if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
switch_channel_t *channel = NULL;
switch_caller_profile_t *caller_profile;
//DEBUGA_SKYPE("Finding one available skype interface\n", SKYPIAX_P_LOG);
//tech_pvt = find_available_skypiax_interface(NULL);
//if (tech_pvt)
- //found = 1;
- //} else if (strncmp("RR", interface_name, strlen(interface_name)) == 0) {
+ //found = 1;
+ //} else if (strncmp("RR", interface_name, strlen(interface_name)) == 0) {
/* Find the first idle interface using Round Robin */
DEBUGA_SKYPE("Finding one available skype interface RR\n", SKYPIAX_P_LOG);
tech_pvt = find_available_skypiax_interface_rr(NULL);
}
channel = switch_core_session_get_channel(*new_session);
- if(!channel){
+ if (!channel) {
ERRORA("Doh! no channel?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
- if( skypiax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS){
+ if (skypiax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) {
ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
channel = switch_core_session_get_channel(session);
if (channel) {
switch_channel_state_t state = switch_channel_get_state(channel);
- if(state < CS_EXECUTE){
- usleep(10000);//10 msec, let the state evolve from CS_NEW
+ if (state < CS_EXECUTE) {
+ usleep(10000); //10 msec, let the state evolve from CS_NEW
}
switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING);
} else {
ERRORA("no channel?\n", SKYPIAX_P_LOG);
}
- switch_core_session_rwunlock(session);
+ switch_core_session_rwunlock(session);
} else {
DEBUGA_SKYPE("no session\n", SKYPIAX_P_LOG);
}
*tech_pvt->skype_call_id = '\0';
//ERRORA("LET'S WAIT\n", SKYPIAX_P_LOG);
- usleep(300000); //0.3 sec
+ usleep(300000); //0.3 sec
//ERRORA("WAIT'S OVER\n", SKYPIAX_P_LOG);
tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
} else {
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
if (switch_thread_create(&tech_pvt->tcp_srv_thread, thd_attr, skypiax_do_tcp_srv_thread, tech_pvt, skypiax_module_pool) == SWITCH_STATUS_SUCCESS) {
- DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG);
+ DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG);
} else {
- ERRORA("failed to start tcp_srv_thread thread.\n", SKYPIAX_P_LOG);
- return -1;
+ ERRORA("failed to start tcp_srv_thread thread.\n", SKYPIAX_P_LOG);
+ return -1;
}
switch_threadattr_create(&thd_attr, skypiax_module_pool);
switch_threadattr_detach_set(thd_attr, 1);
switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE);
- if(switch_thread_create(&tech_pvt->tcp_cli_thread, thd_attr, skypiax_do_tcp_cli_thread, tech_pvt, skypiax_module_pool) == SWITCH_STATUS_SUCCESS) {
- DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG);
- }else{
- ERRORA("failed to start tcp_cli_thread thread.\n", SKYPIAX_P_LOG);
- return -1;
+ if (switch_thread_create(&tech_pvt->tcp_cli_thread, thd_attr, skypiax_do_tcp_cli_thread, tech_pvt, skypiax_module_pool) == SWITCH_STATUS_SUCCESS) {
+ DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG);
+ } else {
+ ERRORA("failed to start tcp_cli_thread thread.\n", SKYPIAX_P_LOG);
+ return -1;
}
switch_sleep(100000);
- if(tech_pvt->tcp_cli_thread == NULL || tech_pvt->tcp_srv_thread == NULL) {
+ if (tech_pvt->tcp_cli_thread == NULL || tech_pvt->tcp_srv_thread == NULL) {
ERRORA("tcp_cli_thread or tcp_srv_thread exited\n", SKYPIAX_P_LOG);
return -1;
}
if ((session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
switch_core_session_add_stream(session, NULL);
channel = switch_core_session_get_channel(session);
- if(!channel){
+ if (!channel) {
ERRORA("Doh! no channel?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(&session);
return 0;
}
- if( skypiax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS){
+ if (skypiax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) {
ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(&session);
return 0;
return 0;
}
}
- if(channel){
+ if (channel) {
switch_channel_mark_answered(channel);
}
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
skype_state = tech_pvt->interface_state;
//DEBUGA_SKYPE("skype interface: %d, name: %s, state: %d\n", SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].name, skype_state);
- if ((tech_pvt_calling ? strcmp(tech_pvt->skype_user, tech_pvt_calling->skype_user) : 1) && (SKYPIAX_STATE_DOWN == skype_state || 0 == skype_state) && (tech_pvt->skype_callflow ==CALLFLOW_STATUS_FINISHED || 0 == tech_pvt->skype_callflow )) {
- DEBUGA_SKYPE("returning as available skype interface name: %s, state: %d callflow: %d\n", SKYPIAX_P_LOG, tech_pvt->name, skype_state, tech_pvt->skype_callflow);
+ if ((tech_pvt_calling ? strcmp(tech_pvt->skype_user, tech_pvt_calling->skype_user) : 1)
+ && (SKYPIAX_STATE_DOWN == skype_state || 0 == skype_state) && (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED
+ || 0 == tech_pvt->skype_callflow)) {
+ DEBUGA_SKYPE("returning as available skype interface name: %s, state: %d callflow: %d\n", SKYPIAX_P_LOG, tech_pvt->name, skype_state,
+ tech_pvt->skype_callflow);
/*set to Dialing state to avoid other thread fint it, don't know if it is safe */
//XXX no, it's not safe
- if(tech_pvt_calling == NULL){
- tech_pvt->interface_state = SKYPIAX_STATE_SELECTED ;
+ if (tech_pvt_calling == NULL) {
+ tech_pvt->interface_state = SKYPIAX_STATE_SELECTED;
}
switch_mutex_unlock(globals.mutex);
("FOUND (name=%s, giovatech->interface_state=%d != SKYPIAX_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->callid_number=%s == value=%s)\n",
SKYPIAX_P_LOG, giovatech->name, giovatech->interface_state,
giovatech->skype_user, tech_pvt->skype_user, giovatech->callid_number, value)
- if(tech_pvt->interface_state == SKYPIAX_STATE_PRERING){
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
- }else if (tech_pvt->interface_state != 0 && tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
- WARNINGA("Why an interface_state %d HERE?\n", SKYPIAX_P_LOG, tech_pvt->interface_state);
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
- }
+ if (tech_pvt->interface_state == SKYPIAX_STATE_PRERING) {
+ tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ } else if (tech_pvt->interface_state != 0 && tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
+ WARNINGA("Why an interface_state %d HERE?\n", SKYPIAX_P_LOG, tech_pvt->interface_state);
+ tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ }
break;
}
if (found) {
//tech_pvt->callid_number[0]='\0';
- //sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- //skypiax_signaling_write(tech_pvt, msg_to_skype);
+ //sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
+ //skypiax_signaling_write(tech_pvt, msg_to_skype);
switch_mutex_unlock(globals.mutex);
return 0;
}
ERRORA("No Call ID?\n", SKYPIAX_P_LOG);
} else {
DEBUGA_SKYPE("We're in a call now (%s), let's refuse this one (%s)\n", SKYPIAX_P_LOG, tech_pvt->skype_call_id, id);
- sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
+ skypiax_signaling_write(tech_pvt, msg_to_skype);
}
switch_mutex_unlock(globals.mutex);
if (found) {
//tech_pvt->callid_number[0]='\0';
- //sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- //skypiax_signaling_write(tech_pvt, msg_to_skype);
+ //sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
+ //skypiax_signaling_write(tech_pvt, msg_to_skype);
switch_mutex_unlock(globals.mutex);
return 0;
}
if (found) {
//tech_pvt->callid_number[0]='\0';
//sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- //skypiax_signaling_write(tech_pvt, msg_to_skype);
+ //skypiax_signaling_write(tech_pvt, msg_to_skype);
switch_mutex_unlock(globals.mutex);
return 0;
}
("Not answering the skype_call %s, because we are already in a skypiax call(%s) and not transferring, because no other skypiax interfaces are available\n",
SKYPIAX_P_LOG, id, tech_pvt->skype_call_id);
sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ skypiax_signaling_write(tech_pvt, msg_to_skype);
}
switch_sleep(10000);
DEBUGA_SKYPE
#endif /* WIN32 */
/*************************************/
-int skypiax_socket_create_and_bind(private_t * tech_pvt, int * which_port)
+int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port)
{
- int s=-1;
+ int s = -1;
struct sockaddr_in my_addr;
int start_port = 6001;
return -1;
}
- if(*which_port != 0)
+ if (*which_port != 0)
start_port = *which_port;
my_addr.sin_port = htons(start_port);
//tech_pvt->tcp_cli_port = start_port;
*which_port = start_port;
while (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) {
- DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port);
+ DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port,
+ tech_pvt->tcp_srv_port);
DEBUGA_SKYPE("EADDRINUSE=%d, bind errno=%d, error: %s\n", SKYPIAX_P_LOG, EADDRINUSE, errno, strerror(errno));
start_port++;
my_addr.sin_port = htons(start_port);
*which_port = start_port;
- DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port);
+ DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port,
+ tech_pvt->tcp_srv_port);
- if(start_port > 65000){
- ERRORA("NO MORE PORTS! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port);
+ if (start_port > 65000) {
+ ERRORA("NO MORE PORTS! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port,
+ tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port);
return -1;
}
//usleep(100);
}
- DEBUGA_SKYPE("SUCCESS! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port);
+ DEBUGA_SKYPE("SUCCESS! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port,
+ tech_pvt->tcp_srv_port);
return s;
}
if (read_from_pipe[i] == '\0') {
//if (!strstr(message, "DURATION")) {
- DEBUGA_SKYPE("READING: |||%s||| \n", SKYPIAX_P_LOG, message);
+ DEBUGA_SKYPE("READING: |||%s||| \n", SKYPIAX_P_LOG, message);
//}
if (!strcasecmp(message, "ERROR 68")) {
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
}
}
- /*
- if (!strncasecmp(message, "ERROR 96 CALL", 12) ) {
- ERRORA("Skype got ERROR: |||%s|||, we are trying to use this interface to make or receive a call, but another call is half-active on this interface. We abort this attenpt and leave the previous one to continue.\n", SKYPIAX_P_LOG, message);
- tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
- DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
- tech_pvt->skype_call_id[0] = '\0';
-
- if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) {
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
- return CALLFLOW_INCOMING_HANGUP;
- } else {
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
- }
- }
- */
/*
- if (!strncasecmp(message, "ERROR 99 CALL", 12) ) {
- //TODO: let's kill the call
- ERRORA("Skype got ERROR: |||%s|||, another call is active on this interface\n\n\n", SKYPIAX_P_LOG, message);
- //tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
- //DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
- //tech_pvt->skype_call_id[0] = '\0';
+ if (!strncasecmp(message, "ERROR 96 CALL", 12) ) {
+ ERRORA("Skype got ERROR: |||%s|||, we are trying to use this interface to make or receive a call, but another call is half-active on this interface. We abort this attenpt and leave the previous one to continue.\n", SKYPIAX_P_LOG, message);
+ tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
+ DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
+ tech_pvt->skype_call_id[0] = '\0';
+
+ if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) {
+ tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ return CALLFLOW_INCOMING_HANGUP;
+ } else {
+ tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ }
+ }
+ */
+ /*
+ if (!strncasecmp(message, "ERROR 99 CALL", 12) ) {
+ //TODO: let's kill the call
+ ERRORA("Skype got ERROR: |||%s|||, another call is active on this interface\n\n\n", SKYPIAX_P_LOG, message);
+ //tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
+ //DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG);
+ //tech_pvt->skype_call_id[0] = '\0';
- tech_pvt->interface_state = SKYPIAX_STATE_ERROR_DOUBLE_CALL;
- }
- */
+ tech_pvt->interface_state = SKYPIAX_STATE_ERROR_DOUBLE_CALL;
+ }
+ */
if (!strncasecmp(message, "ERROR", 4)) {
- if (!strncasecmp(message, "ERROR 96 CALL", 12) ) {
- DEBUGA_SKYPE("Skype got ERROR: |||%s|||, we are trying to use this interface to make or receive a call, but another call is half-active on this interface. Let's the previous one to continue.\n", SKYPIAX_P_LOG, message);
- } else if (!strncasecmp(message, "ERROR 99 CALL", 12) ) {
+ if (!strncasecmp(message, "ERROR 96 CALL", 12)) {
+ DEBUGA_SKYPE
+ ("Skype got ERROR: |||%s|||, we are trying to use this interface to make or receive a call, but another call is half-active on this interface. Let's the previous one to continue.\n",
+ SKYPIAX_P_LOG, message);
+ } else if (!strncasecmp(message, "ERROR 99 CALL", 12)) {
ERRORA("Skype got ERROR: |||%s|||, another call is active on this interface\n\n\n", SKYPIAX_P_LOG, message);
tech_pvt->interface_state = SKYPIAX_STATE_ERROR_DOUBLE_CALL;
} else if (!strncasecmp(message, "ERROR 592 ALTER CALL", 19)) {
ERRORA("Skype got ERROR about TRANSFERRING, no problem: |||%s|||\n", SKYPIAX_P_LOG, message);
} else if (!strncasecmp(message, "ERROR 559 CALL", 13)) {
- DEBUGA_SKYPE("Skype got ERROR about a failed action (probably TRYING to HANGUP A CALL), no problem: |||%s|||\n", SKYPIAX_P_LOG, message);
+ DEBUGA_SKYPE("Skype got ERROR about a failed action (probably TRYING to HANGUP A CALL), no problem: |||%s|||\n", SKYPIAX_P_LOG,
+ message);
} else {
ERRORA("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, message);
tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED;
if (!strcasecmp(prop, "PARTNER_HANDLE")) {
if (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str)) {
- //if (!strlen(tech_pvt->skype_call_id)) {
+ //if (!strlen(tech_pvt->skype_call_id)) {
/* we are NOT inside an active call */
DEBUGA_SKYPE("Call %s TRY ANSWER\n", SKYPIAX_P_LOG, id);
skypiax_answer(tech_pvt, id, value);
if (!strcasecmp(value, "RINGING")) {
char msg_to_skype[1024];
- if ( (tech_pvt->interface_state != SKYPIAX_STATE_SELECTED && tech_pvt->interface_state != SKYPIAX_STATE_DIALING ) && (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str)) ) {
+ if ((tech_pvt->interface_state != SKYPIAX_STATE_SELECTED && tech_pvt->interface_state != SKYPIAX_STATE_DIALING)
+ && (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str))) {
/* we are NOT inside an active call */
- DEBUGA_SKYPE("NO ACTIVE calls in this moment, skype_call %s is RINGING, to ask PARTNER_HANDLE\n", SKYPIAX_P_LOG, id);
+ DEBUGA_SKYPE("NO ACTIVE calls in this moment, skype_call %s is RINGING, to ask PARTNER_HANDLE\n", SKYPIAX_P_LOG, id);
sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id);
skypiax_signaling_write(tech_pvt, msg_to_skype);
skypiax_sleep(10000);
DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", SKYPIAX_P_LOG, id);
remote_party_is_ringing(tech_pvt);
} else {
- DEBUGA_SKYPE("We are in another call, but skype_call %s is RINGING on us, let's ask PARTNER_HANDLE, so maybe we'll TRANSFER\n", SKYPIAX_P_LOG, id);
+ DEBUGA_SKYPE
+ ("We are in another call, but skype_call %s is RINGING on us, let's ask PARTNER_HANDLE, so maybe we'll TRANSFER\n",
+ SKYPIAX_P_LOG, id);
sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id);
skypiax_signaling_write(tech_pvt, msg_to_skype);
skypiax_sleep(10000);
tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", SKYPIAX_P_LOG, id);
- if (start_audio_threads(tech_pvt)){
+ if (start_audio_threads(tech_pvt)) {
ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG);
return CALLFLOW_INCOMING_HANGUP;
}
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
tech_pvt->interface_state = SKYPIAX_STATE_UP;
- if (start_audio_threads(tech_pvt)){
- ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG);
- return CALLFLOW_INCOMING_HANGUP;
- }
+ if (start_audio_threads(tech_pvt)) {
+ ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG);
+ return CALLFLOW_INCOMING_HANGUP;
+ }
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);
#endif //NOTDEF
s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port);
- if(s < 0)
- {
+ if (s < 0) {
ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
return NULL;
}
tech_pvt->tcp_cli_thread = NULL;
return NULL;
}
-
#endif // NOTDEF
s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port);
- if(s < 0)
- {
+ if (s < 0) {
ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
return NULL;
}