skypiax: do EARLY MEDIA when requested (mainly by skypeout calls)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12411 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Giovanni Maruzzelli 2009-03-04 19:03:25 +00:00
parent add42a2759
commit 11562cedf0
2 changed files with 17 additions and 5 deletions

View File

@ -1241,8 +1241,8 @@ int remote_party_is_early_media(private_t * tech_pvt)
ERRORA("No session???\n", SKYPIAX_P_LOG);
}
if (channel) {
//switch_channel_mark_pre_answered(channel);
NOTICA("skype_call: REMOTE PARTY EARLY MEDIA, we will pass you the audio, just the code is not yet written :-)\n", SKYPIAX_P_LOG);
switch_channel_mark_pre_answered(channel);
NOTICA("skype_call: REMOTE PARTY EARLY MEDIA\n", SKYPIAX_P_LOG);
} else {
ERRORA("No channel???\n", SKYPIAX_P_LOG);
}

View File

@ -270,10 +270,19 @@ int skypiax_signaling_read(private_t * tech_pvt)
remote_party_is_ringing(tech_pvt);
}
} else if (!strcasecmp(value, "EARLYMEDIA")) {
char msg_to_skype[1024];
tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
NOTICA("Our remote party in skype_call %s is EARLYMEDIA\n",
SKYPIAX_P_LOG, id);
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);
start_audio_threads(tech_pvt);
sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id,
tech_pvt->tcp_srv_port);
skypiax_signaling_write(tech_pvt, msg_to_skype);
remote_party_is_early_media(tech_pvt);
} else if (!strcasecmp(value, "MISSED")) {
DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id);
@ -344,10 +353,11 @@ int skypiax_signaling_read(private_t * tech_pvt)
if (!strlen(tech_pvt->session_uuid_str) || !strlen(tech_pvt->skype_call_id)
|| !strcasecmp(tech_pvt->skype_call_id, id)) {
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_UP;
DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id);
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_EARLYMEDIA){
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
tech_pvt->interface_state = SKYPIAX_STATE_UP;
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);
@ -355,6 +365,7 @@ int skypiax_signaling_read(private_t * tech_pvt)
sprintf(msg_to_skype, "ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id,
tech_pvt->tcp_srv_port);
skypiax_signaling_write(tech_pvt, msg_to_skype);
}
tech_pvt->skype_callflow = SKYPIAX_STATE_UP;
if (!strlen(tech_pvt->session_uuid_str)) {
DEBUGA_SKYPE("New Inbound Channel!\n", SKYPIAX_P_LOG);
@ -445,6 +456,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
break;
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 == SKYPIAX_STATE_UP)) {
unsigned int fdselect;
@ -595,7 +607,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
if (!running)
break;
while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN
&& (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS
&& (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|| tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
unsigned int fdselect;
int rt;