mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-16 16:58:35 +00:00
skypiax: now it manages the REMOTEHOLD status, when the remote party puts the call on-hold
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13667 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
e8a262b729
commit
0b0d4077c1
@ -126,6 +126,7 @@ typedef enum {
|
|||||||
#define SKYPIAX_STATE_HANGUP_REQUESTED 200
|
#define SKYPIAX_STATE_HANGUP_REQUESTED 200
|
||||||
//FIXME CALLFLOW_INCOMING_CALLID to be removed
|
//FIXME CALLFLOW_INCOMING_CALLID to be removed
|
||||||
#define CALLFLOW_INCOMING_CALLID 1019
|
#define CALLFLOW_INCOMING_CALLID 1019
|
||||||
|
#define CALLFLOW_STATUS_REMOTEHOLD 201
|
||||||
|
|
||||||
/*********************************/
|
/*********************************/
|
||||||
|
|
||||||
|
@ -372,11 +372,13 @@ int skypiax_signaling_read(private_t * tech_pvt)
|
|||||||
} else if (!strcasecmp(value, "INPROGRESS")) {
|
} else if (!strcasecmp(value, "INPROGRESS")) {
|
||||||
char msg_to_skype[1024];
|
char msg_to_skype[1024];
|
||||||
|
|
||||||
|
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
|
||||||
if (!strlen(tech_pvt->session_uuid_str) || !strlen(tech_pvt->skype_call_id)
|
if (!strlen(tech_pvt->session_uuid_str) || !strlen(tech_pvt->skype_call_id)
|
||||||
|| !strcasecmp(tech_pvt->skype_call_id, id)) {
|
|| !strcasecmp(tech_pvt->skype_call_id, id)) {
|
||||||
skypiax_strncpy(tech_pvt->skype_call_id, id,
|
skypiax_strncpy(tech_pvt->skype_call_id, id,
|
||||||
sizeof(tech_pvt->skype_call_id) - 1);
|
sizeof(tech_pvt->skype_call_id) - 1);
|
||||||
DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id);
|
DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id);
|
||||||
|
|
||||||
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_EARLYMEDIA) {
|
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_EARLYMEDIA) {
|
||||||
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
|
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
|
||||||
tech_pvt->interface_state = SKYPIAX_STATE_UP;
|
tech_pvt->interface_state = SKYPIAX_STATE_UP;
|
||||||
@ -402,6 +404,14 @@ int skypiax_signaling_read(private_t * tech_pvt)
|
|||||||
DEBUGA_SKYPE("I'm on %s, skype_call %s is NOT MY call, ignoring\n",
|
DEBUGA_SKYPE("I'm on %s, skype_call %s is NOT MY call, ignoring\n",
|
||||||
SKYPIAX_P_LOG, tech_pvt->skype_call_id, id);
|
SKYPIAX_P_LOG, tech_pvt->skype_call_id, id);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS;
|
||||||
|
WARNINGA("Back from REMOTEHOLD!\n", SKYPIAX_P_LOG);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else if (!strcasecmp(value, "REMOTEHOLD")) {
|
||||||
|
tech_pvt->skype_callflow = CALLFLOW_STATUS_REMOTEHOLD;
|
||||||
|
WARNINGA("skype_call: %s is now REMOTEHOLD\n", SKYPIAX_P_LOG, id);
|
||||||
} else {
|
} else {
|
||||||
WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id,
|
WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id,
|
||||||
value);
|
value);
|
||||||
@ -485,6 +495,7 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
|
|||||||
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_INPROGRESS
|
||||||
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|
||||||
|
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD
|
||||||
|| tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
|
|| tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
|
||||||
|
|
||||||
unsigned int fdselect;
|
unsigned int fdselect;
|
||||||
@ -508,7 +519,11 @@ void *skypiax_do_tcp_srv_thread_func(void *obj)
|
|||||||
#ifdef FARMING
|
#ifdef FARMING
|
||||||
switch_sleep(500); //seems that reconnecting through a proxy leads to half the packet size, bizarrely, 158-162, never 160 :-)
|
switch_sleep(500); //seems that reconnecting through a proxy leads to half the packet size, bizarrely, 158-162, never 160 :-)
|
||||||
#endif // FARMING
|
#endif // FARMING
|
||||||
|
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
|
||||||
len = recv(fd, (char *) srv_in, 320, 0); //seems that Skype only sends 320 bytes at time
|
len = recv(fd, (char *) srv_in, 320, 0); //seems that Skype only sends 320 bytes at time
|
||||||
|
} else {
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (len == 320) {
|
if (len == 320) {
|
||||||
unsigned int howmany;
|
unsigned int howmany;
|
||||||
@ -642,6 +657,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
|||||||
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_INPROGRESS
|
||||||
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA
|
||||||
|
|| tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD
|
||||||
|| tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
|
|| tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) {
|
||||||
unsigned int fdselect;
|
unsigned int fdselect;
|
||||||
int rt;
|
int rt;
|
||||||
@ -699,6 +715,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
|
/* send the 16khz frame to the Skype client waiting for incoming audio to be sent to the remote party */
|
||||||
|
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
|
||||||
len = send(fd, (char *) cli_out, got, 0);
|
len = send(fd, (char *) cli_out, got, 0);
|
||||||
skypiax_sleep(5000); //5 msec
|
skypiax_sleep(5000); //5 msec
|
||||||
|
|
||||||
@ -709,6 +726,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
|||||||
skypiax_sleep(1000);
|
skypiax_sleep(1000);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -719,9 +737,17 @@ void *skypiax_do_tcp_cli_thread_func(void *obj)
|
|||||||
if (rt)
|
if (rt)
|
||||||
ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt);
|
ERRORA("CLI rt=%d\n", SKYPIAX_P_LOG, rt);
|
||||||
memset(cli_out, 0, sizeof(cli_out));
|
memset(cli_out, 0, sizeof(cli_out));
|
||||||
|
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
|
||||||
len = send(fd, (char *) cli_out, sizeof(cli_out), 0);
|
len = send(fd, (char *) cli_out, sizeof(cli_out), 0);
|
||||||
len = send(fd, (char *) cli_out, sizeof(cli_out) / 2, 0);
|
len = send(fd, (char *) cli_out, sizeof(cli_out) / 2, 0);
|
||||||
//DEBUGA_SKYPE("sent %d of zeros to keep the Skype client socket busy\n", SKYPIAX_P_LOG, sizeof(cli_out) + sizeof(cli_out)/2);
|
//WARNINGA("sent %d of zeros to keep the Skype client socket busy\n", SKYPIAX_P_LOG, sizeof(cli_out) + sizeof(cli_out)/2);
|
||||||
|
} else {
|
||||||
|
/*
|
||||||
|
XXX do nothing
|
||||||
|
*/
|
||||||
|
//WARNINGA("we don't send it\n", SKYPIAX_P_LOG);
|
||||||
|
}
|
||||||
|
skypiax_sleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user