Modified: freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c (14546 => 14547)
--- freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c 2009-08-17 09:48:26 UTC (rev 14546)
+++ freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c 2009-08-17 10:05:07 UTC (rev 14547)
@@ -1,18 +1,18 @@
-#include "skypiax.h"
+#include "celliax.h"
#ifdef ASTERISK
-#define skypiax_sleep usleep
-#define skypiax_strncpy strncpy
+#define celliax_sleep usleep
+#define celliax_strncpy strncpy
#define tech_pvt p
-extern int skypiax_debug;
-extern char *skypiax_console_active;
+extern int celliax_debug;
+extern char *celliax_console_active;
#else /* FREESWITCH */
-#define skypiax_sleep switch_sleep
-#define skypiax_strncpy switch_copy_string
-extern switch_memory_pool_t *skypiax_module_pool;
-extern switch_endpoint_interface_t *skypiax_endpoint_interface;
+#define celliax_sleep switch_sleep
+#define celliax_strncpy switch_copy_string
+extern switch_memory_pool_t *celliax_module_pool;
+extern switch_endpoint_interface_t *celliax_endpoint_interface;
#endif /* ASTERISK */
-int samplerate_skypiax = SAMPLERATE_SKYPIAX;
+int samplerate_celliax = SAMPLERATE_SKYPIAX;
extern int running;
@@ -26,7 +26,7 @@
#endif /* WIN32 */
/*************************************/
-int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port)
+int celliax_socket_create_and_bind(private_t * tech_pvt, int *which_port)
{
int s = -1;
struct sockaddr_in my_addr;
@@ -69,7 +69,7 @@
return s;
}
-int skypiax_signaling_read(private_t * tech_pvt)
+int celliax_signaling_read(private_t * tech_pvt)
{
char read_from_pipe[4096];
char message[4096];
@@ -84,7 +84,7 @@
memset(message, 0, 4096);
memset(message_2, 0, 4096);
- howmany = skypiax_pipe_read(tech_pvt->SkypiaxHandles.fdesc[0], (short *) read_from_pipe, sizeof(read_from_pipe));
+ howmany = celliax_pipe_read(tech_pvt->SkypiaxHandles.fdesc[0], (short *) read_from_pipe, sizeof(read_from_pipe));
a = 0;
for (i = 0; i < howmany; i++) {
@@ -101,9 +101,9 @@
DEBUGA_SKYPE
("If I don't connect immediately, please give the Skype client authorization to be connected by Skypiax (and to not ask you again)\n",
SKYPIAX_P_LOG);
- skypiax_sleep(1000000);
- skypiax_signaling_write(tech_pvt, "PROTOCOL 7");
- skypiax_sleep(10000);
+ celliax_sleep(1000000);
+ celliax_signaling_write(tech_pvt, "PROTOCOL 7");
+ celliax_sleep(10000);
return 0;
}
if (!strncasecmp(message, "ERROR 92 CALL", 12)) {
@@ -151,7 +151,7 @@
- skypiax_strncpy(message_2, message, sizeof(message) - 1);
+ celliax_strncpy(message_2, message, sizeof(message) - 1);
buf = message;
stringp = &buf;
where = strsep(stringp, " ");
@@ -167,9 +167,9 @@
if (!strcasecmp(message, "CURRENTUSERHANDLE")) {
- skypiax_strncpy(obj, where, sizeof(obj) - 1);
+ celliax_strncpy(obj, where, sizeof(obj) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(id, where, sizeof(id) - 1);
+ celliax_strncpy(id, where, sizeof(id) - 1);
if (!strcasecmp(id, tech_pvt->skype_user)) {
tech_pvt->SkypiaxHandles.currentuserhandle = 1;
DEBUGA_SKYPE
@@ -178,51 +178,51 @@
}
}
if (!strcasecmp(message, "USER")) {
- skypiax_strncpy(obj, where, sizeof(obj) - 1);
+ celliax_strncpy(obj, where, sizeof(obj) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(id, where, sizeof(id) - 1);
+ celliax_strncpy(id, where, sizeof(id) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(prop, where, sizeof(prop) - 1);
+ celliax_strncpy(prop, where, sizeof(prop) - 1);
if (!strcasecmp(prop, "RECEIVEDAUTHREQUEST")) {
char msg_to_skype[256];
DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, message, obj, id, prop);
//TODO: allow authorization based on config param
sprintf(msg_to_skype, "SET USER %s ISAUTHORIZED TRUE", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
}
if (!strcasecmp(message, "MESSAGE")) {
- skypiax_strncpy(obj, where, sizeof(obj) - 1);
+ celliax_strncpy(obj, where, sizeof(obj) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(id, where, sizeof(id) - 1);
+ celliax_strncpy(id, where, sizeof(id) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(prop, where, sizeof(prop) - 1);
+ celliax_strncpy(prop, where, sizeof(prop) - 1);
if (!strcasecmp(prop, "STATUS")) {
where = strsep(stringp, " ");
- skypiax_strncpy(value, where, sizeof(value) - 1);
+ celliax_strncpy(value, where, sizeof(value) - 1);
if (!strcasecmp(value, "RECEIVED")) {
char msg_to_skype[256];
DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s value: %s!\n", SKYPIAX_P_LOG, message, obj, id, prop, value);
//TODO: authomatically flag messages as read based on config param
sprintf(msg_to_skype, "SET MESSAGE %s SEEN", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
} else if (!strcasecmp(prop, "BODY")) {
char msg_to_skype[256];
DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, message, obj, id, prop);
//TODO: authomatically flag messages as read based on config param
sprintf(msg_to_skype, "SET MESSAGE %s SEEN", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
}
if (!strcasecmp(message, "CALL")) {
- skypiax_strncpy(obj, where, sizeof(obj) - 1);
+ celliax_strncpy(obj, where, sizeof(obj) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(id, where, sizeof(id) - 1);
+ celliax_strncpy(id, where, sizeof(id) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(prop, where, sizeof(prop) - 1);
+ celliax_strncpy(prop, where, sizeof(prop) - 1);
where = strsep(stringp, " ");
- skypiax_strncpy(value, where, sizeof(value) - 1);
+ celliax_strncpy(value, where, sizeof(value) - 1);
where = strsep(stringp, " ");
//DEBUGA_SKYPE
@@ -234,16 +234,16 @@
//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);
+ celliax_answer(tech_pvt, id, value);
} else {
/* we are inside an active call */
if (!strcasecmp(tech_pvt->skype_call_id, id)) {
/* this is the call in which we are calling out */
DEBUGA_SKYPE("Call %s DO NOTHING\n", SKYPIAX_P_LOG, id);
} else {
- skypiax_sleep(400000); //0.4 seconds
+ celliax_sleep(400000); //0.4 seconds
DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPIAX_P_LOG, id);
- skypiax_transfer(tech_pvt, id, value);
+ celliax_transfer(tech_pvt, id, value);
}
}
}
@@ -272,18 +272,18 @@
}
if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) {
if (strcasecmp(id, tech_pvt->skype_call_id)) {
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("We called a Skype contact and he answered us on skype_call: %s.\n", SKYPIAX_P_LOG, id);
}
}
if (!strcasecmp(prop, "DURATION") && (tech_pvt->interface_state == SKYPIAX_STATE_ERROR_DOUBLE_CALL)) {
char msg_to_skype[1024];
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
ERRORA("We are in a double call situation, trying to get out hanging up call id: %s.\n", SKYPIAX_P_LOG, id);
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
- skypiax_sleep(10000);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_sleep(10000);
//return CALLFLOW_INCOMING_HANGUP;
}
@@ -297,15 +297,15 @@
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);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_sleep(10000);
} else {
/* we are inside an active call */
if (!strcasecmp(tech_pvt->skype_call_id, id)) {
/* this is the call in which we are calling out */
tech_pvt->skype_callflow = CALLFLOW_STATUS_RINGING;
tech_pvt->interface_state = SKYPIAX_STATE_RINGING;
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", SKYPIAX_P_LOG, id);
remote_party_is_ringing(tech_pvt);
} else {
@@ -313,8 +313,8 @@
("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);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_sleep(10000);
}
}
} else if (!strcasecmp(value, "EARLYMEDIA")) {
@@ -326,11 +326,11 @@
ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG);
return CALLFLOW_INCOMING_HANGUP;
}
- skypiax_sleep(1000);
+ celliax_sleep(1000);
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);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
remote_party_is_early_media(tech_pvt);
} else if (!strcasecmp(value, "MISSED")) {
@@ -365,7 +365,7 @@
tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED;
DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now FAILED\n", SKYPIAX_P_LOG, id);
tech_pvt->skype_call_id[0] = '\0';
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
return CALLFLOW_INCOMING_HANGUP;
} else if (!strcasecmp(value, "REFUSED")) {
@@ -373,7 +373,7 @@
/* this is the id of the call we are in, probably we generated it */
tech_pvt->skype_callflow = CALLFLOW_STATUS_REFUSED;
DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now REFUSED\n", SKYPIAX_P_LOG, id);
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
tech_pvt->skype_call_id[0] = '\0';
return CALLFLOW_INCOMING_HANGUP;
@@ -388,12 +388,12 @@
} else if (!strcasecmp(value, "ROUTING")) {
tech_pvt->skype_callflow = CALLFLOW_STATUS_ROUTING;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("skype_call: %s is now ROUTING\n", SKYPIAX_P_LOG, id);
} else if (!strcasecmp(value, "UNPLACED")) {
tech_pvt->skype_callflow = CALLFLOW_STATUS_UNPLACED;
tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("skype_call: %s is now UNPLACED\n", SKYPIAX_P_LOG, id);
} else if (!strcasecmp(value, "INPROGRESS")) {
char msg_to_skype[1024];
@@ -404,7 +404,7 @@
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) {
if (!strlen(tech_pvt->session_uuid_str) || !strlen(tech_pvt->skype_call_id)
|| !strcasecmp(tech_pvt->skype_call_id, id)) {
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id);
if (tech_pvt->skype_callflow != CALLFLOW_STATUS_EARLYMEDIA) {
@@ -415,12 +415,12 @@
ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG);
return CALLFLOW_INCOMING_HANGUP;
}
- skypiax_sleep(1000); //FIXME
+ celliax_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);
- skypiax_sleep(1000); //FIXME
+ celliax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_sleep(1000); //FIXME
sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
tech_pvt->skype_callflow = SKYPIAX_STATE_UP;
if (!strlen(tech_pvt->session_uuid_str)) {
@@ -447,20 +447,20 @@
DEBUGA_SKYPE
("we tried to call Skype on skype_call %s and remote party (destination) was BUSY. Our outbound call has failed\n",
SKYPIAX_P_LOG, id);
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
tech_pvt->skype_call_id[0] = '\0';
- skypiax_sleep(1000);
+ celliax_sleep(1000);
return CALLFLOW_INCOMING_HANGUP;
} else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) {
tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED;
DEBUGA_SKYPE
("we tried to call Skype on skype_call %s and remote party (destination) has rejected us (WAITING_REDIAL_COMMAND). Our outbound call has failed\n",
SKYPIAX_P_LOG, id);
- skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
+ celliax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
tech_pvt->skype_call_id[0] = '\0';
- skypiax_sleep(1000);
+ celliax_sleep(1000);
return CALLFLOW_INCOMING_HANGUP;
} else {
WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id, value);
@@ -472,19 +472,19 @@
/* DEBUGA_SKYPE("Skype MSG: message_2: %s, message2[11]: %s\n", SKYPIAX_P_LOG,
* message_2, &message_2[11]); */
memset(tech_pvt->skype_friends, 0, 4096);
- skypiax_strncpy(tech_pvt->skype_friends, &message_2[11], 4095);
+ celliax_strncpy(tech_pvt->skype_friends, &message_2[11], 4095);
}
if (!strcasecmp(message, "#222")) {
/* DEBUGA_SKYPE("Skype MSG: message_2: %s, message2[10]: %s\n", SKYPIAX_P_LOG,
* message_2, &message_2[10]); */
memset(tech_pvt->skype_fullname, 0, 512);
- skypiax_strncpy(tech_pvt->skype_fullname, &message_2[10], 511);
+ celliax_strncpy(tech_pvt->skype_fullname, &message_2[10], 511);
}
if (!strcasecmp(message, "#765")) {
/* DEBUGA_SKYPE("Skype MSG: message_2: %s, message2[10]: %s\n", SKYPIAX_P_LOG,
* message_2, &message_2[10]); */
memset(tech_pvt->skype_displayname, 0, 512);
- skypiax_strncpy(tech_pvt->skype_displayname, &message_2[10], 511);
+ celliax_strncpy(tech_pvt->skype_displayname, &message_2[10], 511);
}
a = 0;
} //message end
@@ -492,7 +492,7 @@
return 0;
}
-void *skypiax_do_tcp_srv_thread_func(void *obj)
+void *celliax_do_tcp_srv_thread_func(void *obj)
{
private_t *tech_pvt = obj;
int s;
@@ -514,9 +514,9 @@
short kill_cli_buff[SAMPLES_PER_FRAME];
short totalbuf[SAMPLES_PER_FRAME];
- s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port);
+ s = celliax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port);
if (s < 0) {
- ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
+ ERRORA("celliax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
return NULL;
}
DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG);
@@ -587,7 +587,7 @@
if (len == 320) {
unsigned int howmany;
- if (samplerate_skypiax == 8000) {
+ if (samplerate_celliax == 8000) {
/* we're downsampling from 16khz to 8khz, srv_out will contain each other sample from srv_in */
a = 0;
for (i = 0; i < len / sizeof(short); i++) {
@@ -595,7 +595,7 @@
i++;
a++;
}
- } else if (samplerate_skypiax == 16000) {
+ } else if (samplerate_celliax == 16000) {
/* we're NOT downsampling, srv_out will contain ALL samples from srv_in */
for (i = 0; i < len / sizeof(short); i++) {
srv_out[i] = srv_in[i];
@@ -619,7 +619,7 @@
i++;
}
/* send the complete frame through the pipe to our code waiting for incoming audio */
- howmany = skypiax_pipe_write(tech_pvt->audiopipe[1], totalbuf, SAMPLES_PER_FRAME * sizeof(short));
+ howmany = celliax_pipe_write(tech_pvt->audiopipe[1], totalbuf, SAMPLES_PER_FRAME * sizeof(short));
if (howmany != SAMPLES_PER_FRAME * sizeof(short)) {
ERRORA("howmany is %d, but was expected to be %d\n", SKYPIAX_P_LOG,
howmany, (int) (SAMPLES_PER_FRAME * sizeof(short)));
@@ -629,7 +629,7 @@
}
} else if (len == 0) {
- skypiax_sleep(1000);
+ celliax_sleep(1000);
} else {
DEBUGA_SKYPE("len=%d, expected 320\n", SKYPIAX_P_LOG, len);
}
@@ -637,24 +637,24 @@
} else {
if (rt)
ERRORA("SRV rt=%d\n", SKYPIAX_P_LOG, rt);
- skypiax_sleep(10000);
+ celliax_sleep(10000);
}
}
/* let's send some frame in the pipes, so both tcp_cli and tcp_srv will have an occasion to die */
kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
- len = skypiax_pipe_write(tech_pvt->audiopipe[1], kill_cli_buff, kill_cli_size);
+ len = celliax_pipe_write(tech_pvt->audiopipe[1], kill_cli_buff, kill_cli_size);
kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
- len = skypiax_pipe_write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
+ len = celliax_pipe_write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
- len = skypiax_pipe_write(tech_pvt->audiopipe[1], kill_cli_buff, kill_cli_size);
+ len = celliax_pipe_write(tech_pvt->audiopipe[1], kill_cli_buff, kill_cli_size);
kill_cli_size = SAMPLES_PER_FRAME * sizeof(short);
- len = skypiax_pipe_write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
+ len = celliax_pipe_write(tech_pvt->audioskypepipe[1], kill_cli_buff, kill_cli_size);
DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG);
- skypiax_close_socket(fd);
+ celliax_close_socket(fd);
//if (exit)
break;
}
@@ -662,12 +662,12 @@
}
DEBUGA_SKYPE("incoming audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
- skypiax_close_socket(s);
+ celliax_close_socket(s);
tech_pvt->tcp_srv_thread = NULL;
return NULL;
}
-void *skypiax_do_tcp_cli_thread_func(void *obj)
+void *celliax_do_tcp_cli_thread_func(void *obj)
{
private_t *tech_pvt = obj;
int s;
@@ -686,9 +686,9 @@
unsigned int sin_size;
#endif /* WIN32 */
- s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port);
+ s = celliax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port);
if (s < 0) {
- ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
+ ERRORA("celliax_socket_create_and_bind error!\n", SKYPIAX_P_LOG);
return NULL;
}
@@ -768,7 +768,7 @@
/* until we drained the pipe to empty */
for (counter = 0; counter < 10; counter++) {
/* read from the pipe the audio frame we are supposed to send out */
- got = skypiax_pipe_read(tech_pvt->audioskypepipe[0], cli_in, SAMPLES_PER_FRAME * sizeof(short));
+ got = celliax_pipe_read(tech_pvt->audioskypepipe[0], cli_in, SAMPLES_PER_FRAME * sizeof(short));
if (got == -1)
break;
@@ -777,7 +777,7 @@
}
if (got == SAMPLES_PER_FRAME * sizeof(short)) {
- if (samplerate_skypiax == 8000) {
+ if (samplerate_celliax == 8000) {
/* we're upsampling from 8khz to 16khz, cli_out will contain two times each sample from cli_in */
a = 0;
@@ -788,7 +788,7 @@
a++;
}
got = got * 2;
- } else if (samplerate_skypiax == 16000) {
+ } else if (samplerate_celliax == 16000) {
/* we're NOT upsampling, cli_out will contain just ALL samples from cli_in */
for (i = 0; i < got / sizeof(short); i++) {
cli_out[i] = cli_in[i];
@@ -800,13 +800,13 @@
/* 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);
- skypiax_sleep(5000); //5 msec
+ celliax_sleep(5000); //5 msec
if (len == -1) {
break;
} else if (len != got) {
ERRORA("len=%d\n", SKYPIAX_P_LOG, len);
- skypiax_sleep(1000);
+ celliax_sleep(1000);
break;
}
}
@@ -830,28 +830,28 @@
*/
//WARNINGA("we don't send it\n", SKYPIAX_P_LOG);
}
- skypiax_sleep(1000);
+ celliax_sleep(1000);
}
}
DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPIAX_P_LOG);
- skypiax_close_socket(fd);
+ celliax_close_socket(fd);
break;
}
}
}
DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPIAX_P_LOG);
- skypiax_close_socket(s);
+ celliax_close_socket(s);
tech_pvt->tcp_cli_thread = NULL;
return NULL;
}
-int skypiax_audio_read(private_t * tech_pvt)
+int celliax_audio_read(private_t * tech_pvt)
{
unsigned int samples;
- samples = skypiax_pipe_read(tech_pvt->audiopipe[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));
+ samples = celliax_pipe_read(tech_pvt->audiopipe[0], tech_pvt->read_frame.data, SAMPLES_PER_FRAME * sizeof(short));
if (samples != SAMPLES_PER_FRAME * sizeof(short)) {
if (samples)
@@ -864,30 +864,30 @@
return 1;
}
-int skypiax_senddigit(private_t * tech_pvt, char digit)
+int celliax_senddigit(private_t * tech_pvt, char digit)
{
char msg_to_skype[1024];
DEBUGA_SKYPE("DIGIT received: %c\n", SKYPIAX_P_LOG, digit);
sprintf(msg_to_skype, "SET CALL %s DTMF %c", tech_pvt->skype_call_id, digit);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
return 0;
}
-int skypiax_call(private_t * tech_pvt, char *rdest, int timeout)
+int celliax_call(private_t * tech_pvt, char *rdest, int timeout)
{
char msg_to_skype[1024];
- //skypiax_sleep(5000);
+ //celliax_sleep(5000);
DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest);
- //skypiax_signaling_write(tech_pvt, "SET AGC OFF");
- //skypiax_sleep(10000);
- //skypiax_signaling_write(tech_pvt, "SET AEC OFF");
- //skypiax_sleep(10000);
+ //celliax_signaling_write(tech_pvt, "SET AGC OFF");
+ //celliax_sleep(10000);
+ //celliax_signaling_write(tech_pvt, "SET AEC OFF");
+ //celliax_sleep(10000);
sprintf(msg_to_skype, "CALL %s", rdest);
- if (skypiax_signaling_write(tech_pvt, msg_to_skype) < 0) {
+ if (celliax_signaling_write(tech_pvt, msg_to_skype) < 0) {
ERRORA("failed to communicate with Skype client, now exit\n", SKYPIAX_P_LOG);
return -1;
}
@@ -898,7 +898,7 @@
/* PLATFORM SPECIFIC */
/***************************/
#if defined(WIN32) && !defined(__CYGWIN__)
-int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany)
+int celliax_pipe_read(switch_file_t * pipe, short *buf, int howmany)
{
switch_size_t quantity;
@@ -911,7 +911,7 @@
return howmany;
}
-int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany)
+int celliax_pipe_write(switch_file_t * pipe, short *buf, int howmany)
{
switch_size_t quantity;
@@ -924,7 +924,7 @@
return howmany;
}
-int skypiax_close_socket(unsigned int fd)
+int celliax_close_socket(unsigned int fd)
{
int res;
@@ -933,27 +933,27 @@
return res;
}
-int skypiax_audio_init(private_t * tech_pvt)
+int celliax_audio_init(private_t * tech_pvt)
{
switch_status_t rv;
- rv = switch_file_pipe_create(&tech_pvt->audiopipe[0], &tech_pvt->audiopipe[1], skypiax_module_pool);
- rv = switch_file_pipe_create(&tech_pvt->audioskypepipe[0], &tech_pvt->audioskypepipe[1], skypiax_module_pool);
+ rv = switch_file_pipe_create(&tech_pvt->audiopipe[0], &tech_pvt->audiopipe[1], celliax_module_pool);
+ rv = switch_file_pipe_create(&tech_pvt->audioskypepipe[0], &tech_pvt->audioskypepipe[1], celliax_module_pool);
return 0;
}
#else /* WIN32 */
-int skypiax_pipe_read(int pipe, short *buf, int howmany)
+int celliax_pipe_read(int pipe, short *buf, int howmany)
{
howmany = read(pipe, buf, howmany);
return howmany;
}
-int skypiax_pipe_write(int pipe, short *buf, int howmany)
+int celliax_pipe_write(int pipe, short *buf, int howmany)
{
howmany = write(pipe, buf, howmany);
return howmany;
}
-int skypiax_close_socket(unsigned int fd)
+int celliax_close_socket(unsigned int fd)
{
int res;
@@ -962,7 +962,7 @@
return res;
}
-int skypiax_audio_init(private_t * tech_pvt)
+int celliax_audio_init(private_t * tech_pvt)
{
if (pipe(tech_pvt->audiopipe)) {
fcntl(tech_pvt->audiopipe[0], F_SETFL, O_NONBLOCK);
@@ -974,7 +974,7 @@
}
/* this pipe is the audio fd for asterisk to poll on during a call. FS do not use it */
- tech_pvt->skypiax_sound_capt_fd = tech_pvt->audiopipe[0];
+ tech_pvt->celliax_sound_capt_fd = tech_pvt->audiopipe[0];
return 0;
}
@@ -1025,7 +1025,7 @@
return res;
}
-int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype)
+int celliax_signaling_write(private_t * tech_pvt, char *msg_to_skype)
{
static char acInputRow[1024];
COPYDATASTRUCT oCopyData;
@@ -1051,7 +1051,7 @@
}
-LRESULT APIENTRY skypiax_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam)
+LRESULT APIENTRY celliax_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam)
{
LRESULT lReturnCode;
int fIssueDefProc;
@@ -1081,10 +1081,10 @@
PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam;
memset(msg_from_skype, '\0', sizeof(msg_from_skype));
- skypiax_strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) - 2);
+ celliax_strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) - 2);
howmany = strlen(msg_from_skype) + 1;
- howmany = skypiax_pipe_write(tech_pvt->SkypiaxHandles.fdesc[1], (short *) msg_from_skype, howmany);
+ howmany = celliax_pipe_write(tech_pvt->SkypiaxHandles.fdesc[1], (short *) msg_from_skype, howmany);
//DEBUGA_SKYPE("From Skype API: %s\n", SKYPIAX_P_LOG, msg_from_skype);
lReturnCode = 1;
}
@@ -1103,7 +1103,7 @@
break;
case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION:
//DEBUGA_SKYPE ("\n\n\tIf I do not (almost) immediately connect to Skype API,\n\tplease give the Skype client authorization to be connected \n\tby Asterisk and to not ask you again.\n\n", SKYPIAX_P_LOG);
- skypiax_sleep(5000);
+ celliax_sleep(5000);
#if 0
if (!tech_pvt->SkypiaxHandles.currentuserhandle) {
SendMessage(HWND_BROADCAST,
@@ -1120,7 +1120,7 @@
break;
case SKYPECONTROLAPI_ATTACH_API_AVAILABLE:
DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG);
- skypiax_sleep(5000);
+ celliax_sleep(5000);
#if 0
if (!tech_pvt->SkypiaxHandles.currentuserhandle) {
SendMessage(HWND_BROADCAST,
@@ -1162,7 +1162,7 @@
strcat(tech_pvt->SkypiaxHandles.win32_acInit_WindowClassName, (char *) paucUUIDString);
oWindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS;
- oWindowClass.lpfnWndProc = (WNDPROC) & skypiax_present;
+ oWindowClass.lpfnWndProc = (WNDPROC) & celliax_present;
oWindowClass.cbClsExtra = 0;
oWindowClass.cbWndExtra = 0;
oWindowClass.hInstance = tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle;
@@ -1207,14 +1207,14 @@
DestroyWindow(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle), tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle = NULL;
}
-void *skypiax_do_skypeapi_thread_func(void *obj)
+void *celliax_do_skypeapi_thread_func(void *obj)
{
private_t *tech_pvt = obj;
#if defined(WIN32) && !defined(__CYGWIN__)
switch_status_t rv;
- switch_file_pipe_create(&tech_pvt->SkypiaxHandles.fdesc[0], &tech_pvt->SkypiaxHandles.fdesc[1], skypiax_module_pool);
- rv = switch_file_pipe_create(&tech_pvt->SkypiaxHandles.fdesc[0], &tech_pvt->SkypiaxHandles.fdesc[1], skypiax_module_pool);
+ switch_file_pipe_create(&tech_pvt->SkypiaxHandles.fdesc[0], &tech_pvt->SkypiaxHandles.fdesc[1], celliax_module_pool);
+ rv = switch_file_pipe_create(&tech_pvt->SkypiaxHandles.fdesc[0], &tech_pvt->SkypiaxHandles.fdesc[1], celliax_module_pool);
#else /* WIN32 */
if (pipe(tech_pvt->SkypiaxHandles.fdesc)) {
fcntl(tech_pvt->SkypiaxHandles.fdesc[0], F_SETFL, O_NONBLOCK);
@@ -1225,7 +1225,7 @@
tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach = RegisterWindowMessage("SkypeControlAPIAttach");
tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover = RegisterWindowMessage("SkypeControlAPIDiscover");
- skypiax_sleep(200000); //0,2 sec
+ celliax_sleep(200000); //0,2 sec
if (tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0
&& tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) {
@@ -1262,7 +1262,7 @@
private_t *tech_pvt = NULL;
xerror = err->error_code;
- ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror); ///FIXME why crash the entire skypiax? just crash the interface, instead
+ ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror); ///FIXME why crash the entire celliax? just crash the interface, instead
running = 0;
return 0; /* ignore the error */
}
@@ -1279,7 +1279,7 @@
return (xerror != BadValue) && (xerror != BadWindow);
}
-int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *message_P)
+int celliax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *message_P)
{
Window w_P;
@@ -1327,7 +1327,7 @@
return 1;
}
-int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype)
+int celliax_signaling_write(private_t * tech_pvt, char *msg_to_skype)
{
struct SkypiaxHandles *SkypiaxHandles;
@@ -1335,7 +1335,7 @@
SkypiaxHandles = &tech_pvt->SkypiaxHandles;
- if (!skypiax_send_message(SkypiaxHandles, msg_to_skype)) {
+ if (!celliax_send_message(SkypiaxHandles, msg_to_skype)) {
ERRORA
("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax, then restart Skype, then launch Skypiax and try again.\n",
SKYPIAX_P_LOG);
@@ -1346,7 +1346,7 @@
}
-int skypiax_present(struct SkypiaxHandles *SkypiaxHandles)
+int celliax_present(struct SkypiaxHandles *SkypiaxHandles)
{
Atom skype_inst = XInternAtom(SkypiaxHandles->disp, "_SKYPE_INSTANCE", True);
@@ -1381,7 +1381,7 @@
return 1;
}
-void skypiax_clean_disp(void *data)
+void celliax_clean_disp(void *data)
{
int *dispptr;
@@ -1399,10 +1399,10 @@
DEBUGA_SKYPE("NOT destroyed disp\n", SKYPIAX_P_LOG);
}
DEBUGA_SKYPE("OUT destroyed disp\n", SKYPIAX_P_LOG);
- skypiax_sleep(1000);
+ celliax_sleep(1000);
}
-void *skypiax_do_skypeapi_thread_func(void *obj)
+void *celliax_do_skypeapi_thread_func(void *obj)
{
private_t *tech_pvt = obj;
@@ -1441,22 +1441,22 @@
SkypiaxHandles->disp = disp;
- if (skypiax_present(SkypiaxHandles)) {
+ if (celliax_present(SkypiaxHandles)) {
root = DefaultRootWindow(disp);
win = XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, BlackPixel(disp, DefaultScreen(disp)), BlackPixel(disp, DefaultScreen(disp)));
SkypiaxHandles->win = win;
- snprintf(buf, 512, "NAME skypiax");
+ snprintf(buf, 512, "NAME celliax");
- if (!skypiax_send_message(SkypiaxHandles, buf)) {
+ if (!celliax_send_message(SkypiaxHandles, buf)) {
ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG);
running = 0;
return NULL;
}
snprintf(buf, 512, "PROTOCOL 7");
- if (!skypiax_send_message(SkypiaxHandles, buf)) {
+ if (!celliax_send_message(SkypiaxHandles, buf)) {
ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG);
running = 0;
return NULL;
@@ -1511,7 +1511,7 @@
WARNINGA
("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||. Let's introduce a 1 second delay.\n",
SKYPIAX_P_LOG, buf);
- skypiax_sleep(1000000); //1 sec
+ celliax_sleep(1000000); //1 sec
}
break;
}
Modified: freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c (14546 => 14547)
--- freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c 2009-08-17 09:48:26 UTC (rev 14546)
+++ freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c 2009-08-17 10:05:07 UTC (rev 14547)
@@ -21,7 +21,7 @@
* Portions created by the Initial Developer are Copyright (C)
* the Initial Developer. All Rights Reserved.
*
- * This module (mod_skypiax) has been contributed by:
+ * This module (mod_celliax) has been contributed by:
*
* Giovanni Maruzzelli (gmaruzz@gmail.com)
*
@@ -30,11 +30,11 @@
*
*
*
- * mod_skypiax.c -- Skype compatible Endpoint Module
+ * mod_celliax.c -- Skype compatible Endpoint Module
*
*/
-#include "skypiax.h"
+#include "celliax.h"
#ifdef WIN32
/***************/
@@ -81,14 +81,14 @@
/***************/
#endif /* WIN32 */
-SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load);
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown);
-SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL);
+SWITCH_MODULE_LOAD_FUNCTION(mod_celliax_load);
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_celliax_shutdown);
+SWITCH_MODULE_DEFINITION(mod_celliax, mod_celliax_load, mod_celliax_shutdown, NULL);
SWITCH_STANDARD_API(sk_function);
/* BEGIN: Changes here */
#define SK_SYNTAX "list [full] || console || skype_API_msg || remove < skypeusername | #interface_name | #interface_id > || reload"
/* END: Changes heres */
-SWITCH_STANDARD_API(skypiax_function);
+SWITCH_STANDARD_API(celliax_function);
#define SKYPIAX_SYNTAX "interface_name skype_API_msg"
/* BEGIN: Changes here */
@@ -96,7 +96,7 @@
#define SOFT_RELOAD 1
/* END: Changes heres */
-char *interface_status[] = { /* should match SKYPIAX_STATE_xxx in skypiax.h */
+char *interface_status[] = { /* should match SKYPIAX_STATE_xxx in celliax.h */
"IDLE",
"DOWN",
"RING",
@@ -110,7 +110,7 @@
"HANG_RQ",
"PREANSW"
};
-char *skype_callflow[] = { /* should match CALLFLOW_XXX in skypiax.h */
+char *skype_callflow[] = { /* should match CALLFLOW_XXX in celliax.h */
"CALL_IDLE",
"CALL_DOWN",
"INCOMING_RNG",
@@ -165,8 +165,8 @@
private_t *sk_console;
} globals;
-switch_endpoint_interface_t *skypiax_endpoint_interface;
-switch_memory_pool_t *skypiax_module_pool = NULL;
+switch_endpoint_interface_t *celliax_endpoint_interface;
+switch_memory_pool_t *celliax_module_pool = NULL;
int running = 0;
SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_dialplan, globals.dialplan);
@@ -194,9 +194,9 @@
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 celliax_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)
+static switch_status_t celliax_codec(private_t * tech_pvt, int sample_rate, int codec_ms)
{
switch_core_session_t *session = NULL;
@@ -233,7 +233,7 @@
}
-switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *session)
+switch_status_t celliax_tech_init(private_t * tech_pvt, switch_core_session_t *session)
{
switch_assert(tech_pvt != NULL);
@@ -248,11 +248,11 @@
ERRORA("no tech_pvt->session_uuid_str\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
- if (skypiax_codec(tech_pvt, SAMPLERATE_SKYPIAX, 20) != SWITCH_STATUS_SUCCESS) {
- ERRORA("skypiax_codec FAILED\n", SKYPIAX_P_LOG);
+ if (celliax_codec(tech_pvt, SAMPLERATE_SKYPIAX, 20) != SWITCH_STATUS_SUCCESS) {
+ ERRORA("celliax_codec FAILED\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
- DEBUGA_SKYPE("skypiax_codec SUCCESS\n", SKYPIAX_P_LOG);
+ DEBUGA_SKYPE("celliax_codec SUCCESS\n", SKYPIAX_P_LOG);
return SWITCH_STATUS_SUCCESS;
}
@@ -344,7 +344,7 @@
globals.SKYPIAX_INTERFACES[interface_id].running = 0;
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
#ifdef WIN32
switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
#else /* WIN32 */
@@ -352,11 +352,11 @@
#endif /* WIN32 */
}
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
#ifdef WIN32
- if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypiax_api_thread_func die
+ if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the celliax_api_thread_func die
DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", SKYPIAX_P_LOG, GetLastError());
- globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread = NULL;
+ globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread = NULL;
}
#else
XEvent e;
@@ -378,12 +378,12 @@
switch_yield(50000);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread);
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
+ switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
+ switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread);
}
switch_mutex_lock(globals.mutex);
@@ -497,7 +497,7 @@
//switch_thread_cond_signal(tech_pvt->cond);
DEBUGA_SKYPE("hanging up skype call: %s\n", SKYPIAX_P_LOG, tech_pvt->skype_call_id);
sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
//memset(tech_pvt->session_uuid_str, '\0', sizeof(tech_pvt->session_uuid_str));
//*tech_pvt->session_uuid_str = '\0';
@@ -619,7 +619,7 @@
DEBUGA_SKYPE("%s CHANNEL SEND_DTMF\n", SKYPIAX_P_LOG, tech_pvt->name);
DEBUGA_SKYPE("DTMF: %c\n", SKYPIAX_P_LOG, dtmf->digit);
- skypiax_senddigit(tech_pvt, dtmf->digit);
+ celliax_senddigit(tech_pvt, dtmf->digit);
return SWITCH_STATUS_SUCCESS;
}
@@ -645,9 +645,9 @@
tech_pvt->read_frame.flags = SFF_NONE;
*frame = NULL;
- if (!skypiax_audio_read(tech_pvt)) {
+ if (!celliax_audio_read(tech_pvt)) {
- ERRORA("skypiax_audio_read ERROR\n", SKYPIAX_P_LOG);
+ ERRORA("celliax_audio_read ERROR\n", SKYPIAX_P_LOG);
} else {
switch_set_flag(tech_pvt, TFLAG_VOICE);
@@ -794,7 +794,7 @@
return SWITCH_STATUS_SUCCESS;
}
-switch_state_handler_table_t skypiax_state_handlers = {
+switch_state_handler_table_t celliax_state_handlers = {
/*.on_init */ channel_on_init,
/*.on_routing */ channel_on_routing,
/*.on_execute */ channel_on_execute,
@@ -809,7 +809,7 @@
/*.on_destroy */ channel_on_destroy
};
-switch_io_routines_t skypiax_io_routines = {
+switch_io_routines_t celliax_io_routines = {
/*.outgoing_channel */ channel_outgoing_channel,
/*.read_frame */ channel_read_frame,
/*.write_frame */ channel_write_frame,
@@ -825,7 +825,7 @@
switch_core_session_t **new_session, switch_memory_pool_t **pool, switch_originate_flag_t flags)
{
private_t *tech_pvt = NULL;
- if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
+ if ((*new_session = switch_core_session_request(celliax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) {
switch_channel_t *channel = NULL;
switch_caller_profile_t *caller_profile;
char *rdest;
@@ -848,13 +848,13 @@
if (strncmp("ANY", interface_name, strlen(interface_name)) == 0 || strncmp("RR", interface_name, strlen(interface_name)) == 0) {
/* we've been asked for the "ANY" interface, let's find the first idle interface */
//DEBUGA_SKYPE("Finding one available skype interface\n", SKYPIAX_P_LOG);
- //tech_pvt = find_available_skypiax_interface(NULL);
+ //tech_pvt = find_available_celliax_interface(NULL);
//if (tech_pvt)
//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);
+ tech_pvt = find_available_celliax_interface_rr(NULL);
if (tech_pvt)
found = 1;
}
@@ -903,7 +903,7 @@
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
- if (skypiax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) {
+ if (celliax_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);
@@ -914,8 +914,8 @@
if (outbound_profile) {
char name[128];
- snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number);
- //snprintf(name, sizeof(name), "skypiax/%s", tech_pvt->name);
+ snprintf(name, sizeof(name), "celliax/%s", outbound_profile->destination_number);
+ //snprintf(name, sizeof(name), "celliax/%s", tech_pvt->name);
switch_channel_set_name(channel, name);
caller_profile = switch_caller_profile_clone(*new_session, outbound_profile);
switch_channel_set_caller_profile(channel, caller_profile);
@@ -932,7 +932,7 @@
rdest = strchr(caller_profile->destination_number, '/');
*rdest++ = '\0';
- //skypiax_call(tech_pvt, rdest, 30);
+ //celliax_call(tech_pvt, rdest, 30);
switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(*new_session), sizeof(tech_pvt->session_uuid_str));
caller_profile = tech_pvt->caller_profile;
@@ -941,7 +941,7 @@
switch_channel_set_flag(channel, CF_OUTBOUND);
switch_set_flag(tech_pvt, TFLAG_OUTBOUND);
switch_channel_set_state(channel, CS_INIT);
- skypiax_call(tech_pvt, rdest, 30);
+ celliax_call(tech_pvt, rdest, 30);
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_SUCCESS;
}
@@ -951,10 +951,10 @@
}
/*!
- * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the skypiax_signaling_read function
+ * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the celliax_signaling_read function
*
*/
-static void *SWITCH_THREAD_FUNC skypiax_signaling_thread_func(switch_thread_t * thread, void *obj)
+static void *SWITCH_THREAD_FUNC celliax_signaling_thread_func(switch_thread_t * thread, void *obj)
{
private_t *tech_pvt = obj;
int res;
@@ -963,12 +963,12 @@
if (!tech_pvt)
return NULL;
- DEBUGA_SKYPE("In skypiax_signaling_thread_func: started, p=%p\n", SKYPIAX_P_LOG, (void *) tech_pvt);
+ DEBUGA_SKYPE("In celliax_signaling_thread_func: started, p=%p\n", SKYPIAX_P_LOG, (void *) tech_pvt);
while (forever) {
if (!(running && tech_pvt->running))
break;
- res = skypiax_signaling_read(tech_pvt);
+ res = celliax_signaling_read(tech_pvt);
if (res == CALLFLOW_INCOMING_HANGUP) {
switch_core_session_t *session = NULL;
switch_channel_t *channel = NULL;
@@ -1019,11 +1019,11 @@
static switch_status_t load_config(int reload_type)
/* END: Changes heres */
{
- char *cf = "skypiax.conf";
+ char *cf = "celliax.conf";
switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface;
private_t *tech_pvt = NULL;
- switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, skypiax_module_pool);
+ switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, celliax_module_pool);
if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) {
ERRORA("open of %s failed\n", SKYPIAX_P_LOG, cf);
running = 0;
@@ -1208,8 +1208,8 @@
if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) {
private_t newconf;
- switch_threadattr_t *skypiax_api_thread_attr = NULL;
- switch_threadattr_t *skypiax_signaling_thread_attr = NULL;
+ switch_threadattr_t *celliax_api_thread_attr = NULL;
+ switch_threadattr_t *celliax_signaling_thread_attr = NULL;
memset(&newconf, '\0', sizeof(newconf));
globals.SKYPIAX_INTERFACES[interface_id] = newconf;
@@ -1267,22 +1267,22 @@
SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
- switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool);
- switch_threadattr_stacksize_set(skypiax_api_thread_attr, SWITCH_THREAD_STACKSIZE);
- switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread,
- skypiax_api_thread_attr, skypiax_do_skypeapi_thread, &globals.SKYPIAX_INTERFACES[interface_id], skypiax_module_pool);
+ switch_threadattr_create(&celliax_api_thread_attr, celliax_module_pool);
+ switch_threadattr_stacksize_set(celliax_api_thread_attr, SWITCH_THREAD_STACKSIZE);
+ switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread,
+ celliax_api_thread_attr, celliax_do_skypeapi_thread, &globals.SKYPIAX_INTERFACES[interface_id], celliax_module_pool);
switch_sleep(100000);
- switch_threadattr_create(&skypiax_signaling_thread_attr, skypiax_module_pool);
- switch_threadattr_stacksize_set(skypiax_signaling_thread_attr, SWITCH_THREAD_STACKSIZE);
+ switch_threadattr_create(&celliax_signaling_thread_attr, celliax_module_pool);
+ switch_threadattr_stacksize_set(celliax_signaling_thread_attr, SWITCH_THREAD_STACKSIZE);
switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].
- skypiax_signaling_thread, skypiax_signaling_thread_attr,
- skypiax_signaling_thread_func, &globals.SKYPIAX_INTERFACES[interface_id], skypiax_module_pool);
+ celliax_signaling_thread, celliax_signaling_thread_attr,
+ celliax_signaling_thread_func, &globals.SKYPIAX_INTERFACES[interface_id], celliax_module_pool);
switch_sleep(100000);
- skypiax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]);
+ celliax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]);
NOTICA
("WAITING roughly 10 seconds to find a running Skype client and connect to its SKYPE API for interface_id=%d\n",
@@ -1316,7 +1316,7 @@
("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);
- skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET AUTOAWAY OFF");
+ celliax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET AUTOAWAY OFF");
} 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",
@@ -1359,11 +1359,11 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load)
+SWITCH_MODULE_LOAD_FUNCTION(mod_celliax_load)
{
switch_api_interface_t *commands_api_interface;
- skypiax_module_pool = pool;
+ celliax_module_pool = pool;
memset(&globals, '\0', sizeof(globals));
running = 1;
@@ -1374,15 +1374,15 @@
}
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
- skypiax_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
- skypiax_endpoint_interface->interface_name = "skypiax";
- skypiax_endpoint_interface->io_routines = &skypiax_io_routines;
- skypiax_endpoint_interface->state_handler = &skypiax_state_handlers;
+ celliax_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE);
+ celliax_endpoint_interface->interface_name = "celliax";
+ celliax_endpoint_interface->io_routines = &celliax_io_routines;
+ celliax_endpoint_interface->state_handler = &celliax_state_handlers;
if (running) {
SWITCH_ADD_API(commands_api_interface, "sk", "Skypiax console commands", sk_function, SK_SYNTAX);
- SWITCH_ADD_API(commands_api_interface, "skypiax", "Skypiax interface commands", skypiax_function, SKYPIAX_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "celliax", "Skypiax interface commands", celliax_function, SKYPIAX_SYNTAX);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -1390,7 +1390,7 @@
return SWITCH_STATUS_FALSE;
}
-SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown)
+SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_celliax_shutdown)
{
int x;
private_t *tech_pvt = NULL;
@@ -1404,7 +1404,7 @@
tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) {
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
#ifdef WIN32
switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
#else /* WIN32 */
@@ -1412,11 +1412,11 @@
#endif /* WIN32 */
}
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
#ifdef WIN32
- if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypiax_api_thread_func die
+ if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the celliax_api_thread_func die
DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", SKYPIAX_P_LOG, GetLastError());
- globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread = NULL;
+ globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread = NULL;
}
#else
XEvent e;
@@ -1438,11 +1438,11 @@
x--;
switch_yield(50000);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread);
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
+ switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread);
+ if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
+ switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread);
}
#ifndef WIN32
WARNINGA("SHUTDOWN interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
@@ -1471,19 +1471,19 @@
return SWITCH_STATUS_SUCCESS;
}
-void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj)
+void *SWITCH_THREAD_FUNC celliax_do_tcp_srv_thread(switch_thread_t * thread, void *obj)
{
- return skypiax_do_tcp_srv_thread_func(obj);
+ return celliax_do_tcp_srv_thread_func(obj);
}
-void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, void *obj)
+void *SWITCH_THREAD_FUNC celliax_do_tcp_cli_thread(switch_thread_t * thread, void *obj)
{
- return skypiax_do_tcp_cli_thread_func(obj);
+ return celliax_do_tcp_cli_thread_func(obj);
}
-void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj)
+void *SWITCH_THREAD_FUNC celliax_do_skypeapi_thread(switch_thread_t * thread, void *obj)
{
- return skypiax_do_skypeapi_thread_func(obj);
+ return celliax_do_skypeapi_thread_func(obj);
}
int dtmf_received(private_t * tech_pvt, char *value)
@@ -1521,20 +1521,20 @@
{
switch_threadattr_t *thd_attr = NULL;
- switch_threadattr_create(&thd_attr, skypiax_module_pool);
+ switch_threadattr_create(&thd_attr, celliax_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_srv_thread, thd_attr, skypiax_do_tcp_srv_thread, tech_pvt, skypiax_module_pool) == SWITCH_STATUS_SUCCESS) {
+ if (switch_thread_create(&tech_pvt->tcp_srv_thread, thd_attr, celliax_do_tcp_srv_thread, tech_pvt, celliax_module_pool) == SWITCH_STATUS_SUCCESS) {
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;
}
- switch_threadattr_create(&thd_attr, skypiax_module_pool);
+ switch_threadattr_create(&thd_attr, celliax_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) {
+ if (switch_thread_create(&tech_pvt->tcp_cli_thread, thd_attr, celliax_do_tcp_cli_thread, tech_pvt, celliax_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);
@@ -1555,7 +1555,7 @@
switch_core_session_t *session = 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(celliax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) {
DEBUGA_SKYPE("2 SESSION_REQUEST %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(session));
switch_core_session_add_stream(session, NULL);
channel = switch_core_session_get_channel(session);
@@ -1564,19 +1564,19 @@
switch_core_session_destroy(&session);
return 0;
}
- if (skypiax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) {
+ if (celliax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) {
ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
switch_core_session_destroy(&session);
return 0;
}
if ((tech_pvt->caller_profile =
- switch_caller_profile_new(switch_core_session_get_pool(session), "skypiax",
+ switch_caller_profile_new(switch_core_session_get_pool(session), "celliax",
tech_pvt->dialplan, tech_pvt->callid_name,
- tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_skypiax", tech_pvt->context, tech_pvt->destination)) != 0) {
+ tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_celliax", tech_pvt->context, tech_pvt->destination)) != 0) {
char name[128];
- //switch_snprintf(name, sizeof(name), "skypiax/%s/%s", tech_pvt->name, tech_pvt->caller_profile->destination_number);
- switch_snprintf(name, sizeof(name), "skypiax/%s", tech_pvt->name);
+ //switch_snprintf(name, sizeof(name), "celliax/%s/%s", tech_pvt->name, tech_pvt->caller_profile->destination_number);
+ switch_snprintf(name, sizeof(name), "celliax/%s", tech_pvt->name);
switch_channel_set_name(channel, name);
switch_channel_set_caller_profile(channel, tech_pvt->caller_profile);
}
@@ -1692,7 +1692,7 @@
return 0;
}
-private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling)
+private_t *find_available_celliax_interface_rr(private_t * tech_pvt_calling)
{
private_t *tech_pvt = NULL;
int i;
@@ -1840,7 +1840,7 @@
} else {
if (globals.sk_console)
- skypiax_signaling_write(globals.sk_console, (char *) cmd);
+ celliax_signaling_write(globals.sk_console, (char *) cmd);
else
stream->write_function(stream, "sk console is NOT yet assigned\n");
}
@@ -1850,7 +1850,7 @@
return SWITCH_STATUS_SUCCESS;
}
-SWITCH_STANDARD_API(skypiax_function)
+SWITCH_STANDARD_API(celliax_function)
{
char *mycmd = NULL, *argv[10] = { 0 };
int argc = 0;
@@ -1891,7 +1891,7 @@
return SWITCH_STATUS_SUCCESS;
} else {
- skypiax_signaling_write(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]);
+ celliax_signaling_write(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]);
}
} else {
stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX);
@@ -1902,7 +1902,7 @@
return SWITCH_STATUS_SUCCESS;
}
-int skypiax_answer(private_t * tech_pvt, char *id, char *value)
+int celliax_answer(private_t * tech_pvt, char *id, char *value)
{
char msg_to_skype[1024];
int i;
@@ -1940,7 +1940,7 @@
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);
+ //celliax_signaling_write(tech_pvt, msg_to_skype);
switch_mutex_unlock(globals.mutex);
return 0;
}
@@ -1952,11 +1952,11 @@
tech_pvt->ib_calls++;
sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
switch_sleep(10000);
tech_pvt->interface_state = SKYPIAX_STATE_PREANSWER;
sprintf(msg_to_skype, "ALTER CALL %s ANSWER", id);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
DEBUGA_SKYPE("We answered a Skype RING on skype_call %s\n", SKYPIAX_P_LOG, id);
//FIXME write a timestamp here
gettimeofday(&tech_pvt->answer_time, NULL);
@@ -1972,13 +1972,13 @@
} 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);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
switch_mutex_unlock(globals.mutex);
return 0;
}
-int skypiax_transfer(private_t * tech_pvt, char *id, char *value)
+int celliax_transfer(private_t * tech_pvt, char *id, char *value)
{
char msg_to_skype[1024];
int i;
@@ -2009,7 +2009,7 @@
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);
+ //celliax_signaling_write(tech_pvt, msg_to_skype);
switch_mutex_unlock(globals.mutex);
return 0;
}
@@ -2029,7 +2029,7 @@
<- CALL 288 CAN_TRANSFER test2 TRUE
**********************************/
- private_t *available_skypiax_interface = NULL;
+ private_t *available_celliax_interface = NULL;
gettimeofday(&timenow, NULL);
for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
@@ -2052,15 +2052,15 @@
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);
+ //celliax_signaling_write(tech_pvt, msg_to_skype);
switch_mutex_unlock(globals.mutex);
return 0;
}
DEBUGA_SKYPE("NOT FOUND\n", SKYPIAX_P_LOG);
- available_skypiax_interface = find_available_skypiax_interface_rr(tech_pvt);
- if (available_skypiax_interface) {
- /* there is a skypiax interface idle, let's transfer the call to it */
+ available_celliax_interface = find_available_celliax_interface_rr(tech_pvt);
+ if (available_celliax_interface) {
+ /* there is a celliax interface idle, let's transfer the call to it */
//FIXME write a timestamp here
gettimeofday(&tech_pvt->transfer_time, NULL);
@@ -2069,28 +2069,28 @@
switch_copy_string(tech_pvt->transfer_callid_number, value, sizeof(tech_pvt->transfer_callid_number) - 1);
DEBUGA_SKYPE
- ("Let's transfer the skype_call %s to %s interface (with skype_user: %s), because we are already in a skypiax call(%s)\n",
- SKYPIAX_P_LOG, tech_pvt->skype_call_id, available_skypiax_interface->name, available_skypiax_interface->skype_user, id);
+ ("Let's transfer the skype_call %s to %s interface (with skype_user: %s), because we are already in a celliax call(%s)\n",
+ SKYPIAX_P_LOG, tech_pvt->skype_call_id, available_celliax_interface->name, available_celliax_interface->skype_user, id);
//FIXME why this? the inbound call will come, eventually, on that other interface
- //available_skypiax_interface->ib_calls++;
+ //available_celliax_interface->ib_calls++;
- sprintf(msg_to_skype, "ALTER CALL %s TRANSFER %s", id, available_skypiax_interface->skype_user);
- skypiax_signaling_write(tech_pvt, msg_to_skype);
+ sprintf(msg_to_skype, "ALTER CALL %s TRANSFER %s", id, available_celliax_interface->skype_user);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
if (tech_pvt->interface_state == SKYPIAX_STATE_SELECTED) {
tech_pvt->interface_state = SKYPIAX_STATE_IDLE; //we marked it SKYPIAX_STATE_SELECTED just in case it has to make an outbound call
}
} else {
- /* no skypiax interfaces idle, do nothing */
+ /* no celliax interfaces idle, do nothing */
DEBUGA_SKYPE
- ("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",
+ ("Not answering the skype_call %s, because we are already in a celliax call(%s) and not transferring, because no other celliax 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);
+ celliax_signaling_write(tech_pvt, msg_to_skype);
}
switch_sleep(10000);
DEBUGA_SKYPE
- ("We have NOT answered a Skype RING from skype_call %s, because we are already in a skypiax call (%s)\n",
+ ("We have NOT answered a Skype RING from skype_call %s, because we are already in a celliax call (%s)\n",
SKYPIAX_P_LOG, id, tech_pvt->skype_call_id);
switch_mutex_unlock(globals.mutex);