Modified: freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c (14721 => 14722)
--- freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c 2009-09-01 19:49:14 UTC (rev 14721)
+++ freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c 2009-09-01 20:14:09 UTC (rev 14722)
@@ -12,7 +12,7 @@
extern switch_memory_pool_t *celliax_module_pool;
extern switch_endpoint_interface_t *celliax_endpoint_interface;
#endif /* ASTERISK */
-//int samplerate_celliax = SAMPLERATE_SKYPIAX;
+//int samplerate_celliax = SAMPLERATE_CELLIAX;
extern int running;
int celliax_dir_entry_extension = 1;
@@ -40,14 +40,14 @@
#endif /* __CYGWIN__ */
fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK);
if (fd == -1) {
- DEBUGA_SKYPE("serial error: %s\n", SKYPIAX_P_LOG, strerror(errno));
+ DEBUGA_CELLIAX("serial error: %s\n", CELLIAX_P_LOG, strerror(errno));
tech_pvt->controldevfd = fd;
return -1;
}
/* flush it */
rt = tcflush(fd, TCIFLUSH);
if (rt == -1) {
- ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno));
}
/* attributes */
tp.c_cflag = B0 | CS8 | CLOCAL | CREAD | HUPCL;
@@ -60,19 +60,19 @@
/* set controldevice_speed */
rt = cfsetispeed(&tp, tech_pvt->controldevice_speed);
if (rt == -1) {
- ERRORA("serial error: %s, speed was: %d", SKYPIAX_P_LOG, strerror(errno), tech_pvt->controldevice_speed);
+ ERRORA("serial error: %s, speed was: %d", CELLIAX_P_LOG, strerror(errno), tech_pvt->controldevice_speed);
}
rt = cfsetospeed(&tp, tech_pvt->controldevice_speed);
if (rt == -1) {
- ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno));
}
/* set port attributes */
if (tcsetattr(fd, TCSADRAIN, &tp) == -1) {
- ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno));
}
rt = tcsetattr(fd, TCSANOW, &tp);
if (rt == -1) {
- ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno));
}
unsigned int status = 0;
#ifndef __CYGWIN__
@@ -93,10 +93,10 @@
ioctl(fd, TIOCMSET, &status);
#endif /* __CYGWIN__ */
tech_pvt->controldevfd = fd;
- DEBUGA_SKYPE("Syncing Serial\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("Syncing Serial\n", CELLIAX_P_LOG);
rt = celliax_serial_sync(tech_pvt);
if (rt == -1) {
- ERRORA("Serial init error\n", SKYPIAX_P_LOG);
+ ERRORA("Serial init error\n", CELLIAX_P_LOG);
return -1;
}
return (fd);
@@ -155,7 +155,7 @@
/* initial_pause? */
if (tech_pvt->at_initial_pause) {
- DEBUGA_SKYPE("sleeping for %d usec\n", SKYPIAX_P_LOG, tech_pvt->at_initial_pause);
+ DEBUGA_CELLIAX("sleeping for %d usec\n", CELLIAX_P_LOG, tech_pvt->at_initial_pause);
usleep(tech_pvt->at_initial_pause);
}
@@ -165,7 +165,7 @@
if (strlen(tech_pvt->at_preinit_1)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_preinit_1, tech_pvt->at_preinit_1_expect);
}
} else {
break;
@@ -174,7 +174,7 @@
if (strlen(tech_pvt->at_preinit_2)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_preinit_2, tech_pvt->at_preinit_2_expect);
}
} else {
break;
@@ -183,7 +183,7 @@
if (strlen(tech_pvt->at_preinit_3)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_preinit_3, tech_pvt->at_preinit_3_expect);
}
} else {
break;
@@ -192,7 +192,7 @@
if (strlen(tech_pvt->at_preinit_4)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_preinit_4, tech_pvt->at_preinit_4_expect);
}
} else {
break;
@@ -201,7 +201,7 @@
if (strlen(tech_pvt->at_preinit_5)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_preinit_5, tech_pvt->at_preinit_5_expect);
}
} else {
break;
@@ -212,20 +212,20 @@
/* after_preinit_pause? */
if (tech_pvt->at_after_preinit_pause) {
- DEBUGA_SKYPE("sleeping for %d usec\n", SKYPIAX_P_LOG, tech_pvt->at_after_preinit_pause);
+ DEBUGA_CELLIAX("sleeping for %d usec\n", CELLIAX_P_LOG, tech_pvt->at_after_preinit_pause);
usleep(tech_pvt->at_after_preinit_pause);
}
/* phone, brother, art you alive? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT");
if (res) {
- ERRORA("no response to AT\n", SKYPIAX_P_LOG);
+ ERRORA("no response to AT\n", CELLIAX_P_LOG);
return -1;
}
/* for motorola, bring it back to "normal" mode if it happens to be in another mode */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+mode=0");
if (res) {
- DEBUGA_SKYPE("AT+mode=0 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+mode=0 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", CELLIAX_P_LOG);
}
usleep(50000);
/* for motorola end */
@@ -233,19 +233,19 @@
/* reset AT configuration to phone default */
res = celliax_serial_write_AT_ack(tech_pvt, "ATZ");
if (res) {
- DEBUGA_SKYPE("ATZ failed\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ATZ failed\n", CELLIAX_P_LOG);
}
/* disable AT command echo */
res = celliax_serial_write_AT_ack(tech_pvt, "ATE0");
if (res) {
- DEBUGA_SKYPE("ATE0 failed\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ATE0 failed\n", CELLIAX_P_LOG);
}
/* disable extended error reporting */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CMEE=0");
if (res) {
- DEBUGA_SKYPE("AT+CMEE failed\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CMEE failed\n", CELLIAX_P_LOG);
}
/* various phone manufacturer identifier */
@@ -256,108 +256,108 @@
sprintf(at_command, "ATI%d", i);
res = celliax_serial_write_AT_ack(tech_pvt, at_command);
if (res) {
- DEBUGA_SKYPE("ATI%d command failed, continue\n", SKYPIAX_P_LOG, i);
+ DEBUGA_CELLIAX("ATI%d command failed, continue\n", CELLIAX_P_LOG, i);
}
}
/* phone manufacturer */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CGMI");
if (res) {
- DEBUGA_SKYPE("AT+CGMI failed\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CGMI failed\n", CELLIAX_P_LOG);
}
/* phone model */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CGMM");
if (res) {
- DEBUGA_SKYPE("AT+CGMM failed\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CGMM failed\n", CELLIAX_P_LOG);
}
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CGSN");
if (res) {
- DEBUGA_SKYPE("AT+CGSN failed\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CGSN failed\n", CELLIAX_P_LOG);
}
/* this take a lot of time to complete on devices with slow serial link (eg.: 9600bps) */
/* signal incoming SMS with a +CMTI unsolicited msg */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CNMI=3,1,0,0,0");
if (res) {
- DEBUGA_SKYPE("AT+CNMI=3,1,0,0,0 failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CNMI=3,1,0,0,0 failed, continue\n", CELLIAX_P_LOG);
tech_pvt->sms_cnmi_not_supported = 1;
tech_pvt->celliax_serial_sync_period = 30;
}
/* what is the Message Center address (number) to which the SMS has to be sent? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCA?");
if (res) {
- DEBUGA_SKYPE("AT+CSCA? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CSCA? failed, continue\n", CELLIAX_P_LOG);
}
/* what is the Message Format of SMSs? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CMGF?");
if (res) {
- DEBUGA_SKYPE("AT+CMGF? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CMGF? failed, continue\n", CELLIAX_P_LOG);
}
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CMGF=1"); //TODO: support phones that only accept pdu mode
if (res) {
- ERRORA("Error setting SMS sending mode to TEXT on the cellphone\n", SKYPIAX_P_LOG);
+ ERRORA("Error setting SMS sending mode to TEXT on the cellphone\n", CELLIAX_P_LOG);
return RESULT_FAILURE;
}
/* what is the Charset of SMSs? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCS?");
if (res) {
- DEBUGA_SKYPE("AT+CSCS? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CSCS? failed, continue\n", CELLIAX_P_LOG);
}
tech_pvt->no_ucs2 = 0;
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\"");
if (res) {
- WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", SKYPIAX_P_LOG);
+ WARNINGA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, let's try with 'GSM'\n", CELLIAX_P_LOG);
tech_pvt->no_ucs2 = 1;
}
if (tech_pvt->no_ucs2) {
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\"");
if (res) {
- WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", SKYPIAX_P_LOG);
+ WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", CELLIAX_P_LOG);
}
//res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,16"); //"flash", class 0 sms 7 bit
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,0"); //normal, 7 bit message
if (res) {
- WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", SKYPIAX_P_LOG);
+ WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", CELLIAX_P_LOG);
}
} else {
//res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,20"); //"flash", class 0 sms 16 bit unicode
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message
if (res) {
- WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", SKYPIAX_P_LOG);
+ WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", CELLIAX_P_LOG);
}
}
/* is the unsolicited reporting of mobile equipment event supported? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CMER=?");
if (res) {
- DEBUGA_SKYPE("AT+CMER=? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CMER=? failed, continue\n", CELLIAX_P_LOG);
}
/* request unsolicited reporting of mobile equipment indicators' events, to be screened by categories reported by +CIND=? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CMER=3,0,0,1");
if (res) {
- DEBUGA_SKYPE("AT+CMER=? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CMER=? failed, continue\n", CELLIAX_P_LOG);
}
/* is the solicited reporting of mobile equipment indications supported? */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CIND=?");
if (res) {
- DEBUGA_SKYPE("AT+CIND=? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CIND=? failed, continue\n", CELLIAX_P_LOG);
}
/* is the unsolicited reporting of call monitoring supported? sony-ericsson specific */
res = celliax_serial_write_AT_ack(tech_pvt, "AT*ECAM=?");
if (res) {
- DEBUGA_SKYPE("AT*ECAM=? failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT*ECAM=? failed, continue\n", CELLIAX_P_LOG);
}
/* enable the unsolicited reporting of call monitoring. sony-ericsson specific */
res = celliax_serial_write_AT_ack(tech_pvt, "AT*ECAM=1");
if (res) {
- DEBUGA_SKYPE("AT*ECAM=1 failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT*ECAM=1 failed, continue\n", CELLIAX_P_LOG);
tech_pvt->at_has_ecam = 0;
} else {
tech_pvt->at_has_ecam = 1;
@@ -366,7 +366,7 @@
/* disable unsolicited signaling of call list */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CLCC=0");
if (res) {
- DEBUGA_SKYPE("AT+CLCC=0 failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CLCC=0 failed, continue\n", CELLIAX_P_LOG);
tech_pvt->at_has_clcc = 0;
} else {
tech_pvt->at_has_clcc = 1;
@@ -375,14 +375,14 @@
/* give unsolicited caller id when incoming call */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CLIP=1");
if (res) {
- DEBUGA_SKYPE("AT+CLIP failed, continue\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+CLIP failed, continue\n", CELLIAX_P_LOG);
}
/* for motorola */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+MCST=1"); /* motorola call control codes
(to know when call is disconnected (they
don't give you "no carrier") */
if (res) {
- DEBUGA_SKYPE("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola," " no problem.\n", CELLIAX_P_LOG);
}
/* for motorola end */
@@ -392,7 +392,7 @@
if (strlen(tech_pvt->at_postinit_1)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_postinit_1, tech_pvt->at_postinit_1_expect);
}
} else {
break;
@@ -401,7 +401,7 @@
if (strlen(tech_pvt->at_postinit_2)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_postinit_2, tech_pvt->at_postinit_2_expect);
}
} else {
break;
@@ -410,7 +410,7 @@
if (strlen(tech_pvt->at_postinit_3)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_postinit_3, tech_pvt->at_postinit_3_expect);
}
} else {
break;
@@ -419,7 +419,7 @@
if (strlen(tech_pvt->at_postinit_4)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_postinit_4, tech_pvt->at_postinit_4_expect);
}
} else {
break;
@@ -428,7 +428,7 @@
if (strlen(tech_pvt->at_postinit_5)) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect);
if (res) {
- DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect);
+ DEBUGA_CELLIAX("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG, tech_pvt->at_postinit_5, tech_pvt->at_postinit_5_expect);
}
} else {
break;
@@ -466,7 +466,7 @@
FD_ZERO(&read_fds);
FD_SET(tech_pvt->controldevfd, &read_fds);
- //NOTICA (" INSIDE this celliax_serial_device %s \n", SKYPIAX_P_LOG, tech_pvt->controldevice_name);
+ //NOTICA (" INSIDE this celliax_serial_device %s \n", CELLIAX_P_LOG, tech_pvt->controldevice_name);
tmp_answer_ptr = tmp_answer;
memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ);
@@ -483,20 +483,20 @@
if (read_count == 0) {
ERRORA
("read 0 bytes!!! Nenormalno! Marking this celliax_serial_device %s as dead, andif it is owned by a channel, hanging up. Maybe the phone is stuck, switched off, power down or battery exhausted\n",
- SKYPIAX_P_LOG, tech_pvt->controldevice_name);
+ CELLIAX_P_LOG, tech_pvt->controldevice_name);
tech_pvt->controldev_dead = 1;
close(tech_pvt->controldevfd);
UNLOCKA(tech_pvt->controldev_lock);
if (tech_pvt->owner) {
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
}
return -1;
}
if (option_debug > 90) {
- //DEBUGA_SKYPE("1 read %d bytes, --|%s|--\n", SKYPIAX_P_LOG, read_count, tmp_answer_ptr);
- //DEBUGA_SKYPE("2 read %d bytes, --|%s|--\n", SKYPIAX_P_LOG, read_count, tmp_answer);
+ //DEBUGA_CELLIAX("1 read %d bytes, --|%s|--\n", CELLIAX_P_LOG, read_count, tmp_answer_ptr);
+ //DEBUGA_CELLIAX("2 read %d bytes, --|%s|--\n", CELLIAX_P_LOG, read_count, tmp_answer);
}
tmp_answer_ptr = tmp_answer_ptr + read_count;
@@ -511,7 +511,7 @@
if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) {
WARNINGA
("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n",
- SKYPIAX_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]);
+ CELLIAX_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]);
}
la_counter++;
while ((token_ptr = strtok(NULL, "\n\r"))) {
@@ -520,7 +520,7 @@
if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) {
WARNINGA
("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n",
- SKYPIAX_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]);
+ CELLIAX_P_LOG, token_ptr, tech_pvt->line_array.result[la_counter]);
}
la_counter++;
}
@@ -529,9 +529,9 @@
}
if (expected_string && !expect_crlf) {
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("last_line_ptr=|%s|, expected_string=|%s|, expect_crlf=%d, memcmp(last_line_ptr, expected_string, strlen(expected_string)) = %d\n",
- SKYPIAX_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr, expected_string, strlen(expected_string)));
+ CELLIAX_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr, expected_string, strlen(expected_string)));
}
if (expected_string && !expect_crlf && !memcmp(last_line_ptr, expected_string, strlen(expected_string))
@@ -548,7 +548,7 @@
/* let's list the complete lines read so far, without re-listing the lines that has yet been listed */
if (option_debug > 1) {
for (i = la_read; i < la_counter; i++)
- DEBUGA_SKYPE("Read line %d: |%s|\n", SKYPIAX_P_LOG, i, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("Read line %d: |%s|\n", CELLIAX_P_LOG, i, tech_pvt->line_array.result[i]);
}
/* let's interpret the complete lines read so far (WITHOUT looking for OK, ERROR, and EXPECTED_STRING), without re-interpreting the lines that has been yet interpreted, so we're sure we don't miss anything */
@@ -560,8 +560,8 @@
/* give CALLID (+CLIP) a chance, wait for the next RING before answering */
if (tech_pvt->phone_callflow == CALLFLOW_INCOMING_RING) {
/* we're at the second ring, set the interface state, will be answered by celliax_do_monitor */
- DEBUGA_SKYPE("|%s| got second RING\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- tech_pvt->interface_state = SKYPIAX_STATE_RING;
+ DEBUGA_CELLIAX("|%s| got second RING\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ tech_pvt->interface_state = CELLIAX_STATE_RING;
} else {
/* we're at the first ring, so there is no CALLID yet thus clean the previous one
just in case we don't receive the caller identification in this new call */
@@ -570,14 +570,14 @@
/* only send AT+CLCC? if the device previously reported its support */
if (tech_pvt->at_has_clcc != 0) {
/* we're at the first ring, try to get CALLID (with +CLCC) */
- DEBUGA_SKYPE("|%s| got first RING, sending AT+CLCC?\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| got first RING, sending AT+CLCC?\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
res = celliax_serial_write_AT_noack(tech_pvt, "AT+CLCC?");
if (res) {
- ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n", CELLIAX_P_LOG);
}
} else {
- DEBUGA_SKYPE("|%s| got first RING, but not sending AT+CLCC? as this device "
- "seems not to support\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| got first RING, but not sending AT+CLCC? as this device "
+ "seems not to support\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
}
tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING;
@@ -612,7 +612,7 @@
}
tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING;
- DEBUGA_SKYPE("|%s| CLCC CALLID: name is %s, number is %s\n", SKYPIAX_P_LOG,
+ DEBUGA_CELLIAX("|%s| CLCC CALLID: name is %s, number is %s\n", CELLIAX_P_LOG,
tech_pvt->line_array.result[i],
tech_pvt->callid_name[0] ? tech_pvt->callid_name : "not available",
tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available");
@@ -646,15 +646,15 @@
}
}
- if (tech_pvt->interface_state != SKYPIAX_STATE_RING) {
+ if (tech_pvt->interface_state != CELLIAX_STATE_RING) {
gettimeofday(&(tech_pvt->call_incoming_time), NULL);
- DEBUGA_SKYPE("SKYPIAX_STATE_RING call_incoming_time.tv_sec=%ld\n", SKYPIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec);
+ DEBUGA_CELLIAX("CELLIAX_STATE_RING call_incoming_time.tv_sec=%ld\n", CELLIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec);
}
- tech_pvt->interface_state = SKYPIAX_STATE_RING;
+ tech_pvt->interface_state = CELLIAX_STATE_RING;
tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING;
- DEBUGA_SKYPE("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", SKYPIAX_P_LOG,
+ DEBUGA_CELLIAX("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", CELLIAX_P_LOG,
tech_pvt->line_array.result[i],
(strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) ? tech_pvt->callid_name : "not available",
strlen(tech_pvt->callid_number) ? tech_pvt->callid_number : "not available");
@@ -665,9 +665,11 @@
if( !strlen(tech_pvt->callid_name) && tech_pvt->callid_name[0] != 1) {
strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)) ;
+ //strncpy(tech_pvt->callid_name, tech_pvt->callid_number, sizeof(tech_pvt->callid_name)) ;
+ snprintf(tech_pvt->callid_name, sizeof(tech_pvt->callid_name), "Celliax: %s", tech_pvt->callid_number);
}
- DEBUGA_SKYPE("|%s| CLIP INCOMING CALLID: NOW name is %s, number is %s\n", SKYPIAX_P_LOG,
+ DEBUGA_CELLIAX("|%s| CLIP INCOMING CALLID: NOW name is %s, number is %s\n", CELLIAX_P_LOG,
tech_pvt->line_array.result[i],
tech_pvt->callid_name,
tech_pvt->callid_number);
@@ -676,36 +678,36 @@
if ((strcmp(tech_pvt->line_array.result[i], "BUSY") == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_LINEBUSY\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- ast_setstate(tech_pvt->owner, SKYPIAX_STATE_BUSY);
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_BUSY);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_LINEBUSY\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ ast_setstate(tech_pvt->owner, CELLIAX_STATE_BUSY);
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_BUSY);
} else {
- ERRORA("Why BUSY now?\n", SKYPIAX_P_LOG);
+ ERRORA("Why BUSY now?\n", CELLIAX_P_LOG);
}
}
if ((strcmp(tech_pvt->line_array.result[i], "NO ANSWER") == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_NOANSWER;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_NOANSWER\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_NO_ANSWER;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_NOANSWER\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_NO_ANSWER;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
} else {
- ERRORA("Why NO ANSWER now?\n", SKYPIAX_P_LOG);
+ ERRORA("Why NO ANSWER now?\n", CELLIAX_P_LOG);
}
}
if ((strcmp(tech_pvt->line_array.result[i], "NO CARRIER") == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_NOCARRIER\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_NOCARRIER\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN) {
//cicopet
celliax_hangup(tech_pvt);
- //tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
- //celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ //tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
+ //celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
} else {
- ERRORA("Why NO CARRIER now?\n", SKYPIAX_P_LOG);
+ ERRORA("Why NO CARRIER now?\n", CELLIAX_P_LOG);
}
}
@@ -716,27 +718,27 @@
err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &power_supply, &battery_strenght);
if (err < 2) {
- DEBUGA_SKYPE("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
err = sscanf(&tech_pvt->line_array.result[i][5], "%d,%d", &power_supply, &battery_strenght);
- DEBUGA_SKYPE("|%s| +CBC: Powered by %s, battery strenght=%d\n", SKYPIAX_P_LOG,
+ DEBUGA_CELLIAX("|%s| +CBC: Powered by %s, battery strenght=%d\n", CELLIAX_P_LOG,
tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght);
}
if (err < 2) {
- DEBUGA_SKYPE("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
else {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| +CBC: Powered by %s, battery strenght=%d\n", SKYPIAX_P_LOG,
+ DEBUGA_CELLIAX("|%s| +CBC: Powered by %s, battery strenght=%d\n", CELLIAX_P_LOG,
tech_pvt->line_array.result[i], power_supply ? "power supply" : "battery", battery_strenght);
if (!power_supply) {
if (battery_strenght < 10) {
- ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else if (battery_strenght < 20) {
- WARNINGA("|%s| BATTERY LOW\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ WARNINGA("|%s| BATTERY LOW\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
@@ -752,16 +754,16 @@
err = sscanf(&tech_pvt->line_array.result[i][6], "%d,%d", &signal_quality, &ber);
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i], signal_quality, ber);
+ DEBUGA_CELLIAX("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i], signal_quality, ber);
if (err < 2) {
- ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else {
if (signal_quality < 11 || signal_quality == 99) {
WARNINGA
("|%s| CELLPHONE GETS ALMOST NO SIGNAL, consider to move it or additional antenna\n",
- SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else if (signal_quality < 15) {
- WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
@@ -772,9 +774,9 @@
int err;
err = sscanf(&tech_pvt->line_array.result[i][7], "%s", tech_pvt->at_cmgw);
- DEBUGA_SKYPE("|%s| +CMGW: %s\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i], tech_pvt->at_cmgw);
+ DEBUGA_CELLIAX("|%s| +CMGW: %s\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i], tech_pvt->at_cmgw);
if (err < 1) {
- ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
}
@@ -783,12 +785,12 @@
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_idle) == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_IDLE\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- DEBUGA_SKYPE("just received a remote HANGUP\n", SKYPIAX_P_LOG);
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_NORMAL;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
- DEBUGA_SKYPE("just sent SKYPIAX_CONTROL_HANGUP\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_IDLE\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ DEBUGA_CELLIAX("just received a remote HANGUP\n", CELLIAX_P_LOG);
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_NORMAL;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
+ DEBUGA_CELLIAX("just sent CELLIAX_CONTROL_HANGUP\n", CELLIAX_P_LOG);
}
}
@@ -797,60 +799,60 @@
//char list_command[64];
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_INCOMING\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_INCOMING\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
if (tech_pvt->phone_callflow != CALLFLOW_CALL_INCOMING && tech_pvt->phone_callflow != CALLFLOW_INCOMING_RING) {
//mark the time of CALLFLOW_CALL_INCOMING
gettimeofday(&(tech_pvt->call_incoming_time), NULL);
tech_pvt->phone_callflow = CALLFLOW_CALL_INCOMING;
- DEBUGA_SKYPE("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n", SKYPIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec);
+ DEBUGA_CELLIAX("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n", CELLIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec);
}
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_active) == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE;
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_ACTIVE\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_ACTIVE\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
if (tech_pvt->interface_state == CALLFLOW_CALL_DIALING || tech_pvt->interface_state == CALLFLOW_STATUS_EARLYMEDIA) {
- DEBUGA_PBX("just received a remote ANSWER\n", SKYPIAX_P_LOG);
- if (tech_pvt->phone_callflow == SKYPIAX_STATE_UP) {
- //celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_RINGING);
- DEBUGA_PBX("just sent SKYPIAX_CONTROL_RINGING\n", SKYPIAX_P_LOG);
- DEBUGA_PBX("going to send SKYPIAX_CONTROL_ANSWER\n", SKYPIAX_P_LOG);
- //celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_ANSWER);
+ DEBUGA_PBX("just received a remote ANSWER\n", CELLIAX_P_LOG);
+ if (tech_pvt->phone_callflow == CELLIAX_STATE_UP) {
+ //celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_RINGING);
+ DEBUGA_PBX("just sent CELLIAX_CONTROL_RINGING\n", CELLIAX_P_LOG);
+ DEBUGA_PBX("going to send CELLIAX_CONTROL_ANSWER\n", CELLIAX_P_LOG);
+ //celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_ANSWER);
tech_pvt->interface_state = CALLFLOW_CALL_REMOTEANSWER;
- DEBUGA_PBX("just sent SKYPIAX_CONTROL_ANSWER\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("just sent CELLIAX_CONTROL_ANSWER\n", CELLIAX_P_LOG);
}
} else {
}
- //tech_pvt->interface_state = SKYPIAX_STATE_UP;
- //DEBUGA_PBX("just interface_state UP\n", SKYPIAX_P_LOG);
+ //tech_pvt->interface_state = CELLIAX_STATE_UP;
+ //DEBUGA_PBX("just interface_state UP\n", CELLIAX_P_LOG);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_calling) == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_DIALING\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_DIALING\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_call_failed) == 0)) {
tech_pvt->phone_callflow = CALLFLOW_CALL_FAILED;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_FAILED\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_FAILED\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
}
}
if ((strncmp(tech_pvt->line_array.result[i], "+CSCA:", 6) == 0)) { //TODO SMS FIXME in config!
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| +CSCA: Message Center Address!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CSCA: Message Center Address!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strncmp(tech_pvt->line_array.result[i], "+CMGF:", 6) == 0)) { //TODO SMS FIXME in config!
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| +CMGF: Message Format!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMGF: Message Format!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strncmp(tech_pvt->line_array.result[i], "+CMTI:", 6) == 0)) { //TODO SMS FIXME in config!
@@ -859,13 +861,13 @@
//FIXME all the following commands in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +CMTI: Incoming SMS!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMTI: Incoming SMS!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
err = sscanf(&tech_pvt->line_array.result[i][12], "%d", &pos);
if (err < 1) {
- ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else {
- DEBUGA_SKYPE("|%s| +CMTI: Incoming SMS in position: %d!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i], pos);
+ DEBUGA_CELLIAX("|%s| +CMTI: Incoming SMS in position: %d!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i], pos);
tech_pvt->unread_sms_msg_id = pos;
usleep(1000);
@@ -875,7 +877,7 @@
if (tech_pvt->no_ucs2 == 0) {
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\"");
if (res) {
- ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, continuing\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, continuing\n", CELLIAX_P_LOG);
//memset(tech_pvt->sms_message, 0, sizeof(tech_pvt->sms_message));
}
}
@@ -888,18 +890,18 @@
res = celliax_serial_write_AT_ack(tech_pvt, at_command);
tech_pvt->reading_sms_msg = 0;
if (res) {
- ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", SKYPIAX_P_LOG, at_command);
+ ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", CELLIAX_P_LOG, at_command);
}
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\"");
if (res) {
- ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", CELLIAX_P_LOG);
}
memset(at_command, 0, sizeof(at_command));
sprintf(at_command, "AT+CMGD=%d", tech_pvt->unread_sms_msg_id); /* delete the message */
tech_pvt->unread_sms_msg_id = 0;
res = celliax_serial_write_AT_ack(tech_pvt, at_command);
if (res) {
- ERRORA("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", SKYPIAX_P_LOG, at_command);
+ ERRORA("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n", CELLIAX_P_LOG, at_command);
}
if (strlen(tech_pvt->sms_message)) {
@@ -912,7 +914,7 @@
char *arg1[] = { tech_pvt->sms_receiving_program, (char *) NULL };
int i;
- NOTICA("incoming SMS message:>>>%s<<<\n", SKYPIAX_P_LOG, tech_pvt->sms_message);
+ NOTICA("incoming SMS message:>>>%s<<<\n", CELLIAX_P_LOG, tech_pvt->sms_message);
pipe(fd1);
pid1 = fork();
@@ -927,7 +929,7 @@
if (err) {
ERRORA
("'sms_receiving_program' is set in config file to '%s', and it gave us back this error: %d, (%s). SMS received was:---%s---\n",
- SKYPIAX_P_LOG, tech_pvt->sms_receiving_program, err, strerror(errno), tech_pvt->sms_message);
+ CELLIAX_P_LOG, tech_pvt->sms_receiving_program, err, strerror(errno), tech_pvt->sms_message);
}
close(fd1[0]); // close output pipe side
}
@@ -941,15 +943,15 @@
} else {
ERRORA
("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n",
- SKYPIAX_P_LOG, tech_pvt->sms_message);
+ CELLIAX_P_LOG, tech_pvt->sms_message);
}
}
#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself
- if (tech_pvt->phone_callflow == CALLFLOW_CALL_IDLE && tech_pvt->interface_state == SKYPIAX_STATE_DOWN && tech_pvt->owner == NULL) {
+ if (tech_pvt->phone_callflow == CALLFLOW_CALL_IDLE && tech_pvt->interface_state == CELLIAX_STATE_DOWN && tech_pvt->owner == NULL) {
/* we're not in a call, neither calling */
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\"");
if (res) {
- ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n", CELLIAX_P_LOG);
}
}
#endif
@@ -964,35 +966,35 @@
//int unread_msg_id=0;
if (option_debug)
- DEBUGA_SKYPE("|%s| +MMGL: Listing Motorola SMSs!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +MMGL: Listing Motorola SMSs!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
err = sscanf(&tech_pvt->line_array.result[i][7], "%d", &tech_pvt->unread_sms_msg_id);
if (err < 1) {
- ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
}
if ((strncmp(tech_pvt->line_array.result[i], "+CMGL:", 6) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +CMGL: Listing SMSs!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMGL: Listing SMSs!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strncmp(tech_pvt->line_array.result[i], "+MMGR:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +MMGR: Reading Motorola SMS!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +MMGR: Reading Motorola SMS!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
if (tech_pvt->reading_sms_msg)
tech_pvt->reading_sms_msg++;
}
if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO U", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +CMGR: Reading stored UNSENT SMS!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMGR: Reading stored UNSENT SMS!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"STO S", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +CMGR: Reading stored SENT SMS!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMGR: Reading stored SENT SMS!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC R", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +CMGR: Reading received READ SMS!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMGR: Reading received READ SMS!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else if ((strncmp(tech_pvt->line_array.result[i], "+CMGR: \"REC U", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_SKYPE("|%s| +CMGR: Reading received UNREAD SMS!\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| +CMGR: Reading received UNREAD SMS!\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
if (tech_pvt->reading_sms_msg)
tech_pvt->reading_sms_msg++;
}
@@ -1000,34 +1002,34 @@
if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */
tech_pvt->phone_callflow = CALLFLOW_CALL_INFLUX;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_INFLUX\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_INFLUX\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 68") == 0)) { /* motorola call processing unsolicited messages */
tech_pvt->phone_callflow = CALLFLOW_CALL_NOSERVICE;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_NOSERVICE\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_NOSERVICE\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
}
}
if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 70") == 0)) { /* motorola call processing unsolicited messages */
tech_pvt->phone_callflow = CALLFLOW_CALL_OUTGOINGRESTRICTED;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
}
}
if ((strcmp(tech_pvt->line_array.result[i], "+MCST: 72") == 0)) { /* motorola call processing unsolicited messages */
tech_pvt->phone_callflow = CALLFLOW_CALL_SECURITYFAIL;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| CALLFLOW_CALL_SECURITYFAIL\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN && tech_pvt->owner) {
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ DEBUGA_CELLIAX("|%s| CALLFLOW_CALL_SECURITYFAIL\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN && tech_pvt->owner) {
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
}
}
@@ -1037,7 +1039,7 @@
int err, first_entry, last_entry, number_lenght, text_lenght;
if (option_debug)
- DEBUGA_SKYPE("phonebook struct: |%s|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("phonebook struct: |%s|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
err = sscanf(&tech_pvt->line_array.result[i][8], "%d-%d),%d,%d", &first_entry, &last_entry, &number_lenght, &text_lenght);
if (err < 4) {
@@ -1048,13 +1050,13 @@
if (err < 4) {
ERRORA
("phonebook struct: |%s| is nor formatted as: |+CPBR: (1-750),40,14| neither as: |+CPBR: 1-750,40,14|\n",
- SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
} else {
if (option_debug)
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("First entry: %d, last entry: %d, phone number max lenght: %d, text max lenght: %d\n",
- SKYPIAX_P_LOG, first_entry, last_entry, number_lenght, text_lenght);
+ CELLIAX_P_LOG, first_entry, last_entry, number_lenght, text_lenght);
tech_pvt->phonebook_first_entry = first_entry;
tech_pvt->phonebook_last_entry = last_entry;
tech_pvt->phonebook_number_lenght = number_lenght;
@@ -1070,18 +1072,18 @@
char entry_text[256];
if (option_debug)
- DEBUGA_SKYPE("phonebook entry: |%s|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("phonebook entry: |%s|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
err =
sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, entry_text);
if (err < 4) {
ERRORA
("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n",
- SKYPIAX_P_LOG, err, tech_pvt->line_array.result[i]);
+ CELLIAX_P_LOG, err, tech_pvt->line_array.result[i]);
} else {
//TODO: sanitize entry_text
if (option_debug)
- DEBUGA_SKYPE("Number: %s, Text: %s, Type: %d\n", SKYPIAX_P_LOG, entry_number, entry_text, entry_type);
+ DEBUGA_CELLIAX("Number: %s, Text: %s, Type: %d\n", CELLIAX_P_LOG, entry_number, entry_text, entry_type);
/* write entry in phonebook file */
if (tech_pvt->phonebook_writing_fp) {
celliax_dir_entry_extension++;
@@ -1106,34 +1108,34 @@
char entry_text[256] = "";
if (option_debug)
- DEBUGA_SKYPE("phonebook entry: |%s|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("phonebook entry: |%s|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
err =
sscanf(&tech_pvt->line_array.result[i][7], "%d,\"%255[0-9+]\",%d,\"%255[^\"]\"", &entry_id, entry_number, &entry_type, entry_text);
if (err < 1) { //we match only on the progressive id, maybe the remote party has not sent its number, and/or there is no corresponding text entry in the phone directory
ERRORA
("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n",
- SKYPIAX_P_LOG, err, tech_pvt->line_array.result[i]);
+ CELLIAX_P_LOG, err, tech_pvt->line_array.result[i]);
} else {
//TODO: sanitize entry_text
if (option_debug)
- DEBUGA_SKYPE("Number: %s, Text: %s, Type: %d\n", SKYPIAX_P_LOG, entry_number, entry_text, entry_type);
+ DEBUGA_CELLIAX("Number: %s, Text: %s, Type: %d\n", CELLIAX_P_LOG, entry_number, entry_text, entry_type);
memset(tech_pvt->callid_name, 0, sizeof(tech_pvt->callid_name));
memset(tech_pvt->callid_number, 0, sizeof(tech_pvt->callid_number));
strncpy(tech_pvt->callid_name, entry_text, sizeof(tech_pvt->callid_name));
strncpy(tech_pvt->callid_number, entry_number, sizeof(tech_pvt->callid_number));
if (option_debug)
- DEBUGA_SKYPE("incoming callid: Text: %s, Number: %s\n", SKYPIAX_P_LOG, tech_pvt->callid_name, tech_pvt->callid_number);
+ DEBUGA_CELLIAX("incoming callid: Text: %s, Number: %s\n", CELLIAX_P_LOG, tech_pvt->callid_name, tech_pvt->callid_number);
- DEBUGA_SKYPE("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n",
- SKYPIAX_P_LOG, tech_pvt->line_array.result[i],
+ DEBUGA_CELLIAX("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n",
+ CELLIAX_P_LOG, tech_pvt->line_array.result[i],
tech_pvt->callid_name[0] != 1 ? tech_pvt->callid_name : "not available",
tech_pvt->callid_number[0] ? tech_pvt->callid_number : "not available");
/* mark the time of RING */
gettimeofday(&(tech_pvt->ringtime), NULL);
- tech_pvt->interface_state = SKYPIAX_STATE_RING;
+ tech_pvt->interface_state = CELLIAX_STATE_RING;
tech_pvt->phone_callflow = CALLFLOW_INCOMING_RING;
}
@@ -1141,7 +1143,7 @@
}
else {
- DEBUGA_SKYPE("phonebook entry: |%s|\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("phonebook entry: |%s|\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
}
@@ -1157,66 +1159,66 @@
switch (ccstatus) {
case 0:
if (tech_pvt->owner) {
- ast_setstate(tech_pvt->owner, SKYPIAX_STATE_DOWN);
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_NORMAL;
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ ast_setstate(tech_pvt->owner, CELLIAX_STATE_DOWN);
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_NORMAL;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
}
tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE;
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ tech_pvt->interface_state = CELLIAX_STATE_DOWN;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 1:
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 2:
if (tech_pvt->owner) {
- ast_setstate(tech_pvt->owner, SKYPIAX_STATE_DIALING);
+ ast_setstate(tech_pvt->owner, CELLIAX_STATE_DIALING);
}
tech_pvt->interface_state = CALLFLOW_CALL_DIALING;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 3:
if (tech_pvt->owner) {
- ast_setstate(tech_pvt->owner, SKYPIAX_STATE_UP);
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_ANSWER);
+ ast_setstate(tech_pvt->owner, CELLIAX_STATE_UP);
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_ANSWER);
}
tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE;
- tech_pvt->interface_state = SKYPIAX_STATE_UP;
+ tech_pvt->interface_state = CELLIAX_STATE_UP;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 4:
if (option_debug > 1)
- DEBUGA_SKYPE
- ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX
+ ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 5:
if (option_debug > 1)
- DEBUGA_SKYPE
- ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX
+ ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 6:
if (option_debug > 1)
- DEBUGA_SKYPE
- ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX
+ ("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
case 7:
if (tech_pvt->owner) {
- ast_setstate(tech_pvt->owner, SKYPIAX_STATE_BUSY);
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_BUSY);
+ ast_setstate(tech_pvt->owner, CELLIAX_STATE_BUSY);
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_BUSY);
}
tech_pvt->phone_callflow = CALLFLOW_CALL_LINEBUSY;
- tech_pvt->interface_state = SKYPIAX_STATE_BUSY;
+ tech_pvt->interface_state = CELLIAX_STATE_BUSY;
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
break;
}
} else {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
}
@@ -1224,58 +1226,58 @@
/* at_indicator_* are unsolicited messages sent by the phone to signal us that some of its visual indicators on its screen has changed, based on CIND CMER ETSI docs */
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_noservice_string) == 0)) {
if (option_debug > 1)
- ERRORA("|%s| at_indicator_noservice_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| at_indicator_noservice_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nosignal_string) == 0)) {
if (option_debug > 1)
- ERRORA("|%s| at_indicator_nosignal_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| at_indicator_nosignal_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowsignal_string) == 0)) {
if (option_debug > 1)
- WARNINGA("|%s| at_indicator_lowsignal_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ WARNINGA("|%s| at_indicator_lowsignal_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_lowbattchg_string) == 0)) {
if (option_debug > 1)
- WARNINGA("|%s| at_indicator_lowbattchg_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ WARNINGA("|%s| at_indicator_lowbattchg_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nobattchg_string) == 0)) {
if (option_debug > 1)
- ERRORA("|%s| at_indicator_nobattchg_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ ERRORA("|%s| at_indicator_nobattchg_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callactive_string) == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| at_indicator_callactive_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| at_indicator_callactive_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallactive_string) == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| at_indicator_nocallactive_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| at_indicator_nocallactive_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_nocallsetup_string) == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| at_indicator_nocallsetup_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| at_indicator_nocallsetup_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupincoming_string) == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| at_indicator_callsetupincoming_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| at_indicator_callsetupincoming_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupoutgoing_string) == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| at_indicator_callsetupoutgoing_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| at_indicator_callsetupoutgoing_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
if ((strcmp(tech_pvt->line_array.result[i], tech_pvt->at_indicator_callsetupremoteringing_string)
== 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| at_indicator_callsetupremoteringing_string\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| at_indicator_callsetupremoteringing_string\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
}
}
@@ -1286,19 +1288,19 @@
if ((strncmp(tech_pvt->line_array.result[i], expected_string, strlen(expected_string))
== 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("|%s| got what EXPECTED\n", SKYPIAX_P_LOG, tech_pvt->line_array.result[i]);
+ DEBUGA_CELLIAX("|%s| got what EXPECTED\n", CELLIAX_P_LOG, tech_pvt->line_array.result[i]);
at_ack = AT_OK;
}
} else {
if ((strcmp(tech_pvt->line_array.result[i], "OK") == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("got OK\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("got OK\n", CELLIAX_P_LOG);
at_ack = AT_OK;
}
}
if ((strcmp(tech_pvt->line_array.result[i], "ERROR") == 0)) {
if (option_debug > 1)
- DEBUGA_SKYPE("got ERROR\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("got ERROR\n", CELLIAX_P_LOG);
at_ack = AT_ERROR;
}
@@ -1322,17 +1324,17 @@
if (tech_pvt->line_array.result[i][c] == ',' && tech_pvt->line_array.result[i][c - 1] != '\\' && inside_quote == 0) {
if (inside_comma) {
inside_comma = 0;
- //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
+ //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
} else {
inside_comma = 1;
- //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
+ //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
}
}
if (tech_pvt->line_array.result[i][c] == '"' && tech_pvt->line_array.result[i][c - 1] != '\\') {
if (inside_quote) {
inside_quote = 0;
- //ERRORA("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
- DEBUGA_SKYPE("content=%s\n", SKYPIAX_P_LOG, content);
+ //ERRORA("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
+ DEBUGA_CELLIAX("content=%s\n", CELLIAX_P_LOG, content);
strncat(tech_pvt->sms_message, "---", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1));
strncat(tech_pvt->sms_message, content, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1));
@@ -1349,7 +1351,7 @@
d = 0;
} else {
inside_quote = 1;
- //WARNINGA("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
+ //WARNINGA("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &tech_pvt->line_array.result[i][c]);
}
}
if (inside_quote && tech_pvt->line_array.result[i][c] != '"') {
@@ -1374,7 +1376,7 @@
strncat(tech_pvt->sms_message, sms_body, ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1));
strncat(tech_pvt->sms_message, "|||", ((sizeof(tech_pvt->sms_message) - strlen(tech_pvt->sms_message)) - 1));
- DEBUGA_SKYPE("sms_message=%s\n", SKYPIAX_P_LOG, tech_pvt->sms_message);
+ DEBUGA_CELLIAX("sms_message=%s\n", CELLIAX_P_LOG, tech_pvt->sms_message);
} //it was the UCS2 from cellphone
@@ -1388,7 +1390,7 @@
break;
if (la_counter > AT_MESG_MAX_LINES) {
- ERRORA("Too many lines in result (>%d). Stopping reader.\n", SKYPIAX_P_LOG, AT_MESG_MAX_LINES);
+ ERRORA("Too many lines in result (>%d). Stopping reader.\n", CELLIAX_P_LOG, AT_MESG_MAX_LINES);
at_ack = AT_ERROR;
break;
}
@@ -1397,11 +1399,11 @@
UNLOCKA(tech_pvt->controldev_lock);
POPPA_UNLOCKA(tech_pvt->controldev_lock);
if (select_err == -1) {
- ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", SKYPIAX_P_LOG, tech_pvt->controldevice_name, strerror(errno));
+ ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n", CELLIAX_P_LOG, tech_pvt->controldevice_name, strerror(errno));
tech_pvt->controldev_dead = 1;
close(tech_pvt->controldevfd);
if (tech_pvt->owner)
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
return -1;
}
@@ -1410,31 +1412,31 @@
struct timeval call_incoming_timeout;
gettimeofday(&call_incoming_timeout, NULL);
call_incoming_timeout.tv_sec -= 3;
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- SKYPIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ CELLIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
if (call_incoming_timeout.tv_sec > tech_pvt->call_incoming_time.tv_sec) {
tech_pvt->call_incoming_time.tv_sec = 0;
tech_pvt->call_incoming_time.tv_usec = 0;
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- SKYPIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ CELLIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CPBS=RC");
if (res) {
- ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", CELLIAX_P_LOG);
}
tech_pvt->phonebook_querying = 1;
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CPBR=?");
if (res) {
- ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n", CELLIAX_P_LOG);
}
tech_pvt->phonebook_querying = 0;
sprintf(list_command, "AT+CPBR=%d,%d", tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry);
tech_pvt->phonebook_listing_received_calls = 1;
res = celliax_serial_write_AT_expect_longtime(tech_pvt, list_command, "OK");
if (res) {
- WARNINGA("AT+CPBR=%d,%d failed, continue\n", SKYPIAX_P_LOG, tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry);
+ WARNINGA("AT+CPBR=%d,%d failed, continue\n", CELLIAX_P_LOG, tech_pvt->phonebook_first_entry, tech_pvt->phonebook_last_entry);
}
tech_pvt->phonebook_listing_received_calls = 0;
}
@@ -1444,22 +1446,22 @@
struct timeval call_incoming_timeout;
gettimeofday(&call_incoming_timeout, NULL);
call_incoming_timeout.tv_sec -= 10;
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- SKYPIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ CELLIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
if (call_incoming_timeout.tv_sec > tech_pvt->ringtime.tv_sec) {
- ERRORA("Ringing stopped and I have not answered. Why?\n", SKYPIAX_P_LOG);
- DEBUGA_SKYPE
+ ERRORA("Ringing stopped and I have not answered. Why?\n", CELLIAX_P_LOG);
+ DEBUGA_CELLIAX
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- SKYPIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ CELLIAX_P_LOG, tech_pvt->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
if (tech_pvt->owner) {
- celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_HANGUP);
- tech_pvt->owner->hangupcause = SKYPIAX_CAUSE_FAILURE;
+ celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_HANGUP);
+ tech_pvt->owner->hangupcause = CELLIAX_CAUSE_FAILURE;
}
}
}
tech_pvt->line_array.elemcount = la_counter;
- //NOTICA (" OUTSIDE this celliax_serial_device %s \n", SKYPIAX_P_LOG, tech_pvt->controldevice_name);
+ //NOTICA (" OUTSIDE this celliax_serial_device %s \n", CELLIAX_P_LOG, tech_pvt->controldevice_name);
if (look_for_ack)
return at_ack;
else
@@ -1479,51 +1481,51 @@
res = write(tech_pvt->controldevfd, &data[i], 1);
if (res != 1) {
- DEBUGA_SKYPE("Error sending (%.1s): %d (%s)\n", SKYPIAX_P_LOG, &data[i], res, strerror(errno));
+ DEBUGA_CELLIAX("Error sending (%.1s): %d (%s)\n", CELLIAX_P_LOG, &data[i], res, strerror(errno));
usleep(100000);
for (count = 0; count < 10; count++) {
res = write(tech_pvt->controldevfd, &data[i], 1);
if (res == 1) {
- DEBUGA_SKYPE("Successfully RE-sent (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count, res, strerror(errno));
+ DEBUGA_CELLIAX("Successfully RE-sent (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, res, strerror(errno));
break;
} else
- DEBUGA_SKYPE("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count, res, strerror(errno));
+ DEBUGA_CELLIAX("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, res, strerror(errno));
usleep(100000);
}
if (res != 1) {
- ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count, res, strerror(errno));
+ ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, res, strerror(errno));
return -1;
}
}
if (option_debug > 1)
- DEBUGA_SKYPE("sent data... (%.1s)\n", SKYPIAX_P_LOG, &data[i]);
+ DEBUGA_CELLIAX("sent data... (%.1s)\n", CELLIAX_P_LOG, &data[i]);
usleep(1000); /* release the cpu */
}
res = write(tech_pvt->controldevfd, "\r", 1);
if (res != 1) {
- DEBUGA_SKYPE("Error sending (carriage return): %d (%s)\n", SKYPIAX_P_LOG, res, strerror(errno));
+ DEBUGA_CELLIAX("Error sending (carriage return): %d (%s)\n", CELLIAX_P_LOG, res, strerror(errno));
usleep(100000);
for (count = 0; count < 10; count++) {
res = write(tech_pvt->controldevfd, "\r", 1);
if (res == 1) {
- DEBUGA_SKYPE("Successfully RE-sent carriage return: %d %d (%s)\n", SKYPIAX_P_LOG, count, res, strerror(errno));
+ DEBUGA_CELLIAX("Successfully RE-sent carriage return: %d %d (%s)\n", CELLIAX_P_LOG, count, res, strerror(errno));
break;
} else
- DEBUGA_SKYPE("Error RE-sending (carriage return): %d %d (%s)\n", SKYPIAX_P_LOG, count, res, strerror(errno));
+ DEBUGA_CELLIAX("Error RE-sending (carriage return): %d %d (%s)\n", CELLIAX_P_LOG, count, res, strerror(errno));
usleep(100000);
}
if (res != 1) {
- ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", SKYPIAX_P_LOG, count, res, strerror(errno));
+ ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", CELLIAX_P_LOG, count, res, strerror(errno));
return -1;
}
}
if (option_debug > 1)
- DEBUGA_SKYPE("sent (carriage return)\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("sent (carriage return)\n", CELLIAX_P_LOG);
usleep(1000); /* release the cpu */
return howmany;
@@ -1542,24 +1544,24 @@
res = write(tech_pvt->controldevfd, &data[i], 1);
if (res != 1) {
- DEBUGA_SKYPE("Error sending (%.1s): %d (%s)\n", SKYPIAX_P_LOG, &data[i], res, strerror(errno));
+ DEBUGA_CELLIAX("Error sending (%.1s): %d (%s)\n", CELLIAX_P_LOG, &data[i], res, strerror(errno));
usleep(100000);
for (count = 0; count < 10; count++) {
res = write(tech_pvt->controldevfd, &data[i], 1);
if (res == 1)
break;
else
- DEBUGA_SKYPE("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count, res, strerror(errno));
+ DEBUGA_CELLIAX("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, res, strerror(errno));
usleep(100000);
}
if (res != 1) {
- ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count, res, strerror(errno));
+ ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count, res, strerror(errno));
return -1;
}
}
if (option_debug > 1)
- DEBUGA_SKYPE("sent data... (%.1s)\n", SKYPIAX_P_LOG, &data[i]);
+ DEBUGA_CELLIAX("sent data... (%.1s)\n", CELLIAX_P_LOG, &data[i]);
usleep(1000); /* release the cpu */
}
@@ -1572,13 +1574,13 @@
{
if (option_debug > 1)
- DEBUGA_SKYPE("celliax_serial_write_AT_noack: %s\n", SKYPIAX_P_LOG, data);
+ DEBUGA_CELLIAX("celliax_serial_write_AT_noack: %s\n", CELLIAX_P_LOG, data);
PUSHA_UNLOCKA(tech_pvt->controldev_lock);
LOKKA(tech_pvt->controldev_lock);
if (celliax_serial_write_AT(tech_pvt, data) != strlen(data)) {
- ERRORA("Error sending data... (%s)\n", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s)\n", CELLIAX_P_LOG, strerror(errno));
UNLOCKA(tech_pvt->controldev_lock);
return -1;
}
@@ -1595,9 +1597,9 @@
PUSHA_UNLOCKA(tech_pvt->controldev_lock);
LOKKA(tech_pvt->controldev_lock);
if (option_debug > 1)
- DEBUGA_SKYPE("sending: %s\n", SKYPIAX_P_LOG, data);
+ DEBUGA_CELLIAX("sending: %s\n", CELLIAX_P_LOG, data);
if (celliax_serial_write_AT(tech_pvt, data) != strlen(data)) {
- ERRORA("Error sending data... (%s) \n", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno));
UNLOCKA(tech_pvt->controldev_lock);
return -1;
}
@@ -1617,9 +1619,9 @@
PUSHA_UNLOCKA(tech_pvt->controldev_lock);
LOKKA(tech_pvt->controldev_lock);
if (option_debug > 1)
- DEBUGA_SKYPE("sending: %s\n", SKYPIAX_P_LOG, data);
+ DEBUGA_CELLIAX("sending: %s\n", CELLIAX_P_LOG, data);
if (celliax_serial_write_AT_nocr(tech_pvt, data) != strlen(data)) {
- ERRORA("Error sending data... (%s) \n", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno));
UNLOCKA(tech_pvt->controldev_lock);
return -1;
}
@@ -1639,9 +1641,9 @@
PUSHA_UNLOCKA(tech_pvt->controldev_lock);
LOKKA(tech_pvt->controldev_lock);
if (option_debug > 1)
- DEBUGA_SKYPE("sending: %s, expecting: %s\n", SKYPIAX_P_LOG, data, expected_string);
+ DEBUGA_CELLIAX("sending: %s, expecting: %s\n", CELLIAX_P_LOG, data, expected_string);
if (celliax_serial_write_AT(tech_pvt, data) != strlen(data)) {
- ERRORA("Error sending data... (%s) \n", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno));
UNLOCKA(tech_pvt->controldev_lock);
return -1;
}
@@ -1661,7 +1663,7 @@
PUSHA_UNLOCKA(tech_pvt->controldev_lock);
LOKKA(tech_pvt->controldev_lock);
if (option_debug > 1)
- DEBUGA_SKYPE("expecting: %s\n", SKYPIAX_P_LOG, expected_string);
+ DEBUGA_CELLIAX("expecting: %s\n", CELLIAX_P_LOG, expected_string);
at_result = celliax_serial_read_AT(tech_pvt, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs
UNLOCKA(tech_pvt->controldev_lock);
@@ -1693,19 +1695,19 @@
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_answer, tech_pvt->at_answer_expect);
if (res) {
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("at_answer command failed, command used: %s, expecting: %s, trying with AT+CKPD=\"S\"\n",
- SKYPIAX_P_LOG, tech_pvt->at_answer, tech_pvt->at_answer_expect);
+ CELLIAX_P_LOG, tech_pvt->at_answer, tech_pvt->at_answer_expect);
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"S\"");
if (res) {
- ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n", SKYPIAX_P_LOG);
+ ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n", CELLIAX_P_LOG);
return -1;
}
}
- //tech_pvt->interface_state = SKYPIAX_STATE_UP;
+ //tech_pvt->interface_state = CELLIAX_STATE_UP;
//tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE;
- DEBUGA_SKYPE("AT: call answered\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("AT: call answered\n", CELLIAX_P_LOG);
return 0;
}
@@ -1729,18 +1731,18 @@
{
int res;
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN) {
res = celliax_serial_write_AT_expect(tech_pvt, tech_pvt->at_hangup, tech_pvt->at_hangup_expect);
if (res) {
- DEBUGA_SKYPE("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n", SKYPIAX_P_LOG, tech_pvt->at_hangup);
+ DEBUGA_CELLIAX("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n", CELLIAX_P_LOG, tech_pvt->at_hangup);
res = celliax_serial_write_AT_ack(tech_pvt, "AT+CKPD=\"EEE\"");
if (res) {
- ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", SKYPIAX_P_LOG);
+ ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n", CELLIAX_P_LOG);
return -1;
}
}
}
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ tech_pvt->interface_state = CELLIAX_STATE_DOWN;
tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE;
return 0;
}
@@ -1769,25 +1771,25 @@
char at_command[256];
if (option_debug)
- DEBUGA_PBX("Dialing %s\n", SKYPIAX_P_LOG, dstr);
+ DEBUGA_PBX("Dialing %s\n", CELLIAX_P_LOG, dstr);
memset(at_command, 0, sizeof(at_command));
tech_pvt->phone_callflow = CALLFLOW_CALL_DIALING;
- tech_pvt->interface_state = SKYPIAX_STATE_DIALING;
+ tech_pvt->interface_state = CELLIAX_STATE_DIALING;
//ast_uri_decode(dstr);
/*
size_t fixdstr = strspn(dstr, AST_DIGIT_ANYDIG);
if (fixdstr == 0) {
ERRORA("dial command failed because of invalid dial number. dial string was: %s\n",
- SKYPIAX_P_LOG, dstr);
+ CELLIAX_P_LOG, dstr);
return -1;
}
*/
//dstr[fixdstr] = '\0';
sprintf(at_command, "%s%s%s", tech_pvt->at_dial_pre_number, dstr, tech_pvt->at_dial_post_number);
- DEBUGA_PBX("Dialstring %s\n", SKYPIAX_P_LOG, at_command);
+ DEBUGA_PBX("Dialstring %s\n", CELLIAX_P_LOG, at_command);
res = celliax_serial_write_AT_expect(tech_pvt, at_command, tech_pvt->at_dial_expect);
if (res) {
- ERRORA("dial command failed, dial string was: %s\n", SKYPIAX_P_LOG, at_command);
+ ERRORA("dial command failed, dial string was: %s\n", CELLIAX_P_LOG, at_command);
return -1;
}
// jet - early audio
@@ -1813,7 +1815,7 @@
memset(converted, '\0', sizeof(converted));
- DEBUGA_SKYPE("ucs2_in=%s\n", SKYPIAX_P_LOG, ucs2_in);
+ DEBUGA_CELLIAX("ucs2_in=%s\n", CELLIAX_P_LOG, ucs2_in);
/* cicopet */
for (c = 0; c < strlen(ucs2_in); c++) {
sprintf(stringa, "0x%c%c", ucs2_in[c], ucs2_in[c + 1]);
@@ -1828,21 +1830,21 @@
iconv_format = iconv_open("UTF8", "UCS-2BE");
if (iconv_format == (iconv_t) - 1) {
- ERRORA("error: %s\n", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno));
return -1;
}
inbytesleft = i;
iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
if (iconv_res == (size_t) -1) {
- DEBUGA_SKYPE("ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
- SKYPIAX_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out);
- DEBUGA_SKYPE("error: %s %d\n", SKYPIAX_P_LOG, strerror(errno), errno);
+ DEBUGA_CELLIAX("ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
+ CELLIAX_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out);
+ DEBUGA_CELLIAX("error: %s %d\n", CELLIAX_P_LOG, strerror(errno), errno);
return -1;
}
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
- SKYPIAX_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out);
+ CELLIAX_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out);
iconv_close(iconv_format);
return 0;
@@ -1867,32 +1869,32 @@
iconv_format = iconv_open("UCS-2BE", "UTF8");
if (iconv_format == (iconv_t) - 1) {
- ERRORA("error: %s\n", SKYPIAX_P_LOG, strerror(errno));
+ ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno));
return -1;
}
outbytesleft = 16000;
- DEBUGA_SKYPE("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n",
- SKYPIAX_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted);
+ DEBUGA_CELLIAX("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n",
+ CELLIAX_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted);
iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
if (iconv_res == (size_t) -1) {
- ERRORA("error: %s %d\n", SKYPIAX_P_LOG, strerror(errno), errno);
+ ERRORA("error: %s %d\n", CELLIAX_P_LOG, strerror(errno), errno);
return -1;
}
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n",
- SKYPIAX_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted);
+ CELLIAX_P_LOG, iconv_res, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf_in, converted);
iconv_close(iconv_format);
for (i = 0; i < 16000 - outbytesleft; i++) {
memset(stringa, '\0', sizeof(stringa));
memset(stringa2, '\0', sizeof(stringa2));
sprintf(stringa, "%02X", converted[i]);
- DEBUGA_SKYPE("character is |%02X|\n", SKYPIAX_P_LOG, converted[i]);
+ DEBUGA_CELLIAX("character is |%02X|\n", CELLIAX_P_LOG, converted[i]);
stringa2[0] = stringa[strlen(stringa) - 2];
stringa2[1] = stringa[strlen(stringa) - 1];
strncat(ucs2_out, stringa2, ((outbytesleft - strlen(ucs2_out)) - 1)); //add the received line to the buffer
- DEBUGA_SKYPE("stringa=%s, stringa2=%s, ucs2_out=%s\n", SKYPIAX_P_LOG, stringa, stringa2, ucs2_out);
+ DEBUGA_CELLIAX("stringa=%s, stringa2=%s, ucs2_out=%s\n", CELLIAX_P_LOG, stringa, stringa2, ucs2_out);
}
return 0;
}
@@ -1905,30 +1907,30 @@
int res;
if (option_debug) {
- DEBUGA_PBX("ENTERING FUNC\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("ENTERING FUNC\n", CELLIAX_P_LOG);
}
/* do something to actually answer the call, if needed (eg. pick up the phone) */
if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) {
if (celliax_serial_answer(tech_pvt)) {
- ERRORA("celliax_answer FAILED\n", SKYPIAX_P_LOG);
+ ERRORA("celliax_answer FAILED\n", CELLIAX_P_LOG);
if (option_debug) {
- DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG);
}
return -1;
}
}
- tech_pvt->interface_state = SKYPIAX_STATE_UP;
+ tech_pvt->interface_state = CELLIAX_STATE_UP;
tech_pvt->phone_callflow = CALLFLOW_CALL_ACTIVE;
- while (tech_pvt->interface_state == SKYPIAX_STATE_RING) {
+ while (tech_pvt->interface_state == CELLIAX_STATE_RING) {
usleep(10000); //10msec
}
- if (tech_pvt->interface_state != SKYPIAX_STATE_UP) {
- ERRORA("call answering failed\n", SKYPIAX_P_LOG);
+ if (tech_pvt->interface_state != CELLIAX_STATE_UP) {
+ ERRORA("call answering failed\n", CELLIAX_P_LOG);
res = -1;
} else {
if (option_debug)
- DEBUGA_PBX("call answered\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("call answered\n", CELLIAX_P_LOG);
res = 0;
#ifdef CELLIAX_PORTAUDIO
speex_echo_state_reset(tech_pvt->stream->echo_state);
@@ -1936,15 +1938,15 @@
new_inbound_channel(tech_pvt);
if (tech_pvt->owner) {
- DEBUGA_PBX("going to send SKYPIAX_STATE_UP\n", SKYPIAX_P_LOG);
- ast_setstate(tech_pvt->owner, SKYPIAX_STATE_UP);
- //ast_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_ANSWER);
- //celliax_queue_control(tech_pvt->owner, SKYPIAX_CONTROL_ANSWER);
- DEBUGA_PBX("just sent SKYPIAX_STATE_UP\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("going to send CELLIAX_STATE_UP\n", CELLIAX_P_LOG);
+ ast_setstate(tech_pvt->owner, CELLIAX_STATE_UP);
+ //ast_queue_control(tech_pvt->owner, CELLIAX_CONTROL_ANSWER);
+ //celliax_queue_control(tech_pvt->owner, CELLIAX_CONTROL_ANSWER);
+ DEBUGA_PBX("just sent CELLIAX_STATE_UP\n", CELLIAX_P_LOG);
}
}
if (option_debug) {
- DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG);
}
return res;
}
@@ -1957,54 +1959,54 @@
/* if there is not celliax pvt why we are here ? */
if (!tech_pvt) {
- ERRORA("Asked to hangup channel not connected\n", SKYPIAX_P_LOG);
+ ERRORA("Asked to hangup channel not connected\n", CELLIAX_P_LOG);
return 0;
}
- DEBUGA_SKYPE("ENTERING FUNC\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ENTERING FUNC\n", CELLIAX_P_LOG);
if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) {
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN) {
/* actually hangup through the serial port */
if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL) {
int res;
res = celliax_serial_hangup(tech_pvt);
if (res) {
- ERRORA("celliax_serial_hangup error: %d\n", SKYPIAX_P_LOG, res);
+ ERRORA("celliax_serial_hangup error: %d\n", CELLIAX_P_LOG, res);
if (option_debug) {
- DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG);
}
return -1;
}
}
- while (tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
+ while (tech_pvt->interface_state != CELLIAX_STATE_DOWN) {
usleep(10000); //10msec
}
- if (tech_pvt->interface_state != SKYPIAX_STATE_DOWN) {
- ERRORA("call hangup failed\n", SKYPIAX_P_LOG);
+ if (tech_pvt->interface_state != CELLIAX_STATE_DOWN) {
+ ERRORA("call hangup failed\n", CELLIAX_P_LOG);
return -1;
} else {
- DEBUGA_SKYPE("call hungup\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("call hungup\n", CELLIAX_P_LOG);
}
}
} else {
- tech_pvt->interface_state = SKYPIAX_STATE_DOWN;
+ tech_pvt->interface_state = CELLIAX_STATE_DOWN;
tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE;
}
switch_set_flag(tech_pvt, TFLAG_HANGUP);
if (option_debug) {
- DEBUGA_PBX("EXITING FUNC\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("EXITING FUNC\n", CELLIAX_P_LOG);
}
return 0;
}
-#define SKYPIAX_ALSA
-#ifdef SKYPIAX_ALSA
+#define CELLIAX_ALSA
+#ifdef CELLIAX_ALSA
/*! \brief ALSA pcm format, according to endianess */
#if __BYTE_ORDER == __LITTLE_ENDIAN
snd_pcm_format_t celliax_format = SND_PCM_FORMAT_S16_LE;
@@ -2024,18 +2026,18 @@
{
tech_pvt->alsac = alsa_open_dev(tech_pvt, SND_PCM_STREAM_CAPTURE);
if (!tech_pvt->alsac) {
- ERRORA("Failed opening ALSA capture device: %s\n", SKYPIAX_P_LOG, tech_pvt->alsacname);
+ ERRORA("Failed opening ALSA capture device: %s\n", CELLIAX_P_LOG, tech_pvt->alsacname);
if (alsa_shutdown(tech_pvt)) {
- ERRORA("alsa_shutdown failed\n", SKYPIAX_P_LOG);
+ ERRORA("alsa_shutdown failed\n", CELLIAX_P_LOG);
return -1;
}
return -1;
}
tech_pvt->alsap = alsa_open_dev(tech_pvt, SND_PCM_STREAM_PLAYBACK);
if (!tech_pvt->alsap) {
- ERRORA("Failed opening ALSA playback device: %s\n", SKYPIAX_P_LOG, tech_pvt->alsapname);
+ ERRORA("Failed opening ALSA playback device: %s\n", CELLIAX_P_LOG, tech_pvt->alsapname);
if (alsa_shutdown(tech_pvt)) {
- ERRORA("alsa_shutdown failed\n", SKYPIAX_P_LOG);
+ ERRORA("alsa_shutdown failed\n", CELLIAX_P_LOG);
return -1;
}
return -1;
@@ -2063,12 +2065,12 @@
if (tech_pvt->alsap) {
err = snd_pcm_drop(tech_pvt->alsap);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", SKYPIAX_P_LOG, tech_pvt->alsapname, snd_strerror(err));
+ ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", CELLIAX_P_LOG, tech_pvt->alsapname, snd_strerror(err));
return -1;
}
err = snd_pcm_close(tech_pvt->alsap);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", SKYPIAX_P_LOG, tech_pvt->alsapname, snd_strerror(err));
+ ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", CELLIAX_P_LOG, tech_pvt->alsapname, snd_strerror(err));
return -1;
}
tech_pvt->alsap = NULL;
@@ -2076,12 +2078,12 @@
if (tech_pvt->alsac) {
err = snd_pcm_drop(tech_pvt->alsac);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", SKYPIAX_P_LOG, tech_pvt->alsacname, snd_strerror(err));
+ ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", CELLIAX_P_LOG, tech_pvt->alsacname, snd_strerror(err));
return -1;
}
err = snd_pcm_close(tech_pvt->alsac);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", SKYPIAX_P_LOG, tech_pvt->alsacname, snd_strerror(err));
+ ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", CELLIAX_P_LOG, tech_pvt->alsacname, snd_strerror(err));
return -1;
}
tech_pvt->alsac = NULL;
@@ -2131,53 +2133,53 @@
if (err < 0) {
ERRORA
("snd_pcm_open failed with error '%s' on device '%s', if you are using a plughw:n device please change it to be a default:n device (so to allow it to be shared with other concurrent programs), or maybe you are using an ALSA voicemodem and slmodemd"
- " is running?\n", SKYPIAX_P_LOG, snd_strerror(err), stream == SND_PCM_STREAM_CAPTURE ? tech_pvt->alsacname : tech_pvt->alsapname);
+ " is running?\n", CELLIAX_P_LOG, snd_strerror(err), stream == SND_PCM_STREAM_CAPTURE ? tech_pvt->alsacname : tech_pvt->alsapname);
return NULL;
}
snd_pcm_info_alloca(&info);
if ((err = snd_pcm_info(handle, info)) < 0) {
- ERRORA("info error: %s", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("info error: %s", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_nonblock(handle, 1);
if (err < 0) {
- ERRORA("nonblock setting error: %s", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("nonblock setting error: %s", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_hw_params_any(handle, params);
if (err < 0) {
- ERRORA("Broken configuration for this PCM, no configurations available: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Broken configuration for this PCM, no configurations available: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_hw_params_set_access(handle, params, SND_PCM_ACCESS_RW_INTERLEAVED);
if (err < 0) {
- ERRORA("Access type not available: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Access type not available: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_hw_params_set_format(handle, params, celliax_format);
if (err < 0) {
- ERRORA("Sample format non available: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Sample format non available: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_hw_params_set_channels(handle, params, 1);
if (err < 0) {
- DEBUGA_SKYPE("Channels count set failed: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ DEBUGA_CELLIAX("Channels count set failed: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
#if 1
unsigned int chan_num;
err = snd_pcm_hw_params_get_channels(params, &chan_num);
if (err < 0) {
- ERRORA("Channels count non available: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Channels count non available: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
if (chan_num < 1 || chan_num > 2) {
- ERRORA("Channels count MUST BE 1 or 2, it is: %d\n", SKYPIAX_P_LOG, chan_num);
- ERRORA("Channels count MUST BE 1 or 2, it is: %d on %s %s\n", SKYPIAX_P_LOG, chan_num, tech_pvt->alsapname, tech_pvt->alsacname);
+ ERRORA("Channels count MUST BE 1 or 2, it is: %d\n", CELLIAX_P_LOG, chan_num);
+ ERRORA("Channels count MUST BE 1 or 2, it is: %d on %s %s\n", CELLIAX_P_LOG, chan_num, tech_pvt->alsapname, tech_pvt->alsacname);
return NULL;
} else {
if (chan_num == 1) {
@@ -2201,11 +2203,11 @@
rate = tech_pvt->celliax_sound_rate;
err = snd_pcm_hw_params_set_rate_near(handle, params, &rate, 0);
if ((float) tech_pvt->celliax_sound_rate * 1.05 < rate || (float) tech_pvt->celliax_sound_rate * 0.95 > rate) {
- WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", SKYPIAX_P_LOG, tech_pvt->celliax_sound_rate, rate);
+ WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", CELLIAX_P_LOG, tech_pvt->celliax_sound_rate, rate);
}
if (err < 0) {
- ERRORA("Error setting rate: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting rate: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
tech_pvt->celliax_sound_rate = rate;
@@ -2213,7 +2215,7 @@
err = snd_pcm_hw_params_set_period_size_near(handle, params, &period_size, 0);
if (err < 0) {
- ERRORA("Error setting period_size: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting period_size: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
@@ -2224,21 +2226,21 @@
err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &tech_pvt->alsa_buffer_size);
if (err < 0) {
- ERRORA("Error setting buffer_size: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting buffer_size: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
#endif
err = snd_pcm_hw_params(handle, params);
if (err < 0) {
- ERRORA("Unable to install hw params: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Unable to install hw params: %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
snd_pcm_hw_params_get_period_size(params, &chunk_size, 0);
snd_pcm_hw_params_get_buffer_size(params, &buffer_size);
if (chunk_size == buffer_size) {
- ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", SKYPIAX_P_LOG, chunk_size, buffer_size);
+ ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", CELLIAX_P_LOG, chunk_size, buffer_size);
return NULL;
}
@@ -2251,13 +2253,13 @@
0);
if (err < 0) {
- ERRORA("Error setting slep_min: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting slep_min: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
*/
n = chunk_size;
err = snd_pcm_sw_params_set_avail_min(handle, swparams, n);
if (err < 0) {
- ERRORA("Error setting avail_min: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting avail_min: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
if (stream == SND_PCM_STREAM_CAPTURE) {
start_delay = 1;
@@ -2273,7 +2275,7 @@
start_threshold = n;
err = snd_pcm_sw_params_set_start_threshold(handle, swparams, start_threshold);
if (err < 0) {
- ERRORA("Error setting start_threshold: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting start_threshold: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
if (stop_delay <= 0)
@@ -2288,30 +2290,30 @@
err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold);
if (err < 0) {
- ERRORA("Error setting stop_threshold: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting stop_threshold: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
if (snd_pcm_sw_params(handle, swparams) < 0) {
- ERRORA("Error installing software parameters: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error installing software parameters: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
err = snd_pcm_poll_descriptors_count(handle);
if (err <= 0) {
- ERRORA("Unable to get a poll descriptors count, error is %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("Unable to get a poll descriptors count, error is %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
if (err != 1) { //number of poll descriptors
- DEBUGA_SKYPE("Can't handle more than one device\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("Can't handle more than one device\n", CELLIAX_P_LOG);
return NULL;
}
err = snd_pcm_poll_descriptors(handle, &tech_pvt->pfd, err);
if (err != 1) {
- ERRORA("snd_pcm_poll_descriptors failed, %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_pcm_poll_descriptors failed, %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
- DEBUGA_SKYPE("Acquired fd %d from the poll descriptor\n", SKYPIAX_P_LOG, tech_pvt->pfd.fd);
+ DEBUGA_CELLIAX("Acquired fd %d from the poll descriptor\n", CELLIAX_P_LOG, tech_pvt->pfd.fd);
if (stream == SND_PCM_STREAM_CAPTURE) {
tech_pvt->celliax_sound_capt_fd = tech_pvt->pfd.fd;
@@ -2323,52 +2325,49 @@
if (state != SND_PCM_STATE_PREPARED) {
err = snd_pcm_prepare(handle);
if (err) {
- ERRORA("snd_pcm_prepare failed, %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_pcm_prepare failed, %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
- DEBUGA_SKYPE("prepared!\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("prepared!\n", CELLIAX_P_LOG);
}
if (stream == SND_PCM_STREAM_CAPTURE) {
err = snd_pcm_start(handle);
if (err) {
- ERRORA("snd_pcm_start failed, %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_pcm_start failed, %s\n", CELLIAX_P_LOG, snd_strerror(err));
return NULL;
}
- DEBUGA_SKYPE("started!\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("started!\n", CELLIAX_P_LOG);
}
}
if (option_debug > 1) {
snd_output_t *output = NULL;
err = snd_output_stdio_attach(&output, stdout, 0);
if (err < 0) {
- ERRORA("snd_output_stdio_attach failed: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_output_stdio_attach failed: %s\n", CELLIAX_P_LOG, snd_strerror(err));
}
snd_pcm_dump(handle, output);
}
if (option_debug > 1)
- DEBUGA_SKYPE("ALSA handle = %ld\n", SKYPIAX_P_LOG, (long int) handle);
+ DEBUGA_CELLIAX("ALSA handle = %ld\n", CELLIAX_P_LOG, (long int) handle);
return handle;
}
/*! \brief Write audio frames to interface */
-#endif /* SKYPIAX_ALSA */
+#endif /* CELLIAX_ALSA */
int celliax_call(private_t * tech_pvt, char *rdest, int timeout)
{
- //char msg_to_skype[1024];
//celliax_sleep(5000);
- DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest);
+ DEBUGA_CELLIAX("Calling GSM, rdest is: %s\n", CELLIAX_P_LOG, rdest);
//celliax_signaling_write(tech_pvt, "SET AGC OFF");
//celliax_sleep(10000);
//celliax_signaling_write(tech_pvt, "SET AEC OFF");
//celliax_sleep(10000);
celliax_serial_call(tech_pvt, rdest);
- //sprintf(msg_to_skype, "CALL %s", rdest);
- //if (celliax_signaling_write(tech_pvt, msg_to_skype) < 0) {
- //ERRORA("failed to communicate with Skype client, now exit\n", SKYPIAX_P_LOG);
+ //ERRORA("failed to communicate with GSM client, now exit\n", CELLIAX_P_LOG);
//return -1;
//}
return 0;
@@ -2378,8 +2377,7 @@
int celliax_senddigit(private_t * tech_pvt, char digit)
{
- DEBUGA_SKYPE("DIGIT received: %c\n", SKYPIAX_P_LOG, digit);
- //celliax_signaling_write(tech_pvt, msg_to_skype);
+ DEBUGA_CELLIAX("DIGIT received: %c\n", CELLIAX_P_LOG, digit);
if (tech_pvt->controldevprotocol == PROTOCOL_AT && tech_pvt->at_send_dtmf[0]) {
int res = 0;
char at_command[256];
@@ -2388,7 +2386,7 @@
sprintf(at_command, "%s=\"%c\"", tech_pvt->at_send_dtmf, digit);
res = celliax_serial_write_AT_ack(tech_pvt, at_command);
if (res) {
- ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", SKYPIAX_P_LOG, tech_pvt->at_send_dtmf, digit);
+ ERRORA("senddigit command failed, command used: '%s=\"%c\"', giving up\n", CELLIAX_P_LOG, tech_pvt->at_send_dtmf, digit);
}
}
@@ -2411,10 +2409,10 @@
snd_pcm_sframes_t delayp1;
snd_pcm_sframes_t delayp2;
- //ERRORA("data=%p, datalen=%d\n", SKYPIAX_P_LOG, (void *)data, datalen);
+ //ERRORA("data=%p, datalen=%d\n", CELLIAX_P_LOG, (void *)data, datalen);
/* We have to digest the frame in 160-byte portions */
if (datalen > sizeof(sizbuf) - sizpos) {
- ERRORA("Frame too large\n", SKYPIAX_P_LOG);
+ ERRORA("Frame too large\n", CELLIAX_P_LOG);
res = -1;
} else {
memcpy(sizbuf + sizpos, data, datalen);
@@ -2427,25 +2425,25 @@
if (state == SND_PCM_STATE_XRUN) {
int i;
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("You've got an ALSA write XRUN in the past (celliax can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file\n",
- SKYPIAX_P_LOG, tech_pvt->alsa_periods_in_buffer);
+ CELLIAX_P_LOG, tech_pvt->alsa_periods_in_buffer);
res = snd_pcm_prepare(tech_pvt->alsap);
if (res) {
- ERRORA("audio play prepare failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
} else {
res = snd_pcm_format_set_silence(celliax_format, silencebuf, len / 2);
if (res < 0) {
- DEBUGA_SKYPE("Silence error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ DEBUGA_CELLIAX("Silence error %s\n", CELLIAX_P_LOG, snd_strerror(res));
res = -1;
}
for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) {
res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2);
if (res != len / 2) {
- DEBUGA_SKYPE("Write returned a different quantity: %d\n", SKYPIAX_P_LOG, res);
+ DEBUGA_CELLIAX("Write returned a different quantity: %d\n", CELLIAX_P_LOG, res);
res = -1;
} else if (res < 0) {
- DEBUGA_SKYPE("Write error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ DEBUGA_CELLIAX("Write error %s\n", CELLIAX_P_LOG, snd_strerror(res));
res = -1;
}
}
@@ -2455,21 +2453,21 @@
res = snd_pcm_delay(tech_pvt->alsap, &delayp1);
if (res < 0) {
- DEBUGA_SKYPE("Error %d on snd_pcm_delay: \"%s\"\n", SKYPIAX_P_LOG, res, snd_strerror(res));
+ DEBUGA_CELLIAX("Error %d on snd_pcm_delay: \"%s\"\n", CELLIAX_P_LOG, res, snd_strerror(res));
res = snd_pcm_prepare(tech_pvt->alsap);
if (res) {
- DEBUGA_SKYPE("snd_pcm_prepare failed: '%s'\n", SKYPIAX_P_LOG, snd_strerror(res));
+ DEBUGA_CELLIAX("snd_pcm_prepare failed: '%s'\n", CELLIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_delay(tech_pvt->alsap, &delayp1);
}
delayp2 = snd_pcm_avail_update(tech_pvt->alsap);
if (delayp2 < 0) {
- DEBUGA_SKYPE("Error %d on snd_pcm_avail_update: \"%s\"\n", SKYPIAX_P_LOG, (int) delayp2, snd_strerror(delayp2));
+ DEBUGA_CELLIAX("Error %d on snd_pcm_avail_update: \"%s\"\n", CELLIAX_P_LOG, (int) delayp2, snd_strerror(delayp2));
res = snd_pcm_prepare(tech_pvt->alsap);
if (res) {
- DEBUGA_SKYPE("snd_pcm_prepare failed: '%s'\n", SKYPIAX_P_LOG, snd_strerror(res));
+ DEBUGA_CELLIAX("snd_pcm_prepare failed: '%s'\n", CELLIAX_P_LOG, snd_strerror(res));
}
delayp2 = snd_pcm_avail_update(tech_pvt->alsap);
}
@@ -2479,31 +2477,31 @@
res = snd_pcm_prepare(tech_pvt->alsap);
if (res) {
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("snd_pcm_prepare failed while trying to prevent an ALSA write XRUN: %s, delayp1=%d, delayp2=%d\n",
- SKYPIAX_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2);
+ CELLIAX_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2);
} else {
int i;
for (i = 0; i < (tech_pvt->alsa_periods_in_buffer - 1); i++) {
res = snd_pcm_format_set_silence(celliax_format, silencebuf, len / 2);
if (res < 0) {
- DEBUGA_SKYPE("Silence error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ DEBUGA_CELLIAX("Silence error %s\n", CELLIAX_P_LOG, snd_strerror(res));
res = -1;
}
res = snd_pcm_writei(tech_pvt->alsap, silencebuf, len / 2);
if (res < 0) {
- DEBUGA_SKYPE("Write error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ DEBUGA_CELLIAX("Write error %s\n", CELLIAX_P_LOG, snd_strerror(res));
res = -1;
} else if (res != len / 2) {
- DEBUGA_SKYPE("Write returned a different quantity: %d\n", SKYPIAX_P_LOG, res);
+ DEBUGA_CELLIAX("Write returned a different quantity: %d\n", CELLIAX_P_LOG, res);
res = -1;
}
}
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("PREVENTING an ALSA write XRUN (celliax can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n",
- SKYPIAX_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
+ CELLIAX_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
}
}
@@ -2531,12 +2529,12 @@
res = snd_pcm_writei(tech_pvt->alsap, sizbuf2, len);
}
if (res == -EPIPE) {
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("ALSA write EPIPE (XRUN) (celliax can't fill the soundcard buffer fast enough). If this happens often (not after silence or after a pause in the speech, that's OK), and appear to damage the sound quality, first check if you have some IRQ problem, maybe sharing the soundcard IRQ with a broken or heavy loaded ethernet or graphic card. Then consider to increase the alsa_periods_in_buffer (now is set to %d) for this interface in the config file. delayp1=%d, delayp2=%d\n",
- SKYPIAX_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
+ CELLIAX_P_LOG, tech_pvt->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
res = snd_pcm_prepare(tech_pvt->alsap);
if (res) {
- ERRORA("audio play prepare failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
} else {
if (tech_pvt->alsa_play_is_mono) {
@@ -2565,11 +2563,11 @@
} else {
if (res == -ESTRPIPE) {
- ERRORA("You've got some big problems\n", SKYPIAX_P_LOG);
+ ERRORA("You've got some big problems\n", CELLIAX_P_LOG);
} else if (res == -EAGAIN) {
res = 0;
} else if (res < 0) {
- ERRORA("Error %d on audio write: \"%s\"\n", SKYPIAX_P_LOG, res, snd_strerror(res));
+ ERRORA("Error %d on audio write: \"%s\"\n", CELLIAX_P_LOG, res, snd_strerror(res));
}
}
}
@@ -2578,22 +2576,22 @@
time(&now_timestamp);
if ((now_timestamp - tech_pvt->audio_play_reset_timestamp) > tech_pvt->audio_play_reset_period) {
if (option_debug)
- DEBUGA_SKYPE("reset audio play\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("reset audio play\n", CELLIAX_P_LOG);
res = snd_pcm_wait(tech_pvt->alsap, 1000);
if (res < 0) {
- ERRORA("audio play wait failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play wait failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_drop(tech_pvt->alsap);
if (res) {
- ERRORA("audio play drop failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play drop failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_prepare(tech_pvt->alsap);
if (res) {
- ERRORA("audio play prepare failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_wait(tech_pvt->alsap, 1000);
if (res < 0) {
- ERRORA("audio play wait failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play wait failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
}
time(&tech_pvt->audio_play_reset_timestamp);
}
@@ -2608,12 +2606,12 @@
int alsa_read(private_t * tech_pvt, short *data, int datalen)
{
//static struct ast_frame f;
- static short __buf[SKYPIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2];
- static short __buf2[(SKYPIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2];
+ static short __buf[CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2];
+ static short __buf2[(CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2];
short *buf;
short *buf2;
static int readpos = 0;
- //static int left = SKYPIAX_FRAME_SIZE;
+ //static int left = CELLIAX_FRAME_SIZE;
static int left;
snd_pcm_state_t state;
int r = 0;
@@ -2621,7 +2619,7 @@
int error = 0;
//time_t now_timestamp;
- //DEBUGA_SKYPE("buf=%p, datalen=%d, left=%d\n", SKYPIAX_P_LOG, (void *)buf, datalen, left);
+ //DEBUGA_CELLIAX("buf=%p, datalen=%d, left=%d\n", CELLIAX_P_LOG, (void *)buf, datalen, left);
//memset(&f, 0, sizeof(struct ast_frame)); //giova
@@ -2632,23 +2630,23 @@
state = snd_pcm_state(tech_pvt->alsac);
if (state != SND_PCM_STATE_RUNNING) {
- DEBUGA_SKYPE("ALSA read state is not SND_PCM_STATE_RUNNING\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ALSA read state is not SND_PCM_STATE_RUNNING\n", CELLIAX_P_LOG);
if (state != SND_PCM_STATE_PREPARED) {
error = snd_pcm_prepare(tech_pvt->alsac);
if (error) {
- ERRORA("snd_pcm_prepare failed, %s\n", SKYPIAX_P_LOG, snd_strerror(error));
+ ERRORA("snd_pcm_prepare failed, %s\n", CELLIAX_P_LOG, snd_strerror(error));
return r;
}
- DEBUGA_SKYPE("prepared!\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("prepared!\n", CELLIAX_P_LOG);
}
usleep(1000);
error = snd_pcm_start(tech_pvt->alsac);
if (error) {
- ERRORA("snd_pcm_start failed, %s\n", SKYPIAX_P_LOG, snd_strerror(error));
+ ERRORA("snd_pcm_start failed, %s\n", CELLIAX_P_LOG, snd_strerror(error));
return r;
}
- DEBUGA_SKYPE("started!\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("started!\n", CELLIAX_P_LOG);
usleep(1000);
}
@@ -2657,13 +2655,13 @@
if (tech_pvt->alsa_capture_is_mono) {
r = snd_pcm_readi(tech_pvt->alsac, buf + readpos, left);
- //DEBUGA_SKYPE("r=%d, buf=%p, buf+readpos=%p, datalen=%d, left=%d\n", SKYPIAX_P_LOG, r, (void *)buf, (void *)(buf + readpos), datalen, left);
+ //DEBUGA_CELLIAX("r=%d, buf=%p, buf+readpos=%p, datalen=%d, left=%d\n", CELLIAX_P_LOG, r, (void *)buf, (void *)(buf + readpos), datalen, left);
} else {
r = snd_pcm_readi(tech_pvt->alsac, buf2 + (readpos * 2), left);
int a = 0;
int i = 0;
- for (i = 0; i < (SKYPIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) {
+ for (i = 0; i < (CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) {
__buf[a] = (__buf2[i] + __buf2[i + 1]) / 2; //comment out this line to use only left
//__buf[a] = __buf2[i]; // enable this line to use only left
a++;
@@ -2673,14 +2671,14 @@
}
if (r == -EPIPE) {
- DEBUGA_SKYPE("ALSA XRUN on read\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ALSA XRUN on read\n", CELLIAX_P_LOG);
return r;
} else if (r == -ESTRPIPE) {
- ERRORA("-ESTRPIPE\n", SKYPIAX_P_LOG);
+ ERRORA("-ESTRPIPE\n", CELLIAX_P_LOG);
return r;
} else if (r == -EAGAIN) {
- DEBUGA_SKYPE("ALSA read -EAGAIN, the soundcard is not ready to be read by celliax\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ALSA read -EAGAIN, the soundcard is not ready to be read by celliax\n", CELLIAX_P_LOG);
while (r == -EAGAIN) {
usleep(1000);
@@ -2691,7 +2689,7 @@
int a = 0;
int i = 0;
- for (i = 0; i < (SKYPIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) {
+ for (i = 0; i < (CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2) * 2;) {
__buf[a] = (__buf2[i] + __buf2[i + 1]) / 2;
a++;
i++;
@@ -2701,19 +2699,19 @@
}
} else if (r < 0) {
- WARNINGA("ALSA Read error: %s\n", SKYPIAX_P_LOG, snd_strerror(r));
+ WARNINGA("ALSA Read error: %s\n", CELLIAX_P_LOG, snd_strerror(r));
} else if (r >= 0) {
- //DEBUGA_SKYPE("read: r=%d, readpos=%d, left=%d, off=%d\n", SKYPIAX_P_LOG, r, readpos, left, off);
+ //DEBUGA_CELLIAX("read: r=%d, readpos=%d, left=%d, off=%d\n", CELLIAX_P_LOG, r, readpos, left, off);
off -= r; //what is the meaning of this? a leftover, probably
}
/* Update positions */
readpos += r;
left -= r;
- if (readpos >= SKYPIAX_FRAME_SIZE) {
+ if (readpos >= CELLIAX_FRAME_SIZE) {
/* A real frame */
readpos = 0;
- left = SKYPIAX_FRAME_SIZE;
+ left = CELLIAX_FRAME_SIZE;
int i;
for (i = 0; i < r; i++)
data[i] = buf[i];
@@ -2740,14 +2738,14 @@
int failed = 0;
//strncpy(rdest, idest, sizeof(rdest) - 1);
- DEBUGA_SKYPE("CelliaxSendsms: dest=%s text=%s\n", SKYPIAX_P_LOG, dest, text);
- DEBUGA_SKYPE("START\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("CelliaxSendsms: dest=%s text=%s\n", CELLIAX_P_LOG, dest, text);
+ DEBUGA_CELLIAX("START\n", CELLIAX_P_LOG);
/* we can use celliax_request to get the channel, but celliax_request would look for onowned channels, and probably we can send SMSs while a call is ongoing
*
*/
if (tech_pvt->controldevprotocol != PROTOCOL_AT) {
- ERRORA(", SKYPIAX_P_LOGCelliaxSendsms supports only AT command cellphones at the moment :-( !\n", SKYPIAX_P_LOG);
+ ERRORA(", CELLIAX_P_LOGCelliaxSendsms supports only AT command cellphones at the moment :-( !\n", CELLIAX_P_LOG);
return RESULT_FAILURE;
}
@@ -2766,7 +2764,7 @@
err = celliax_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"UCS2\"");
if (err) {
- ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", SKYPIAX_P_LOG);
+ ERRORA("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n", CELLIAX_P_LOG);
}
memset(dest2, '\0', sizeof(dest2));
@@ -2777,32 +2775,32 @@
//TODO would be better to lock controldev here
err = celliax_serial_write_AT_noack(tech_pvt, smscommand);
if (err) {
- ERRORA("Error sending SMS\n", SKYPIAX_P_LOG);
+ ERRORA("Error sending SMS\n", CELLIAX_P_LOG);
failed = 1;
goto uscita;
}
err = celliax_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf
#if 1
if (err) {
- DEBUGA_SKYPE
+ DEBUGA_CELLIAX
("Error or timeout getting prompt '> ' for sending sms directly to the remote party. BTW, seems that we cannot do that with Motorola c350, so we'll write to cellphone memory, then send from memory\n",
- SKYPIAX_P_LOG);
+ CELLIAX_P_LOG);
err = celliax_serial_write_AT_ack(tech_pvt, "ATE1"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!!
if (err) {
- ERRORA("Error activating echo from modem\n", SKYPIAX_P_LOG);
+ ERRORA("Error activating echo from modem\n", CELLIAX_P_LOG);
}
tech_pvt->at_cmgw[0] = '\0';
sprintf(smscommand, "AT+CMGW=\"%s\"", dest); //TODO: support phones that only accept pdu mode
err = celliax_serial_write_AT_noack(tech_pvt, smscommand);
if (err) {
- ERRORA("Error writing SMS destination to the cellphone memory\n", SKYPIAX_P_LOG);
+ ERRORA("Error writing SMS destination to the cellphone memory\n", CELLIAX_P_LOG);
failed = 1;
goto uscita;
}
err = celliax_serial_AT_expect(tech_pvt, "> ", 0, 1); // wait 1.5s for the prompt, no crlf
if (err) {
- ERRORA("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n", SKYPIAX_P_LOG);
+ ERRORA("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n", CELLIAX_P_LOG);
failed = 1;
goto uscita;
}
@@ -2818,12 +2816,12 @@
}
smscommand[strlen(smscommand)] = 0x1A;
- DEBUGA_SKYPE("smscommand len is: %d, text is:|||%s|||\n", SKYPIAX_P_LOG, strlen(smscommand), smscommand);
+ DEBUGA_CELLIAX("smscommand len is: %d, text is:|||%s|||\n", CELLIAX_P_LOG, strlen(smscommand), smscommand);
err = celliax_serial_write_AT_ack_nocr_longtime(tech_pvt, smscommand);
//TODO would be better to unlock controldev here
if (err) {
- ERRORA("Error writing SMS text to the cellphone memory\n", SKYPIAX_P_LOG);
+ ERRORA("Error writing SMS text to the cellphone memory\n", CELLIAX_P_LOG);
//return RESULT_FAILURE;
failed = 1;
goto uscita;
@@ -2832,7 +2830,7 @@
sprintf(smscommand, "AT+CMSS=%s", tech_pvt->at_cmgw);
err = celliax_serial_write_AT_expect_longtime(tech_pvt, smscommand, "OK");
if (err) {
- ERRORA("Error sending SMS from the cellphone memory\n", SKYPIAX_P_LOG);
+ ERRORA("Error sending SMS from the cellphone memory\n", CELLIAX_P_LOG);
//return RESULT_FAILURE;
failed = 1;
goto uscita;
@@ -2840,7 +2838,7 @@
err = celliax_serial_write_AT_ack(tech_pvt, "ATE0"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!!
if (err) {
- ERRORA("Error de-activating echo from modem\n", SKYPIAX_P_LOG);
+ ERRORA("Error de-activating echo from modem\n", CELLIAX_P_LOG);
}
}
uscita:
@@ -2852,14 +2850,14 @@
sprintf(smscommand, "AT+CMGR=%s", tech_pvt->at_cmgw);
err = celliax_serial_write_AT_ack(tech_pvt, smscommand);
if (err) {
- ERRORA("Error reading SMS back from the cellphone memory\n", SKYPIAX_P_LOG);
+ ERRORA("Error reading SMS back from the cellphone memory\n", CELLIAX_P_LOG);
}
/* let's delete from cellphone memory what we've sent */
sprintf(smscommand, "AT+CMGD=%s", tech_pvt->at_cmgw);
err = celliax_serial_write_AT_ack(tech_pvt, smscommand);
if (err) {
- ERRORA("Error deleting SMS from the cellphone memory\n", SKYPIAX_P_LOG);
+ ERRORA("Error deleting SMS from the cellphone memory\n", CELLIAX_P_LOG);
}
tech_pvt->at_cmgw[0] = '\0';
@@ -2869,7 +2867,7 @@
POPPA_UNLOCKA(&tech_pvt->controldev_lock);
}
- DEBUGA_SKYPE("FINISH\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("FINISH\n", CELLIAX_P_LOG);
if (failed)
return -1;
else
@@ -2893,19 +2891,19 @@
private_t *tech_pvt = NULL;
if (sscanf(s, "%lf", boost) != 1) {
- ERRORA("invalid boost <%s>\n", SKYPIAX_P_LOG, s);
+ ERRORA("invalid boost <%s>\n", CELLIAX_P_LOG, s);
return;
}
if (*boost < -BOOST_MAX) {
- WARNINGA("boost %s too small, using %d\n", SKYPIAX_P_LOG, s, -BOOST_MAX);
+ WARNINGA("boost %s too small, using %d\n", CELLIAX_P_LOG, s, -BOOST_MAX);
*boost = -BOOST_MAX;
} else if (*boost > BOOST_MAX) {
- WARNINGA("boost %s too large, using %d\n", SKYPIAX_P_LOG, s, BOOST_MAX);
+ WARNINGA("boost %s too large, using %d\n", CELLIAX_P_LOG, s, BOOST_MAX);
*boost = BOOST_MAX;
}
*boost = exp(log(10) * *boost / 20) * BOOST_SCALE;
if (option_debug > 1)
- DEBUGA_SKYPE("setting boost %s to %f\n", SKYPIAX_P_LOG, s, *boost);
+ DEBUGA_CELLIAX("setting boost %s to %f\n", CELLIAX_P_LOG, s, *boost);
}
Modified: freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c (14721 => 14722)
--- freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c 2009-09-01 19:49:14 UTC (rev 14721)
+++ freeswitch/branches/gmaruzz/mod_celliax/mod_celliax.c 2009-09-01 20:14:09 UTC (rev 14722)
@@ -30,7 +30,7 @@
*
*
*
- * mod_celliax.c -- Skype compatible Endpoint Module
+ * mod_celliax.c -- GSM compatible Endpoint Module
*
*/
@@ -86,10 +86,10 @@
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"
+#define SK_SYNTAX "list [full] || console || celliax_API_msg || remove < celliaxusername | #interface_name | #interface_id > || reload"
/* END: Changes heres */
SWITCH_STANDARD_API(celliax_function);
-#define SKYPIAX_SYNTAX "interface_name skype_API_msg"
+#define CELLIAX_SYNTAX "interface_name celliax_API_msg"
SWITCH_STANDARD_API(sendsms_function);
#define SENDSMS_SYNTAX "sendsms interface_name destination_number SMS_text"
@@ -98,7 +98,7 @@
#define SOFT_RELOAD 1
/* END: Changes heres */
-char *interface_status[] = { /* should match SKYPIAX_STATE_xxx in celliax.h */
+char *interface_status[] = { /* should match CELLIAX_STATE_xxx in celliax.h */
"IDLE",
"DOWN",
"RING",
@@ -112,7 +112,7 @@
"HANG_RQ",
"PREANSW"
};
-char *skype_callflow[] = { /* should match CALLFLOW_XXX in celliax.h */
+char *phone_callflow[] = { /* should match CALLFLOW_XXX in celliax.h */
"CALL_IDLE",
"CALL_DOWN",
"INCOMING_RNG",
@@ -162,7 +162,7 @@
int real_interfaces;
int next_interface;
char hold_music[256];
- private_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES];
+ private_t CELLIAX_INTERFACES[CELLIAX_MAX_INTERFACES];
switch_mutex_t *mutex;
private_t *sk_console;
} globals;
@@ -205,14 +205,14 @@
if (switch_core_codec_init
(&tech_pvt->read_codec, "L16", NULL, sample_rate, codec_ms, 1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
- ERRORA("Can't load codec?\n", SKYPIAX_P_LOG);
+ ERRORA("Can't load codec?\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
if (switch_core_codec_init
(&tech_pvt->write_codec, "L16", NULL, sample_rate, codec_ms, 1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) {
- ERRORA("Can't load codec?\n", SKYPIAX_P_LOG);
+ ERRORA("Can't load codec?\n", CELLIAX_P_LOG);
switch_core_codec_destroy(&tech_pvt->read_codec);
return SWITCH_STATUS_FALSE;
}
@@ -227,7 +227,7 @@
switch_core_session_set_write_codec(session, &tech_pvt->write_codec);
switch_core_session_rwunlock(session);
} else {
- ERRORA("no session\n", SKYPIAX_P_LOG);
+ ERRORA("no session\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
@@ -247,24 +247,24 @@
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)) {
- ERRORA("no tech_pvt->session_uuid_str\n", SKYPIAX_P_LOG);
+ ERRORA("no tech_pvt->session_uuid_str\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
- if (celliax_codec(tech_pvt, SAMPLERATE_SKYPIAX, 20) != SWITCH_STATUS_SUCCESS) {
- ERRORA("celliax_codec FAILED\n", SKYPIAX_P_LOG);
+ if (celliax_codec(tech_pvt, SAMPLERATE_CELLIAX, 20) != SWITCH_STATUS_SUCCESS) {
+ ERRORA("celliax_codec FAILED\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
//teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, tech_pvt->read_codec.implementation->actual_samples_per_second);
teletone_dtmf_detect_init(&tech_pvt->dtmf_detect, 8000);
if (alsa_init(tech_pvt)) {
- ERRORA("alsa_init failed\n", SKYPIAX_P_LOG);
+ ERRORA("alsa_init failed\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, tech_pvt->read_codec.implementation->samples_per_packet, celliax_module_pool) !=
SWITCH_STATUS_SUCCESS) {
- ERRORA("setup timer failed\n", SKYPIAX_P_LOG);
+ ERRORA("setup timer failed\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
@@ -272,7 +272,7 @@
if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, tech_pvt->write_codec.implementation->samples_per_packet, celliax_module_pool) !=
SWITCH_STATUS_SUCCESS) {
- ERRORA("setup timer failed\n", SKYPIAX_P_LOG);
+ ERRORA("setup timer failed\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
@@ -280,7 +280,7 @@
switch_clear_flag(tech_pvt, TFLAG_HANGUP);
- DEBUGA_SKYPE("celliax_codec SUCCESS\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("celliax_codec SUCCESS\n", CELLIAX_P_LOG);
return SWITCH_STATUS_SUCCESS;
}
@@ -297,24 +297,24 @@
/* take a number as interface id */
if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) {
- if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) {
+ if (strlen(globals.CELLIAX_INTERFACES[interface_id].name)) {
return SWITCH_STATUS_SUCCESS;
}
} else {
/* interface name */
- for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
- if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) {
+ for (interface_id = 0; interface_id < CELLIAX_MAX_INTERFACES; interface_id++) {
+ if (strcmp(globals.CELLIAX_INTERFACES[interface_id].name, the_interface) == 0) {
return SWITCH_STATUS_SUCCESS;
break;
}
}
}
- } else { /* look by skype_user */
+ } else { /* look by celliax_user */
- for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
- if (strlen(globals.SKYPIAX_INTERFACES[i].skype_user)) {
- if (strcmp(globals.SKYPIAX_INTERFACES[i].skype_user, the_interface) == 0) {
+ for (i = 0; i < CELLIAX_MAX_INTERFACES; i++) {
+ if (strlen(globals.CELLIAX_INTERFACES[i].celliax_user)) {
+ if (strcmp(globals.CELLIAX_INTERFACES[i].celliax_user, the_interface) == 0) {
return SWITCH_STATUS_SUCCESS;
}
}
@@ -341,63 +341,63 @@
if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) {
/* take a number as interface id */
- tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
+ tech_pvt = &globals.CELLIAX_INTERFACES[interface_id];
} else {
- for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
- if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) {
- tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
+ for (interface_id = 0; interface_id < CELLIAX_MAX_INTERFACES; interface_id++) {
+ if (strcmp(globals.CELLIAX_INTERFACES[interface_id].name, the_interface) == 0) {
+ tech_pvt = &globals.CELLIAX_INTERFACES[interface_id];
break;
}
}
}
- } else { /* remove by skype_user */
- for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
- if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].skype_user, the_interface) == 0) {
- tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
+ } else { /* remove by celliax_user */
+ for (interface_id = 0; interface_id < CELLIAX_MAX_INTERFACES; interface_id++) {
+ if (strcmp(globals.CELLIAX_INTERFACES[interface_id].celliax_user, the_interface) == 0) {
+ tech_pvt = &globals.CELLIAX_INTERFACES[interface_id];
break;
}
}
}
if (!tech_pvt) {
- DEBUGA_SKYPE("interface '%s' does not exist\n", SKYPIAX_P_LOG, the_interface);
+ DEBUGA_CELLIAX("interface '%s' does not exist\n", CELLIAX_P_LOG, the_interface);
goto end;
}
- if (strlen(globals.SKYPIAX_INTERFACES[interface_id].session_uuid_str)) {
- DEBUGA_SKYPE("interface '%s' is busy\n", SKYPIAX_P_LOG, the_interface);
+ if (strlen(globals.CELLIAX_INTERFACES[interface_id].session_uuid_str)) {
+ DEBUGA_CELLIAX("interface '%s' is busy\n", CELLIAX_P_LOG, the_interface);
goto end;
}
- globals.SKYPIAX_INTERFACES[interface_id].running = 0;
+ globals.CELLIAX_INTERFACES[interface_id].running = 0;
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_signaling_thread) {
#ifdef WIN32
- switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
+ switch_file_write(tech_pvt->CelliaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
#else /* WIN32 */
- howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", howmany);
+ howmany = write(tech_pvt->CelliaxHandles.fdesc[1], "sciutati", howmany);
#endif /* WIN32 */
}
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread) {
#ifdef WIN32
- 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].celliax_api_thread = NULL;
+ if (SendMessage(tech_pvt->CelliaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the celliax_api_thread_func die
+ DEBUGA_CELLIAX("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", CELLIAX_P_LOG, GetLastError());
+ globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread = NULL;
}
#else
XEvent e;
- Atom atom1 = XInternAtom(tech_pvt->SkypiaxHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False);
+ Atom atom1 = XInternAtom(tech_pvt->CelliaxHandles.disp, "CELLIAXCONTROLAPI_MESSAGE_BEGIN", False);
memset(&e, 0, sizeof(e));
e.xclient.type = ClientMessage;
e.xclient.message_type = atom1; /* leading message */
- e.xclient.display = tech_pvt->SkypiaxHandles.disp;
- e.xclient.window = tech_pvt->SkypiaxHandles.skype_win;
+ e.xclient.display = tech_pvt->CelliaxHandles.disp;
+ e.xclient.window = tech_pvt->CelliaxHandles.celliax_win;
e.xclient.format = 8;
- XSendEvent(tech_pvt->SkypiaxHandles.disp, tech_pvt->SkypiaxHandles.win, False, 0, &e);
- XSync(tech_pvt->SkypiaxHandles.disp, False);
+ XSendEvent(tech_pvt->CelliaxHandles.disp, tech_pvt->CelliaxHandles.win, False, 0, &e);
+ XSync(tech_pvt->CelliaxHandles.disp, False);
#endif
}
@@ -406,27 +406,27 @@
switch_yield(50000);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread);
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_signaling_thread) {
+ switch_thread_join(&status, globals.CELLIAX_INTERFACES[interface_id].celliax_signaling_thread);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread);
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread) {
+ switch_thread_join(&status, globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread);
}
switch_mutex_lock(globals.mutex);
- if (globals.sk_console == &globals.SKYPIAX_INTERFACES[interface_id]) {
- DEBUGA_SKYPE("interface '%s' no more console\n", SKYPIAX_P_LOG, the_interface);
+ if (globals.sk_console == &globals.CELLIAX_INTERFACES[interface_id]) {
+ DEBUGA_CELLIAX("interface '%s' no more console\n", CELLIAX_P_LOG, the_interface);
globals.sk_console = NULL;
} else {
- DEBUGA_SKYPE("interface '%s' STILL console\n", SKYPIAX_P_LOG, the_interface);
+ DEBUGA_CELLIAX("interface '%s' STILL console\n", CELLIAX_P_LOG, the_interface);
}
- memset(&globals.SKYPIAX_INTERFACES[interface_id], '\0', sizeof(private_t));
+ memset(&globals.CELLIAX_INTERFACES[interface_id], '\0', sizeof(private_t));
globals.real_interfaces--;
switch_mutex_unlock(globals.mutex);
- DEBUGA_SKYPE("interface '%s' deleted successfully\n", SKYPIAX_P_LOG, the_interface);
- globals.SKYPIAX_INTERFACES[interface_id].running = 1;
+ DEBUGA_CELLIAX("interface '%s' deleted successfully\n", CELLIAX_P_LOG, the_interface);
+ globals.CELLIAX_INTERFACES[interface_id].running = 1;
end:
//running = 1;
return SWITCH_STATUS_SUCCESS;
@@ -449,7 +449,7 @@
channel = switch_core_session_get_channel(session);
switch_assert(channel != NULL);
- //ERRORA("%s CHANNEL INIT\n", SKYPIAX_P_LOG, tech_pvt->name);
+ //ERRORA("%s CHANNEL INIT\n", CELLIAX_P_LOG, tech_pvt->name);
switch_set_flag(tech_pvt, TFLAG_IO);
/* Move channel's state machine to ROUTING. This means the call is trying
@@ -461,7 +461,7 @@
globals.calls++;
switch_mutex_unlock(globals.mutex);
- DEBUGA_SKYPE("%s CHANNEL INIT %s\n", SKYPIAX_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session));
+ DEBUGA_CELLIAX("%s CHANNEL INIT %s\n", CELLIAX_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session));
return SWITCH_STATUS_SUCCESS;
}
@@ -474,7 +474,7 @@
if (tech_pvt) {
- DEBUGA_SKYPE("%s CHANNEL DESTROY %s\n", SKYPIAX_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session));
+ DEBUGA_CELLIAX("%s CHANNEL DESTROY %s\n", CELLIAX_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session));
if (switch_core_codec_ready(&tech_pvt->read_codec)) {
switch_core_codec_destroy(&tech_pvt->read_codec);
@@ -490,13 +490,13 @@
alsa_shutdown(tech_pvt);
*tech_pvt->session_uuid_str = '\0';
- tech_pvt->interface_state = SKYPIAX_STATE_IDLE;
- if (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED) {
- tech_pvt->skype_callflow = CALLFLOW_CALL_IDLE;
+ tech_pvt->interface_state = CELLIAX_STATE_IDLE;
+ if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) {
+ tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE;
}
switch_core_session_set_private(session, NULL);
} else {
- DEBUGA_SKYPE("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(session));
+ DEBUGA_CELLIAX("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", CELLIAX_P_LOG, switch_core_session_get_uuid(session));
}
return SWITCH_STATUS_SUCCESS;
@@ -522,7 +522,7 @@
}
}
- DEBUGA_SKYPE("%s CHANNEL HANGUP\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL HANGUP\n", CELLIAX_P_LOG, tech_pvt->name);
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_clear_flag(tech_pvt, TFLAG_VOICE);
switch_set_flag(tech_pvt, TFLAG_HANGUP);
@@ -531,16 +531,16 @@
//memset(tech_pvt->session_uuid_str, '\0', sizeof(tech_pvt->session_uuid_str));
//*tech_pvt->session_uuid_str = '\0';
- DEBUGA_SKYPE("%s CHANNEL HANGUP\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL HANGUP\n", CELLIAX_P_LOG, tech_pvt->name);
switch_mutex_lock(globals.mutex);
globals.calls--;
if (globals.calls < 0) {
globals.calls = 0;
}
- tech_pvt->interface_state = SKYPIAX_STATE_IDLE;
- if (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED) {
- tech_pvt->skype_callflow = CALLFLOW_CALL_IDLE;
+ tech_pvt->interface_state = CELLIAX_STATE_IDLE;
+ if (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED) {
+ tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE;
}
switch_mutex_unlock(globals.mutex);
@@ -558,7 +558,7 @@
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
- DEBUGA_SKYPE("%s CHANNEL ROUTING\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL ROUTING\n", CELLIAX_P_LOG, tech_pvt->name);
return SWITCH_STATUS_SUCCESS;
}
@@ -575,7 +575,7 @@
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
- DEBUGA_SKYPE("%s CHANNEL EXECUTE\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL EXECUTE\n", CELLIAX_P_LOG, tech_pvt->name);
return SWITCH_STATUS_SUCCESS;
}
@@ -591,10 +591,10 @@
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
- DEBUGA_SKYPE("%s CHANNEL KILL_CHANNEL\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL KILL_CHANNEL\n", CELLIAX_P_LOG, tech_pvt->name);
switch (sig) {
case SWITCH_SIG_KILL:
- DEBUGA_SKYPE("%s CHANNEL got SWITCH_SIG_KILL\n", SKYPIAX_P_LOG, switch_channel_get_name(channel));
+ DEBUGA_CELLIAX("%s CHANNEL got SWITCH_SIG_KILL\n", CELLIAX_P_LOG, switch_channel_get_name(channel));
//switch_mutex_lock(tech_pvt->flag_mutex);
switch_clear_flag(tech_pvt, TFLAG_IO);
switch_clear_flag(tech_pvt, TFLAG_VOICE);
@@ -602,7 +602,7 @@
//switch_mutex_unlock(tech_pvt->flag_mutex);
break;
case SWITCH_SIG_BREAK:
- DEBUGA_SKYPE("%s CHANNEL got SWITCH_SIG_BREAK\n", SKYPIAX_P_LOG, switch_channel_get_name(channel));
+ DEBUGA_CELLIAX("%s CHANNEL got SWITCH_SIG_BREAK\n", CELLIAX_P_LOG, switch_channel_get_name(channel));
//switch_set_flag(tech_pvt, TFLAG_BREAK);
//switch_mutex_lock(tech_pvt->flag_mutex);
switch_set_flag(tech_pvt, TFLAG_BREAK);
@@ -620,7 +620,7 @@
tech_pvt = switch_core_session_get_private(session);
- DEBUGA_SKYPE("%s CHANNEL CONSUME_MEDIA\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL CONSUME_MEDIA\n", CELLIAX_P_LOG, tech_pvt->name);
return SWITCH_STATUS_SUCCESS;
}
@@ -629,7 +629,7 @@
{
private_t *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
- DEBUGA_SKYPE("%s CHANNEL EXCHANGE_MEDIA\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL EXCHANGE_MEDIA\n", CELLIAX_P_LOG, tech_pvt->name);
return SWITCH_STATUS_SUCCESS;
}
@@ -637,7 +637,7 @@
{
private_t *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
- DEBUGA_SKYPE("%s CHANNEL SOFT_EXECUTE\n", SKYPIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("%s CHANNEL SOFT_EXECUTE\n", CELLIAX_P_LOG, tech_pvt->name);
return SWITCH_STATUS_SUCCESS;
}
@@ -646,8 +646,8 @@
private_t *tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
- DEBUGA_SKYPE("%s CHANNEL SEND_DTMF\n", SKYPIAX_P_LOG, tech_pvt->name);
- DEBUGA_SKYPE("DTMF: %c\n", SKYPIAX_P_LOG, dtmf->digit);
+ DEBUGA_CELLIAX("%s CHANNEL SEND_DTMF\n", CELLIAX_P_LOG, tech_pvt->name);
+ DEBUGA_CELLIAX("DTMF: %c\n", CELLIAX_P_LOG, dtmf->digit);
celliax_senddigit(tech_pvt, dtmf->digit);
@@ -667,7 +667,7 @@
switch_assert(tech_pvt != NULL);
if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) {
- ERRORA("channel not ready \n", SKYPIAX_P_LOG);
+ ERRORA("channel not ready \n", CELLIAX_P_LOG);
//TODO: kill the bastard
return SWITCH_STATUS_FALSE;
}
@@ -706,10 +706,10 @@
}
if (samples != 160) {
- ERRORA("samples=%d\n", SKYPIAX_P_LOG, samples);
+ ERRORA("samples=%d\n", CELLIAX_P_LOG, samples);
goto cng;
}
-//DEBUGA_SKYPE("samples=%d tech_pvt->read_frame.timestamp=%d\n", SKYPIAX_P_LOG, samples, tech_pvt->read_frame.timestamp);
+//DEBUGA_CELLIAX("samples=%d tech_pvt->read_frame.timestamp=%d\n", CELLIAX_P_LOG, samples, tech_pvt->read_frame.timestamp);
//usleep(17000);
//usleep(17000);
@@ -736,7 +736,7 @@
switch_channel_queue_dtmf(channel, &dtmf);
p++;
}
- NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPIAX_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp,
+ NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", CELLIAX_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp,
(unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp));
tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp;
}
@@ -744,19 +744,19 @@
while (switch_test_flag(tech_pvt, TFLAG_IO)) {
if (switch_test_flag(tech_pvt, TFLAG_BREAK)) {
switch_clear_flag(tech_pvt, TFLAG_BREAK);
- DEBUGA_SKYPE("CHANNEL READ FRAME goto CNG\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("CHANNEL READ FRAME goto CNG\n", CELLIAX_P_LOG);
goto cng;
}
if (!switch_test_flag(tech_pvt, TFLAG_IO)) {
- DEBUGA_SKYPE("CHANNEL READ FRAME not IO\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("CHANNEL READ FRAME not IO\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) {
switch_clear_flag(tech_pvt, TFLAG_VOICE);
if (!tech_pvt->read_frame.datalen) {
- DEBUGA_SKYPE("CHANNEL READ CONTINUE\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("CHANNEL READ CONTINUE\n", CELLIAX_P_LOG);
continue;
}
*frame = &tech_pvt->read_frame;
@@ -765,17 +765,17 @@
switch_swap_linear((*frame)->data, (int) (*frame)->datalen / 2);
}
#endif
- //WARNINGA("HERE\n", SKYPIAX_P_LOG);
+ //WARNINGA("HERE\n", CELLIAX_P_LOG);
return SWITCH_STATUS_SUCCESS;
}
- WARNINGA("HERE\n", SKYPIAX_P_LOG);
- DEBUGA_SKYPE("CHANNEL READ no TFLAG_VOICE\n", SKYPIAX_P_LOG);
+ WARNINGA("HERE\n", CELLIAX_P_LOG);
+ DEBUGA_CELLIAX("CHANNEL READ no TFLAG_VOICE\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
}
- DEBUGA_SKYPE("CHANNEL READ FALSE\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("CHANNEL READ FALSE\n", CELLIAX_P_LOG);
return SWITCH_STATUS_FALSE;
cng:
@@ -802,7 +802,7 @@
switch_assert(tech_pvt != NULL);
if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) {
- ERRORA("channel not ready \n", SKYPIAX_P_LOG);
+ ERRORA("channel not ready \n", CELLIAX_P_LOG);
//TODO: kill the bastard
return SWITCH_STATUS_FALSE;
}
@@ -815,17 +815,17 @@
switch_core_timer_next(&tech_pvt->timer_write);
//sent = frame->datalen;
- //ERRORA("PLAY \n", SKYPIAX_P_LOG);
+ //ERRORA("PLAY \n", CELLIAX_P_LOG);
//snd_pcm_writei(tech_pvt->alsap, (short *) frame->data, (int) (frame->datalen / 2));
celliax_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost);
sent = alsa_write(tech_pvt, frame->data, (int) (frame->datalen));
-//DEBUGA_SKYPE("sent=%d \n", SKYPIAX_P_LOG, sent);
+//DEBUGA_CELLIAX("sent=%d \n", CELLIAX_P_LOG, sent);
if (sent && sent != frame->datalen / 2 && sent != -1) {
- DEBUGA_SKYPE("sent %d\n", SKYPIAX_P_LOG, sent);
+ DEBUGA_CELLIAX("sent %d\n", CELLIAX_P_LOG, sent);
}
- //NOTICA("sent=%d\n", SKYPIAX_P_LOG, sent);
+ //NOTICA("sent=%d\n", CELLIAX_P_LOG, sent);
return SWITCH_STATUS_SUCCESS;
}
@@ -840,7 +840,7 @@
tech_pvt = switch_core_session_get_private(session);
switch_assert(tech_pvt != NULL);
- DEBUGA_SKYPE("ANSWERED! \n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("ANSWERED! \n", CELLIAX_P_LOG);
return SWITCH_STATUS_SUCCESS;
}
@@ -861,15 +861,15 @@
switch (msg->message_id) {
case SWITCH_MESSAGE_INDICATE_ANSWER:
{
- DEBUGA_SKYPE("MSG_ID=%d, TO BE ANSWERED!\n", SKYPIAX_P_LOG, msg->message_id);
+ DEBUGA_CELLIAX("MSG_ID=%d, TO BE ANSWERED!\n", CELLIAX_P_LOG, msg->message_id);
channel_answer_channel(session);
}
break;
case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC:
- WARNINGA("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", SKYPIAX_P_LOG, switch_channel_get_name(channel));
+ WARNINGA("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", CELLIAX_P_LOG, switch_channel_get_name(channel));
while ((samples = alsa_read(tech_pvt, tmp_buffer, tech_pvt->read_codec.implementation->samples_per_packet * 4)) > 160) {
- WARNINGA("read %d samples\n", SKYPIAX_P_LOG, samples);
+ WARNINGA("read %d samples\n", CELLIAX_P_LOG, samples);
}
switch_core_timer_sync(&tech_pvt->timer_read);
switch_core_timer_sync(&tech_pvt->timer_write);
@@ -879,7 +879,7 @@
default:
{
- DEBUGA_SKYPE("MSG_ID=%d\n", SKYPIAX_P_LOG, msg->message_id);
+ DEBUGA_CELLIAX("MSG_ID=%d\n", CELLIAX_P_LOG, msg->message_id);
}
break;
}
@@ -897,7 +897,7 @@
body = "";
}
- WARNINGA("event: |||%s|||\n", SKYPIAX_P_LOG, body);
+ WARNINGA("event: |||%s|||\n", CELLIAX_P_LOG, body);
return SWITCH_STATUS_SUCCESS;
}
@@ -940,7 +940,7 @@
int found = 0;
char interface_name[256];
- DEBUGA_SKYPE("1 SESSION_REQUEST %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(*new_session));
+ DEBUGA_CELLIAX("1 SESSION_REQUEST %s\n", CELLIAX_P_LOG, switch_core_session_get_uuid(*new_session));
switch_core_session_add_stream(*new_session, NULL);
@@ -955,35 +955,35 @@
switch_mutex_lock(globals.mutex);
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);
+ //DEBUGA_CELLIAX("Finding one available celliax interface\n", CELLIAX_P_LOG);
//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);
+ DEBUGA_CELLIAX("Finding one available celliax interface RR\n", CELLIAX_P_LOG);
tech_pvt = find_available_celliax_interface_rr(NULL);
if (tech_pvt)
found = 1;
- DEBUGA_SKYPE("FOUND one available skype interface RR\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("FOUND one available celliax interface RR\n", CELLIAX_P_LOG);
}
- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
+ for (i = 0; !found && i < CELLIAX_MAX_INTERFACES; i++) {
/* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)
- && (strncmp(globals.SKYPIAX_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) {
- if (strlen(globals.SKYPIAX_INTERFACES[i].session_uuid_str)) {
- DEBUGA_SKYPE
- ("globals.SKYPIAX_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n",
- SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name, globals.SKYPIAX_INTERFACES[i].session_uuid_str);
- DEBUGA_SKYPE("1 SESSION_DESTROY %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(*new_session));
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)
+ && (strncmp(globals.CELLIAX_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) {
+ if (strlen(globals.CELLIAX_INTERFACES[i].session_uuid_str)) {
+ DEBUGA_CELLIAX
+ ("globals.CELLIAX_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n",
+ CELLIAX_P_LOG, i, globals.CELLIAX_INTERFACES[i].name, globals.CELLIAX_INTERFACES[i].session_uuid_str);
+ DEBUGA_CELLIAX("1 SESSION_DESTROY %s\n", CELLIAX_P_LOG, switch_core_session_get_uuid(*new_session));
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
- DEBUGA_SKYPE("globals.SKYPIAX_INTERFACES[%d].name=|||%s|||?\n", SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name);
- tech_pvt = &globals.SKYPIAX_INTERFACES[i];
+ DEBUGA_CELLIAX("globals.CELLIAX_INTERFACES[%d].name=|||%s|||?\n", CELLIAX_P_LOG, i, globals.CELLIAX_INTERFACES[i].name);
+ tech_pvt = &globals.CELLIAX_INTERFACES[i];
found = 1;
break;
}
@@ -991,14 +991,14 @@
}
} else {
- ERRORA("Doh! no destination number?\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no destination number?\n", CELLIAX_P_LOG);
switch_core_session_destroy(new_session);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
if (!found) {
- DEBUGA_SKYPE("Doh! no available interface for |||%s|||?\n", SKYPIAX_P_LOG, interface_name);
- DEBUGA_SKYPE("2 SESSION_DESTROY %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(*new_session));
+ DEBUGA_CELLIAX("Doh! no available interface for |||%s|||?\n", CELLIAX_P_LOG, interface_name);
+ DEBUGA_CELLIAX("2 SESSION_DESTROY %s\n", CELLIAX_P_LOG, switch_core_session_get_uuid(*new_session));
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
//return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
@@ -1007,13 +1007,13 @@
channel = switch_core_session_get_channel(*new_session);
if (!channel) {
- ERRORA("Doh! no channel?\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no channel?\n", CELLIAX_P_LOG);
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
if (celliax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) {
- ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no tech_init?\n", CELLIAX_P_LOG);
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
@@ -1030,7 +1030,7 @@
switch_channel_set_caller_profile(channel, caller_profile);
tech_pvt->caller_profile = caller_profile;
} else {
- ERRORA("Doh! no caller profile\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no caller profile\n", CELLIAX_P_LOG);
switch_core_session_destroy(new_session);
switch_mutex_unlock(globals.mutex);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
@@ -1055,7 +1055,7 @@
return SWITCH_CAUSE_SUCCESS;
}
- ERRORA("Doh! no new_session\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no new_session\n", CELLIAX_P_LOG);
return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER;
}
@@ -1073,7 +1073,7 @@
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);
+ ERRORA("open of %s failed\n", CELLIAX_P_LOG, cf);
running = 0;
switch_xml_free(xml);
return SWITCH_STATUS_TERM;
@@ -1086,36 +1086,36 @@
char *val = (char *) switch_xml_attr_soft(param, "value");
if (!strcasecmp(var, "debug")) {
- DEBUGA_SKYPE("globals.debug=%d\n", SKYPIAX_P_LOG, globals.debug);
+ DEBUGA_CELLIAX("globals.debug=%d\n", CELLIAX_P_LOG, globals.debug);
globals.debug = atoi(val);
- DEBUGA_SKYPE("globals.debug=%d\n", SKYPIAX_P_LOG, globals.debug);
+ DEBUGA_CELLIAX("globals.debug=%d\n", CELLIAX_P_LOG, globals.debug);
} else if (!strcasecmp(var, "hold-music")) {
switch_set_string(globals.hold_music, val);
- DEBUGA_SKYPE("globals.hold_music=%s\n", SKYPIAX_P_LOG, globals.hold_music);
+ DEBUGA_CELLIAX("globals.hold_music=%s\n", CELLIAX_P_LOG, globals.hold_music);
} else if (!strcmp(var, "port")) {
globals.port = atoi(val);
- DEBUGA_SKYPE("globals.port=%d\n", SKYPIAX_P_LOG, globals.port);
+ DEBUGA_CELLIAX("globals.port=%d\n", CELLIAX_P_LOG, globals.port);
} else if (!strcmp(var, "codec-master")) {
if (!strcasecmp(val, "us")) {
switch_set_flag(&globals, GFLAG_MY_CODEC_PREFS);
}
- DEBUGA_SKYPE("codec-master globals.debug=%d\n", SKYPIAX_P_LOG, globals.debug);
+ DEBUGA_CELLIAX("codec-master globals.debug=%d\n", CELLIAX_P_LOG, globals.debug);
} else if (!strcmp(var, "dialplan")) {
set_global_dialplan(val);
- DEBUGA_SKYPE("globals.dialplan=%s\n", SKYPIAX_P_LOG, globals.dialplan);
+ DEBUGA_CELLIAX("globals.dialplan=%s\n", CELLIAX_P_LOG, globals.dialplan);
} else if (!strcmp(var, "destination")) {
set_global_destination(val);
- DEBUGA_SKYPE("globals.destination=%s\n", SKYPIAX_P_LOG, globals.destination);
+ DEBUGA_CELLIAX("globals.destination=%s\n", CELLIAX_P_LOG, globals.destination);
} else if (!strcmp(var, "context")) {
set_global_context(val);
- DEBUGA_SKYPE("globals.context=%s\n", SKYPIAX_P_LOG, globals.context);
+ DEBUGA_CELLIAX("globals.context=%s\n", CELLIAX_P_LOG, globals.context);
} else if (!strcmp(var, "codec-prefs")) {
set_global_codec_string(val);
- DEBUGA_SKYPE("globals.codec_string=%s\n", SKYPIAX_P_LOG, globals.codec_string);
+ DEBUGA_CELLIAX("globals.codec_string=%s\n", CELLIAX_P_LOG, globals.codec_string);
globals.codec_order_last = switch_separate_string(globals.codec_string, ',', globals.codec_order, SWITCH_MAX_CODECS);
} else if (!strcmp(var, "codec-rates")) {
set_global_codec_rates_string(val);
- DEBUGA_SKYPE("globals.codec_rates_string=%s\n", SKYPIAX_P_LOG, globals.codec_rates_string);
+ DEBUGA_CELLIAX("globals.codec_rates_string=%s\n", CELLIAX_P_LOG, globals.codec_rates_string);
globals.codec_rates_last = switch_separate_string(globals.codec_rates_string, ',', globals.codec_rates, SWITCH_MAX_CODECS);
}
@@ -1142,7 +1142,7 @@
char *X11_display = NULL;
char *tcp_cli_port = NULL;
char *tcp_srv_port = NULL;
- char *skype_user = NULL;
+ char *celliax_user = NULL;
uint32_t interface_id = 0, to = 0, max = 0;
uint32_t controldevice_speed = B115200;
@@ -1172,8 +1172,8 @@
fail_dial_regex = val;
} else if (!strcasecmp(var, "hold-music")) {
hold_music = val;
- } else if (!strcasecmp(var, "skype_user")) {
- skype_user = val;
+ } else if (!strcasecmp(var, "celliax_user")) {
+ celliax_user = val;
} else if (!strcasecmp(var, "tcp_cli_port")) {
tcp_cli_port = val;
} else if (!strcasecmp(var, "tcp_srv_port")) {
@@ -1187,8 +1187,8 @@
}
}
- if (!skype_user) {
- ERRORA("interface missing REQUIRED param 'skype_user'\n", SKYPIAX_P_LOG);
+ if (!celliax_user) {
+ ERRORA("interface missing REQUIRED param 'celliax_user'\n", CELLIAX_P_LOG);
continue;
}
@@ -1204,32 +1204,32 @@
/* END: Changes here */
if (!X11_display) {
- ERRORA("interface missing REQUIRED param 'X11_display'\n", SKYPIAX_P_LOG);
+ ERRORA("interface missing REQUIRED param 'X11_display'\n", CELLIAX_P_LOG);
continue;
}
if (!tcp_cli_port) {
- ERRORA("interface missing REQUIRED param 'tcp_cli_port'\n", SKYPIAX_P_LOG);
+ ERRORA("interface missing REQUIRED param 'tcp_cli_port'\n", CELLIAX_P_LOG);
continue;
}
if (!tcp_srv_port) {
- ERRORA("interface missing REQUIRED param 'tcp_srv_port'\n", SKYPIAX_P_LOG);
+ ERRORA("interface missing REQUIRED param 'tcp_srv_port'\n", CELLIAX_P_LOG);
continue;
}
if (!id) {
- ERRORA("interface missing REQUIRED param 'id'\n", SKYPIAX_P_LOG);
+ ERRORA("interface missing REQUIRED param 'id'\n", CELLIAX_P_LOG);
continue;
}
if (switch_is_number(id)) {
interface_id = atoi(id);
- DEBUGA_SKYPE("interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
+ DEBUGA_CELLIAX("interface_id=%d\n", CELLIAX_P_LOG, interface_id);
} else {
- ERRORA("interface param 'id' MUST be a number, now id='%s'\n", SKYPIAX_P_LOG, id);
+ ERRORA("interface param 'id' MUST be a number, now id='%s'\n", CELLIAX_P_LOG, id);
continue;
}
if (!name) {
- WARNINGA("interface missing param 'name', not nice, but works\n", SKYPIAX_P_LOG);
+ WARNINGA("interface missing param 'name', not nice, but works\n", CELLIAX_P_LOG);
}
if (!controldevice_name) {
@@ -1245,158 +1245,158 @@
}
if (name) {
- DEBUGA_SKYPE("name=%s\n", SKYPIAX_P_LOG, name);
+ DEBUGA_CELLIAX("name=%s\n", CELLIAX_P_LOG, name);
}
- if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) {
+ if (interface_id && interface_id < CELLIAX_MAX_INTERFACES) {
private_t newconf;
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;
- globals.SKYPIAX_INTERFACES[interface_id].running = 1;
+ globals.CELLIAX_INTERFACES[interface_id] = newconf;
+ globals.CELLIAX_INTERFACES[interface_id].running = 1;
- tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
+ tech_pvt = &globals.CELLIAX_INTERFACES[interface_id];
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].interface_id, id);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].interface_id, id);
if (name) {
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, name);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, name);
} else {
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, "N/A");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].name, "N/A");
}
- DEBUGA_SKYPE("CONFIGURING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
+ DEBUGA_CELLIAX("CONFIGURING interface_id=%d\n", CELLIAX_P_LOG, interface_id);
#ifdef WIN32
- globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port = (unsigned short) atoi(tcp_cli_port);
- globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port = (unsigned short) atoi(tcp_srv_port);
+ globals.CELLIAX_INTERFACES[interface_id].tcp_cli_port = (unsigned short) atoi(tcp_cli_port);
+ globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port = (unsigned short) atoi(tcp_srv_port);
#else /* WIN32 */
- globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port = atoi(tcp_cli_port);
- globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port = atoi(tcp_srv_port);
+ globals.CELLIAX_INTERFACES[interface_id].tcp_cli_port = atoi(tcp_cli_port);
+ globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port = atoi(tcp_srv_port);
#endif /* WIN32 */
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].X11_display, X11_display);
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].skype_user, skype_user);
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan);
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].destination, destination);
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context);
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].controldevice_name, controldevice_name);
- globals.SKYPIAX_INTERFACES[interface_id].controldevice_speed = controldevice_speed;
- globals.SKYPIAX_INTERFACES[interface_id].controldevprotocol = controldevprotocol;
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].X11_display, X11_display);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].celliax_user, celliax_user);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].context, context);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].dialplan, dialplan);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].destination, destination);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].context, context);
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].controldevice_name, controldevice_name);
+ globals.CELLIAX_INTERFACES[interface_id].controldevice_speed = controldevice_speed;
+ globals.CELLIAX_INTERFACES[interface_id].controldevprotocol = controldevprotocol;
- switch_mutex_init(&globals.SKYPIAX_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, celliax_module_pool);
+ switch_mutex_init(&globals.CELLIAX_INTERFACES[interface_id].controldev_lock, SWITCH_MUTEX_NESTED, celliax_module_pool);
/*********************/
//at_dial_pre_number = "AT+CKPD=\"";
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_dial_pre_number, "ATD");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_pre_number, "ATD");
//.at_dial_post_number = "S\"";
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_dial_post_number, ";");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_dial_expect, "OK");
- globals.SKYPIAX_INTERFACES[interface_id].at_early_audio = 0;
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_hangup, "ATH");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_hangup_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_answer, "ATA");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_answer_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_send_dtmf, "AT+VTS");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_1, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_1_expect, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_2, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_2_expect, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_3, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_3_expect, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_4, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_4_expect, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_5, "");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_preinit_5_expect, "");
- globals.SKYPIAX_INTERFACES[interface_id].at_after_preinit_pause = 500000;
- globals.SKYPIAX_INTERFACES[interface_id].at_initial_pause = 500000;
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_1, "at+cmic=0,9");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_1_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_2, "AT+CKPD=\"EEE\"");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_2_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_3, "AT+CSSN=1,0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_3_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_4, "at+sidet=0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_4_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_5, "at+clvl=99");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_postinit_5_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_query_battchg, "AT+CBC");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_query_battchg_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_query_signal, "AT+CSQ");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_query_signal_expect, "OK");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_call_idle, "+MCST: 1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_call_incoming, "+MCST: 2");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_call_active, "+CSSI: 7");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_call_failed, "+MCST: 65");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_call_calling, "+CSSI: 1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_noservice_string, "CIEV: 2;0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_nosignal_string, "CIEV: 5;0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_lowsignal_string, "CIEV: 5;1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_lowbattchg_string, "CIEV: 0;1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_nobattchg_string, "CIEV: 0;0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_callactive_string, "CIEV: 3;1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_nocallactive_string, "CIEV: 3;0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_nocallsetup_string, "CIEV: 6;0");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_callsetupincoming_string, "CIEV: 6;1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, "CIEV: 6;2");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, "CIEV: 6;3");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].sms_receiving_program, "/usr/local/bin/ciapalo");
- globals.SKYPIAX_INTERFACES[interface_id].at_has_clcc = 0;
- globals.SKYPIAX_INTERFACES[interface_id].at_has_ecam = 0;
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_post_number, ";");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_dial_expect, "OK");
+ globals.CELLIAX_INTERFACES[interface_id].at_early_audio = 0;
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup, "ATH");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_hangup_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer, "ATA");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_answer_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_send_dtmf, "AT+VTS");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_1_expect, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_2_expect, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_3_expect, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_4_expect, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5, "");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_preinit_5_expect, "");
+ globals.CELLIAX_INTERFACES[interface_id].at_after_preinit_pause = 500000;
+ globals.CELLIAX_INTERFACES[interface_id].at_initial_pause = 500000;
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1, "at+cmic=0,9");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_1_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2, "AT+CKPD=\"EEE\"");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_2_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3, "AT+CSSN=1,0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_3_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4, "at+sidet=0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_4_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5, "at+clvl=99");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_postinit_5_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg, "AT+CBC");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_battchg_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal, "AT+CSQ");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_query_signal_expect, "OK");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_idle, "+MCST: 1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_incoming, "+MCST: 2");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_active, "+CSSI: 7");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_failed, "+MCST: 65");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_call_calling, "+CSSI: 1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_noservice_string, "CIEV: 2;0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nosignal_string, "CIEV: 5;0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowsignal_string, "CIEV: 5;1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_lowbattchg_string, "CIEV: 0;1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nobattchg_string, "CIEV: 0;0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callactive_string, "CIEV: 3;1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallactive_string, "CIEV: 3;0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_nocallsetup_string, "CIEV: 6;0");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupincoming_string, "CIEV: 6;1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupoutgoing_string, "CIEV: 6;2");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].at_indicator_callsetupremoteringing_string, "CIEV: 6;3");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].sms_receiving_program, "/usr/local/bin/ciapalo");
+ globals.CELLIAX_INTERFACES[interface_id].at_has_clcc = 0;
+ globals.CELLIAX_INTERFACES[interface_id].at_has_ecam = 0;
- globals.SKYPIAX_INTERFACES[interface_id].alsa_period_size = 160;
- globals.SKYPIAX_INTERFACES[interface_id].alsa_periods_in_buffer = 4;
- globals.SKYPIAX_INTERFACES[interface_id].celliax_sound_rate = 8000;
+ globals.CELLIAX_INTERFACES[interface_id].alsa_period_size = 160;
+ globals.CELLIAX_INTERFACES[interface_id].alsa_periods_in_buffer = 4;
+ globals.CELLIAX_INTERFACES[interface_id].celliax_sound_rate = 8000;
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].alsacname, "plughw:1");
- switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].alsapname, "plughw:1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsacname, "plughw:1");
+ switch_set_string(globals.CELLIAX_INTERFACES[interface_id].alsapname, "plughw:1");
- globals.SKYPIAX_INTERFACES[interface_id].alsa_play_is_mono = 1;
- globals.SKYPIAX_INTERFACES[interface_id].alsa_capture_is_mono = 1;
+ globals.CELLIAX_INTERFACES[interface_id].alsa_play_is_mono = 1;
+ globals.CELLIAX_INTERFACES[interface_id].alsa_capture_is_mono = 1;
- globals.SKYPIAX_INTERFACES[interface_id].capture_boost = 0;
- globals.SKYPIAX_INTERFACES[interface_id].playback_boost = 0;
+ globals.CELLIAX_INTERFACES[interface_id].capture_boost = 0;
+ globals.CELLIAX_INTERFACES[interface_id].playback_boost = 0;
- celliax_store_boost("5", &globals.SKYPIAX_INTERFACES[interface_id].capture_boost);
- celliax_store_boost("10", &globals.SKYPIAX_INTERFACES[interface_id].playback_boost);
+ celliax_store_boost("5", &globals.CELLIAX_INTERFACES[interface_id].capture_boost);
+ celliax_store_boost("10", &globals.CELLIAX_INTERFACES[interface_id].playback_boost);
/*********************/
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_user=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port=%d\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].tcp_cli_port);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port=%d\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].tcp_srv_port);
- DEBUGA_SKYPE("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].name);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].dialplan=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].dialplan);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].destination=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].destination);
- DEBUGA_SKYPE
- ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n",
- SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context);
- WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].X11_display=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].X11_display);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].celliax_user=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].celliax_user);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].tcp_cli_port=%d\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].tcp_cli_port);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port=%d\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].tcp_srv_port);
+ DEBUGA_CELLIAX("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].name=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].name);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].context=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].context);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].dialplan=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].dialplan);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].destination=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].destination);
+ DEBUGA_CELLIAX
+ ("interface_id=%d globals.CELLIAX_INTERFACES[interface_id].context=%s\n",
+ CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].context);
+ WARNINGA("STARTING interface_id=%d\n", CELLIAX_P_LOG, interface_id);
int res = 0;
/* init the serial port */
- if (globals.SKYPIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
- globals.SKYPIAX_INTERFACES[interface_id].controldevfd =
- celliax_serial_init(&globals.SKYPIAX_INTERFACES[interface_id], globals.SKYPIAX_INTERFACES[interface_id].controldevice_speed);
- if (globals.SKYPIAX_INTERFACES[interface_id].controldevfd < 1) {
- ERRORA("celliax_serial_init failed\n", SKYPIAX_P_LOG);
+ if (globals.CELLIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
+ globals.CELLIAX_INTERFACES[interface_id].controldevfd =
+ celliax_serial_init(&globals.CELLIAX_INTERFACES[interface_id], globals.CELLIAX_INTERFACES[interface_id].controldevice_speed);
+ if (globals.CELLIAX_INTERFACES[interface_id].controldevfd < 1) {
+ ERRORA("celliax_serial_init failed\n", CELLIAX_P_LOG);
//celliax_sound_shutdown(tmp);
//if (tmp)
//free(tmp);
@@ -1405,11 +1405,11 @@
}
/* config the phone/modem on the serial port */
- if (globals.SKYPIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
+ if (globals.CELLIAX_INTERFACES[interface_id].controldevprotocol != PROTOCOL_NO_SERIAL) {
//int res;
- res = celliax_serial_config(&globals.SKYPIAX_INTERFACES[interface_id]);
+ res = celliax_serial_config(&globals.CELLIAX_INTERFACES[interface_id]);
if (res) {
- ERRORA("celliax_serial_config failed\n", SKYPIAX_P_LOG);
+ ERRORA("celliax_serial_config failed\n", CELLIAX_P_LOG);
//celliax_sound_shutdown(tmp);
//if (tmp)
//free(tmp);
@@ -1421,32 +1421,32 @@
switch_sleep(100000);
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_thread_create(&globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread, celliax_api_thread_attr, celliax_do_celliaxapi_thread,
+ &globals.CELLIAX_INTERFACES[interface_id], celliax_module_pool);
switch_sleep(100000);
} else {
- ERRORA("interface id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n", SKYPIAX_P_LOG, interface_id, SKYPIAX_MAX_INTERFACES);
+ ERRORA("interface id %d is higher than CELLIAX_MAX_INTERFACES (%d)\n", CELLIAX_P_LOG, interface_id, CELLIAX_MAX_INTERFACES);
continue;
}
}
- for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
+ for (i = 0; i < CELLIAX_MAX_INTERFACES; i++) {
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)) {
/* How many real intterfaces */
globals.real_interfaces = i + 1;
- tech_pvt = &globals.SKYPIAX_INTERFACES[i];
+ tech_pvt = &globals.CELLIAX_INTERFACES[i];
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].interface_id=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].interface_id);
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].X11_display=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].X11_display);
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].name=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].name);
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].context);
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].dialplan);
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination);
- DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].context);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].interface_id=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].interface_id);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].X11_display=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].X11_display);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].name=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].name);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].context=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].context);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].dialplan=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].dialplan);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].destination=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].destination);
+ DEBUGA_CELLIAX("i=%d globals.CELLIAX_INTERFACES[%d].context=%s\n", CELLIAX_P_LOG, i, i, globals.CELLIAX_INTERFACES[i].context);
}
}
}
@@ -1479,9 +1479,9 @@
if (running) {
- SWITCH_ADD_API(commands_api_interface, "sk", "Skypiax console commands", sk_function, SK_SYNTAX);
- SWITCH_ADD_API(commands_api_interface, "celliax", "Skypiax interface commands", celliax_function, SKYPIAX_SYNTAX);
- SWITCH_ADD_API(commands_api_interface, "sendsms", "sendsms interface destination_number SMS_text", sendsms_function, SKYPIAX_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "sk", "Celliax console commands", sk_function, SK_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "celliax", "Celliax interface commands", celliax_function, CELLIAX_SYNTAX);
+ SWITCH_ADD_API(commands_api_interface, "sendsms", "sendsms interface destination_number SMS_text", sendsms_function, CELLIAX_SYNTAX);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
@@ -1499,19 +1499,19 @@
running = 0;
- for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) {
- tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id];
+ for (interface_id = 0; interface_id < CELLIAX_MAX_INTERFACES; interface_id++) {
+ tech_pvt = &globals.CELLIAX_INTERFACES[interface_id];
- if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) {
+ if (strlen(globals.CELLIAX_INTERFACES[interface_id].name)) {
- //alsa_shutdown(&globals.SKYPIAX_INTERFACES[interface_id]);
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
+ //alsa_shutdown(&globals.CELLIAX_INTERFACES[interface_id]);
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_signaling_thread) {
#ifdef WIN32
- switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
+ switch_file_write(tech_pvt->CelliaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die
#else /* WIN32 */
- howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", howmany);
+ howmany = write(tech_pvt->CelliaxHandles.fdesc[1], "sciutati", howmany);
#endif /* WIN32 */
}
x = 10;
@@ -1519,26 +1519,26 @@
x--;
switch_yield(50000);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_signaling_thread);
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_signaling_thread) {
+ switch_thread_join(&status, globals.CELLIAX_INTERFACES[interface_id].celliax_signaling_thread);
}
- if (globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread) {
- switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].celliax_api_thread);
+ if (globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread) {
+ switch_thread_join(&status, globals.CELLIAX_INTERFACES[interface_id].celliax_api_thread);
}
#ifndef WIN32
- WARNINGA("SHUTDOWN interface_id=%d\n", SKYPIAX_P_LOG, interface_id);
- shutdown(tech_pvt->audioskypepipe[0], 2);
- close(tech_pvt->audioskypepipe[0]);
- shutdown(tech_pvt->audioskypepipe[1], 2);
- close(tech_pvt->audioskypepipe[1]);
+ WARNINGA("SHUTDOWN interface_id=%d\n", CELLIAX_P_LOG, interface_id);
+ shutdown(tech_pvt->audiocelliaxpipe[0], 2);
+ close(tech_pvt->audiocelliaxpipe[0]);
+ shutdown(tech_pvt->audiocelliaxpipe[1], 2);
+ close(tech_pvt->audiocelliaxpipe[1]);
shutdown(tech_pvt->audiopipe[0], 2);
close(tech_pvt->audiopipe[0]);
shutdown(tech_pvt->audiopipe[1], 2);
close(tech_pvt->audiopipe[1]);
- shutdown(tech_pvt->SkypiaxHandles.fdesc[0], 2);
- close(tech_pvt->SkypiaxHandles.fdesc[0]);
- shutdown(tech_pvt->SkypiaxHandles.fdesc[1], 2);
- close(tech_pvt->SkypiaxHandles.fdesc[1]);
+ shutdown(tech_pvt->CelliaxHandles.fdesc[0], 2);
+ close(tech_pvt->CelliaxHandles.fdesc[0]);
+ shutdown(tech_pvt->CelliaxHandles.fdesc[1], 2);
+ close(tech_pvt->CelliaxHandles.fdesc[1]);
#endif /* WIN32 */
}
@@ -1553,9 +1553,9 @@
}
-void *SWITCH_THREAD_FUNC celliax_do_skypeapi_thread(switch_thread_t *thread, void *obj)
+void *SWITCH_THREAD_FUNC celliax_do_celliaxapi_thread(switch_thread_t *thread, void *obj)
{
- return celliax_do_skypeapi_thread_func(obj);
+ return celliax_do_celliaxapi_thread_func(obj);
}
int dtmf_received(private_t * tech_pvt, char *value)
@@ -1571,18 +1571,18 @@
if (!switch_channel_test_flag(channel, CF_BRIDGED)) {
switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) };
- DEBUGA_SKYPE("received DTMF %c on channel %s\n", SKYPIAX_P_LOG, dtmf.digit, switch_channel_get_name(channel));
+ DEBUGA_CELLIAX("received DTMF %c on channel %s\n", CELLIAX_P_LOG, dtmf.digit, switch_channel_get_name(channel));
switch_mutex_lock(tech_pvt->flag_mutex);
//FIXME: why sometimes DTMFs from here do not seems to be get by FS?
switch_channel_queue_dtmf(channel, &dtmf);
switch_set_flag(tech_pvt, TFLAG_DTMF);
switch_mutex_unlock(tech_pvt->flag_mutex);
} else {
- DEBUGA_SKYPE
- ("received a DTMF on channel %s, but we're BRIDGED, so let's NOT relay it out of band\n", SKYPIAX_P_LOG, switch_channel_get_name(channel));
+ DEBUGA_CELLIAX
+ ("received a DTMF on channel %s, but we're BRIDGED, so let's NOT relay it out of band\n", CELLIAX_P_LOG, switch_channel_get_name(channel));
}
} else {
- WARNINGA("received %c DTMF, but no channel?\n", SKYPIAX_P_LOG, value[0]);
+ WARNINGA("received %c DTMF, but no channel?\n", CELLIAX_P_LOG, value[0]);
}
switch_core_session_rwunlock(session);
@@ -1596,16 +1596,16 @@
switch_channel_t *channel = NULL;
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));
+ DEBUGA_CELLIAX("2 SESSION_REQUEST %s\n", CELLIAX_P_LOG, switch_core_session_get_uuid(session));
switch_core_session_add_stream(session, NULL);
channel = switch_core_session_get_channel(session);
if (!channel) {
- ERRORA("Doh! no channel?\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no channel?\n", CELLIAX_P_LOG);
switch_core_session_destroy(&session);
return 0;
}
if (celliax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) {
- ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG);
+ ERRORA("Doh! no tech_init?\n", CELLIAX_P_LOG);
switch_core_session_destroy(&session);
return 0;
}
@@ -1622,7 +1622,7 @@
}
switch_channel_set_state(channel, CS_INIT);
if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) {
- ERRORA("Error spawning thread\n", SKYPIAX_P_LOG);
+ ERRORA("Error spawning thread\n", CELLIAX_P_LOG);
switch_core_session_destroy(&session);
return 0;
}
@@ -1631,7 +1631,7 @@
switch_channel_mark_answered(channel);
}
- DEBUGA_SKYPE("new_inbound_channel\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("new_inbound_channel\n", CELLIAX_P_LOG);
return 0;
}
@@ -1644,20 +1644,20 @@
if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
session = switch_core_session_locate(tech_pvt->session_uuid_str);
} else {
- ERRORA("No session???\n", SKYPIAX_P_LOG);
+ ERRORA("No session???\n", CELLIAX_P_LOG);
goto done;
}
if (session) {
channel = switch_core_session_get_channel(session);
} else {
- ERRORA("No session???\n", SKYPIAX_P_LOG);
+ ERRORA("No session???\n", CELLIAX_P_LOG);
goto done;
}
if (channel) {
switch_channel_mark_ring_ready(channel);
- DEBUGA_SKYPE("skype_call: REMOTE PARTY RINGING\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("celliax_call: REMOTE PARTY RINGING\n", CELLIAX_P_LOG);
} else {
- ERRORA("No channel???\n", SKYPIAX_P_LOG);
+ ERRORA("No channel???\n", CELLIAX_P_LOG);
}
switch_core_session_rwunlock(session);
@@ -1674,7 +1674,7 @@
if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
session = switch_core_session_locate(tech_pvt->session_uuid_str);
} else {
- ERRORA("No session???\n\n\n", SKYPIAX_P_LOG);
+ ERRORA("No session???\n\n\n", CELLIAX_P_LOG);
//TODO: kill the bastard
goto done;
}
@@ -1682,15 +1682,15 @@
channel = switch_core_session_get_channel(session);
switch_core_session_add_stream(session, NULL);
} else {
- ERRORA("No session???\n", SKYPIAX_P_LOG);
+ ERRORA("No session???\n", CELLIAX_P_LOG);
//TODO: kill the bastard
goto done;
}
if (channel) {
switch_channel_mark_pre_answered(channel);
- DEBUGA_SKYPE("skype_call: REMOTE PARTY EARLY MEDIA\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("celliax_call: REMOTE PARTY EARLY MEDIA\n", CELLIAX_P_LOG);
} else {
- ERRORA("No channel???\n", SKYPIAX_P_LOG);
+ ERRORA("No channel???\n", CELLIAX_P_LOG);
//TODO: kill the bastard
}
@@ -1708,28 +1708,28 @@
if (!switch_strlen_zero(tech_pvt->session_uuid_str)) {
session = switch_core_session_locate(tech_pvt->session_uuid_str);
} else {
- ERRORA("No session???\n", SKYPIAX_P_LOG);
+ ERRORA("No session???\n", CELLIAX_P_LOG);
goto done;
}
if (session) {
channel = switch_core_session_get_channel(session);
} else {
- ERRORA("No channel???\n", SKYPIAX_P_LOG);
+ ERRORA("No channel???\n", CELLIAX_P_LOG);
goto done;
}
if (channel) {
switch_channel_mark_answered(channel);
- tech_pvt->phone_callflow = SKYPIAX_STATE_UP;
- tech_pvt->interface_state = SKYPIAX_STATE_UP;
- //DEBUGA_SKYPE("skype_call: %s, answered\n", SKYPIAX_P_LOG, id);
+ tech_pvt->phone_callflow = CELLIAX_STATE_UP;
+ tech_pvt->interface_state = CELLIAX_STATE_UP;
+ //DEBUGA_CELLIAX("celliax_call: %s, answered\n", CELLIAX_P_LOG, id);
} else {
- ERRORA("No channel???\n", SKYPIAX_P_LOG);
+ ERRORA("No channel???\n", CELLIAX_P_LOG);
}
switch_core_session_rwunlock(session);
done:
- DEBUGA_SKYPE("outbound_channel_answered!\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("outbound_channel_answered!\n", CELLIAX_P_LOG);
return 0;
}
@@ -1738,7 +1738,7 @@
{
private_t *tech_pvt = NULL;
int i;
- //int num_interfaces = SKYPIAX_MAX_INTERFACES;
+ //int num_interfaces = CELLIAX_MAX_INTERFACES;
//int num_interfaces = globals.real_interfaces;
switch_mutex_lock(globals.mutex);
@@ -1747,35 +1747,35 @@
//XXX no, is just a convention, but you can have it start from 0. I do not, for aestetic reasons :-)
//if (globals.next_interface == 0) globals.next_interface = 1;
- for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
+ for (i = 0; i < CELLIAX_MAX_INTERFACES; i++) {
int interface_id;
interface_id = globals.next_interface;
- //interface_id = interface_id < SKYPIAX_MAX_INTERFACES ? interface_id : interface_id - SKYPIAX_MAX_INTERFACES + 1;
- globals.next_interface = interface_id + 1 < SKYPIAX_MAX_INTERFACES ? interface_id + 1 : 0;
+ //interface_id = interface_id < CELLIAX_MAX_INTERFACES ? interface_id : interface_id - CELLIAX_MAX_INTERFACES + 1;
+ globals.next_interface = interface_id + 1 < CELLIAX_MAX_INTERFACES ? interface_id + 1 : 0;
- if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) {
- int skype_state = 0;
+ if (strlen(globals.CELLIAX_INTERFACES[interface_id].name)) {
+ int celliax_state = 0;
- 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);
+ tech_pvt = &globals.CELLIAX_INTERFACES[interface_id];
+ celliax_state = tech_pvt->interface_state;
+ //DEBUGA_CELLIAX("celliax interface: %d, name: %s, state: %d\n", CELLIAX_P_LOG, interface_id, globals.CELLIAX_INTERFACES[interface_id].name, celliax_state);
+ if ((tech_pvt_calling ? strcmp(tech_pvt->celliax_user, tech_pvt_calling->celliax_user) : 1)
+ && (CELLIAX_STATE_DOWN == celliax_state || 0 == celliax_state) && (tech_pvt->phone_callflow == CALLFLOW_STATUS_FINISHED
+ || 0 == tech_pvt->phone_callflow)) {
+ DEBUGA_CELLIAX("returning as available celliax interface name: %s, state: %d callflow: %d\n", CELLIAX_P_LOG, tech_pvt->name, celliax_state,
+ tech_pvt->phone_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;
+ tech_pvt->interface_state = CELLIAX_STATE_SELECTED;
}
switch_mutex_unlock(globals.mutex);
return tech_pvt;
}
} // else {
- //DEBUGA_SKYPE("Skype interface: %d blank!! A hole here means we cannot hunt the last interface.\n", SKYPIAX_P_LOG, interface_id);
+ //DEBUGA_CELLIAX("GSM interface: %d blank!! A hole here means we cannot hunt the last interface.\n", CELLIAX_P_LOG, interface_id);
//}
}
@@ -1809,20 +1809,20 @@
stream->write_function(stream, "F ID\t Name \tIB (F/T) OB (F/T)\tState\tCallFlw\t\tUUID\n");
stream->write_function(stream, "= ====\t ======== \t======= =======\t======\t============\t======\n");
- for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) {
+ for (i = 0; i < CELLIAX_MAX_INTERFACES; i++) {
next_flag_char = i == globals.next_interface ? '*' : ' ';
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)) {
stream->write_function(stream,
"%c %d\t[%s]\t%3ld/%ld\t%6ld/%ld\t%s\t%s\t%s\n",
next_flag_char,
- i, globals.SKYPIAX_INTERFACES[i].name,
- globals.SKYPIAX_INTERFACES[i].ib_failed_calls,
- globals.SKYPIAX_INTERFACES[i].ib_calls,
- globals.SKYPIAX_INTERFACES[i].ob_failed_calls,
- globals.SKYPIAX_INTERFACES[i].ob_calls,
- interface_status[globals.SKYPIAX_INTERFACES[i].interface_state],
- skype_callflow[globals.SKYPIAX_INTERFACES[i].skype_callflow], globals.SKYPIAX_INTERFACES[i].session_uuid_str);
+ i, globals.CELLIAX_INTERFACES[i].name,
+ globals.CELLIAX_INTERFACES[i].ib_failed_calls,
+ globals.CELLIAX_INTERFACES[i].ib_calls,
+ globals.CELLIAX_INTERFACES[i].ob_failed_calls,
+ globals.CELLIAX_INTERFACES[i].ob_calls,
+ interface_status[globals.CELLIAX_INTERFACES[i].interface_state],
+ phone_callflow[globals.CELLIAX_INTERFACES[i].phone_callflow], globals.CELLIAX_INTERFACES[i].session_uuid_str);
} else if (argc > 1 && !strcasecmp(argv[1], "full")) {
stream->write_function(stream, "%c\t%d\n", next_flag_char, i);
}
@@ -1835,12 +1835,12 @@
int found = 0;
if (argc == 2) {
- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
+ for (i = 0; !found && i < CELLIAX_MAX_INTERFACES; i++) {
/* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)
- && (strncmp(globals.SKYPIAX_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) {
- globals.sk_console = &globals.SKYPIAX_INTERFACES[i];
- stream->write_function(stream, "sk console is now: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPIAX_INTERFACES[i].name);
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)
+ && (strncmp(globals.CELLIAX_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) {
+ globals.sk_console = &globals.CELLIAX_INTERFACES[i];
+ stream->write_function(stream, "sk console is now: globals.CELLIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.CELLIAX_INTERFACES[i].name);
stream->write_function(stream, "sk console is: |||%s|||\n", globals.sk_console->name);
found = 1;
break;
@@ -1848,7 +1848,7 @@
}
if (!found)
- stream->write_function(stream, "ERROR: A Skypiax interface with name='%s' was not found\n", argv[1]);
+ stream->write_function(stream, "ERROR: A Celliax interface with name='%s' was not found\n", argv[1]);
} else {
stream->write_function(stream, "-ERR Usage: sk console interface_name\n");
@@ -1898,12 +1898,12 @@
}
if (!argc) {
- stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX);
+ stream->write_function(stream, "ERROR, usage: %s", CELLIAX_SYNTAX);
goto end;
}
if (argc < 2) {
- stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX);
+ stream->write_function(stream, "ERROR, usage: %s", CELLIAX_SYNTAX);
goto end;
}
@@ -1911,19 +1911,19 @@
int i;
int found = 0;
- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
+ for (i = 0; !found && i < CELLIAX_MAX_INTERFACES; i++) {
/* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)
- && (strncmp(globals.SKYPIAX_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) {
- tech_pvt = &globals.SKYPIAX_INTERFACES[i];
- stream->write_function(stream, "Using interface: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPIAX_INTERFACES[i].name);
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)
+ && (strncmp(globals.CELLIAX_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) {
+ tech_pvt = &globals.CELLIAX_INTERFACES[i];
+ stream->write_function(stream, "Using interface: globals.CELLIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.CELLIAX_INTERFACES[i].name);
found = 1;
break;
}
}
if (!found) {
- stream->write_function(stream, "ERROR: A Skypiax interface with name='%s' was not found\n", argv[0]);
+ stream->write_function(stream, "ERROR: A Celliax interface with name='%s' was not found\n", argv[0]);
switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS;
@@ -1931,7 +1931,7 @@
//celliax_signaling_write(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]);
}
} else {
- stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX);
+ stream->write_function(stream, "ERROR, usage: %s", CELLIAX_SYNTAX);
}
end:
switch_safe_free(mycmd);
@@ -1963,11 +1963,11 @@
int i;
int found = 0;
- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
+ for (i = 0; !found && i < CELLIAX_MAX_INTERFACES; i++) {
/* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)
- && (strncmp(globals.SKYPIAX_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) {
- tech_pvt = &globals.SKYPIAX_INTERFACES[i];
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)
+ && (strncmp(globals.CELLIAX_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) {
+ tech_pvt = &globals.CELLIAX_INTERFACES[i];
stream->write_function(stream, "Trying to send your SMS: interface=%s, dest=%s, text=%s\n", argv[0], argv[1], argv[2]);
found = 1;
break;
@@ -1975,7 +1975,7 @@
}
if (!found) {
- stream->write_function(stream, "ERROR: A Skypiax interface with name='%s' was not found\n", argv[0]);
+ stream->write_function(stream, "ERROR: A Celliax interface with name='%s' was not found\n", argv[0]);
switch_safe_free(mycmd);
return SWITCH_STATUS_SUCCESS;
@@ -1994,7 +1994,7 @@
int celliax_transfer(private_t * tech_pvt, char *id, char *value)
{
- char msg_to_skype[1024];
+ char msg_to_celliax[1024];
int i;
int found = 0;
private_t *giovatech;
@@ -2003,17 +2003,17 @@
switch_mutex_lock(globals.mutex);
gettimeofday(&timenow, NULL);
- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
+ for (i = 0; !found && i < CELLIAX_MAX_INTERFACES; i++) {
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)) {
- giovatech = &globals.SKYPIAX_INTERFACES[i];
- //NOTICA("skype interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->skype_user=%s\n", SKYPIAX_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->skype_user);
+ giovatech = &globals.CELLIAX_INTERFACES[i];
+ //NOTICA("celliax interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->celliax_user=%s\n", CELLIAX_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->celliax_user);
//FIXME check a timestamp here
- if (strlen(giovatech->skype_call_id) && (giovatech->interface_state != SKYPIAX_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 500000)) { //0.5sec
+ if (strlen(giovatech->celliax_call_id) && (giovatech->interface_state != CELLIAX_STATE_DOWN) && (!strcmp(giovatech->celliax_user, tech_pvt->celliax_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 500000)) { //0.5sec
found = 1;
- DEBUGA_SKYPE
- ("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)
+ DEBUGA_CELLIAX
+ ("FOUND (name=%s, giovatech->interface_state=%d != CELLIAX_STATE_DOWN) && (giovatech->celliax_user=%s == tech_pvt->celliax_user=%s) && (giovatech->callid_number=%s == value=%s)\n",
+ CELLIAX_P_LOG, giovatech->name, giovatech->interface_state, giovatech->celliax_user, tech_pvt->celliax_user, giovatech->callid_number, value)
break;
}
}
@@ -2021,16 +2021,16 @@
if (found) {
//tech_pvt->callid_number[0]='\0';
- //sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- //celliax_signaling_write(tech_pvt, msg_to_skype);
+ //sprintf(msg_to_celliax, "ALTER CALL %s END HANGUP", id);
+ //celliax_signaling_write(tech_pvt, msg_to_celliax);
switch_mutex_unlock(globals.mutex);
return 0;
}
- DEBUGA_SKYPE("NOT FOUND\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("NOT FOUND\n", CELLIAX_P_LOG);
- if (!tech_pvt || !tech_pvt->skype_call_id || !strlen(tech_pvt->skype_call_id)) {
+ if (!tech_pvt || !tech_pvt->celliax_call_id || !strlen(tech_pvt->celliax_call_id)) {
/* we are not inside an active call */
- DEBUGA_SKYPE("We're NO MORE in a call now %s\n", SKYPIAX_P_LOG, (tech_pvt && tech_pvt->skype_call_id) ? tech_pvt->skype_call_id : "");
+ DEBUGA_CELLIAX("We're NO MORE in a call now %s\n", CELLIAX_P_LOG, (tech_pvt && tech_pvt->celliax_call_id) ? tech_pvt->celliax_call_id : "");
switch_mutex_unlock(globals.mutex);
} else {
@@ -2045,18 +2045,18 @@
private_t *available_celliax_interface = NULL;
gettimeofday(&timenow, NULL);
- for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) {
- if (strlen(globals.SKYPIAX_INTERFACES[i].name)) {
+ for (i = 0; !found && i < CELLIAX_MAX_INTERFACES; i++) {
+ if (strlen(globals.CELLIAX_INTERFACES[i].name)) {
- giovatech = &globals.SKYPIAX_INTERFACES[i];
- //NOTICA("skype interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->skype_user=%s\n", SKYPIAX_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->skype_user);
+ giovatech = &globals.CELLIAX_INTERFACES[i];
+ //NOTICA("celliax interface: %d, name: %s, state: %d, value=%s, giovatech->callid_number=%s, giovatech->celliax_user=%s\n", CELLIAX_P_LOG, i, giovatech->name, giovatech->interface_state, value, giovatech->callid_number, giovatech->celliax_user);
//FIXME check a timestamp here
- if (strlen(giovatech->skype_transfer_call_id) && (giovatech->interface_state != SKYPIAX_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->transfer_callid_number, value)) && ((((timenow.tv_sec - giovatech->transfer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->transfer_time.tv_usec)) < 1000000)) { //1.0 sec
+ if (strlen(giovatech->celliax_transfer_call_id) && (giovatech->interface_state != CELLIAX_STATE_DOWN) && (!strcmp(giovatech->celliax_user, tech_pvt->celliax_user)) && (!strcmp(giovatech->transfer_callid_number, value)) && ((((timenow.tv_sec - giovatech->transfer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->transfer_time.tv_usec)) < 1000000)) { //1.0 sec
found = 1;
- DEBUGA_SKYPE
- ("FOUND (name=%s, giovatech->interface_state=%d != SKYPIAX_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->transfer_callid_number=%s == value=%s)\n",
- SKYPIAX_P_LOG, giovatech->name, giovatech->interface_state,
- giovatech->skype_user, tech_pvt->skype_user, giovatech->transfer_callid_number, value)
+ DEBUGA_CELLIAX
+ ("FOUND (name=%s, giovatech->interface_state=%d != CELLIAX_STATE_DOWN) && (giovatech->celliax_user=%s == tech_pvt->celliax_user=%s) && (giovatech->transfer_callid_number=%s == value=%s)\n",
+ CELLIAX_P_LOG, giovatech->name, giovatech->interface_state,
+ giovatech->celliax_user, tech_pvt->celliax_user, giovatech->transfer_callid_number, value)
break;
}
}
@@ -2064,12 +2064,12 @@
if (found) {
//tech_pvt->callid_number[0]='\0';
- //sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id);
- //celliax_signaling_write(tech_pvt, msg_to_skype);
+ //sprintf(msg_to_celliax, "ALTER CALL %s END HANGUP", id);
+ //celliax_signaling_write(tech_pvt, msg_to_celliax);
switch_mutex_unlock(globals.mutex);
return 0;
}
- DEBUGA_SKYPE("NOT FOUND\n", SKYPIAX_P_LOG);
+ DEBUGA_CELLIAX("NOT FOUND\n", CELLIAX_P_LOG);
available_celliax_interface = find_available_celliax_interface_rr(tech_pvt);
if (available_celliax_interface) {
@@ -2077,57 +2077,57 @@
//FIXME write a timestamp here
gettimeofday(&tech_pvt->transfer_time, NULL);
- switch_copy_string(tech_pvt->skype_transfer_call_id, id, sizeof(tech_pvt->skype_transfer_call_id) - 1);
+ switch_copy_string(tech_pvt->celliax_transfer_call_id, id, sizeof(tech_pvt->celliax_transfer_call_id) - 1);
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 celliax call(%s)\n",
- SKYPIAX_P_LOG, tech_pvt->skype_call_id, available_celliax_interface->name, available_celliax_interface->skype_user, id);
+ DEBUGA_CELLIAX
+ ("Let's transfer the celliax_call %s to %s interface (with celliax_user: %s), because we are already in a celliax call(%s)\n",
+ CELLIAX_P_LOG, tech_pvt->celliax_call_id, available_celliax_interface->name, available_celliax_interface->celliax_user, id);
//FIXME why this? the inbound call will come, eventually, on that other interface
//available_celliax_interface->ib_calls++;
- 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
+ sprintf(msg_to_celliax, "ALTER CALL %s TRANSFER %s", id, available_celliax_interface->celliax_user);
+ //celliax_signaling_write(tech_pvt, msg_to_celliax);
+ if (tech_pvt->interface_state == CELLIAX_STATE_SELECTED) {
+ tech_pvt->interface_state = CELLIAX_STATE_IDLE; //we marked it CELLIAX_STATE_SELECTED just in case it has to make an outbound call
}
} else {
/* no celliax interfaces idle, do nothing */
- DEBUGA_SKYPE
- ("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);
- //celliax_signaling_write(tech_pvt, msg_to_skype);
+ DEBUGA_CELLIAX
+ ("Not answering the celliax_call %s, because we are already in a celliax call(%s) and not transferring, because no other celliax interfaces are available\n",
+ CELLIAX_P_LOG, id, tech_pvt->celliax_call_id);
+ sprintf(msg_to_celliax, "ALTER CALL %s END HANGUP", id);
+ //celliax_signaling_write(tech_pvt, msg_to_celliax);
}
switch_sleep(10000);
- DEBUGA_SKYPE
- ("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);
+ DEBUGA_CELLIAX
+ ("We have NOT answered a GSM RING from celliax_call %s, because we are already in a celliax call (%s)\n",
+ CELLIAX_P_LOG, id, tech_pvt->celliax_call_id);
switch_mutex_unlock(globals.mutex);
}
return 0;
}
-void *celliax_do_skypeapi_thread_func(void *obj)
+void *celliax_do_celliaxapi_thread_func(void *obj)
{
private_t *tech_pvt = obj;
- //if (celliax_present(SkypiaxHandles))
+ //if (celliax_present(CelliaxHandles))
if (1) {
while (running) {
int res;
//celliax_sleep(1000000); //1 sec
- //DEBUGA_SKYPE("ciao!\n", SKYPIAX_P_LOG);
+ //DEBUGA_CELLIAX("ciao!\n", CELLIAX_P_LOG);
res = celliax_serial_read(tech_pvt);
if (res == -1) { //manage the graceful interface shutdown
tech_pvt->controldev_dead = 1;
close(tech_pvt->controldevfd);
- ERRORA("celliax_serial_monitor failed, declaring %s dead\n", SKYPIAX_P_LOG, tech_pvt->controldevice_name);
- } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == SKYPIAX_STATE_RING) {
- WARNINGA("INCOMING RING, let's take the incoming call\n", SKYPIAX_P_LOG);
+ ERRORA("celliax_serial_monitor failed, declaring %s dead\n", CELLIAX_P_LOG, tech_pvt->controldevice_name);
+ } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == CELLIAX_STATE_RING) {
+ WARNINGA("INCOMING RING, let's take the incoming call\n", CELLIAX_P_LOG);
celliax_answer(tech_pvt);
//new_inbound_channel(tech_pvt);
//FIXME if (!celliax_new(p, AST_STATE_RING, tech_pvt->context)) {
@@ -2135,8 +2135,8 @@
//FIXME }
- } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == SKYPIAX_STATE_DIALING) {
- WARNINGA("WE'RE DIALING, let's take the earlymedia\n", SKYPIAX_P_LOG);
+ } else if (tech_pvt->controldevprotocol != PROTOCOL_NO_SERIAL && tech_pvt->interface_state == CELLIAX_STATE_DIALING) {
+ WARNINGA("WE'RE DIALING, let's take the earlymedia\n", CELLIAX_P_LOG);
tech_pvt->interface_state = CALLFLOW_STATUS_EARLYMEDIA;
remote_party_is_early_media(tech_pvt);
//new_inbound_channel(tech_pvt);
@@ -2148,7 +2148,7 @@
} else if (tech_pvt->interface_state == CALLFLOW_CALL_REMOTEANSWER) {
- WARNINGA("REMOTE PARTY ANSWERED\n", SKYPIAX_P_LOG);
+ WARNINGA("REMOTE PARTY ANSWERED\n", CELLIAX_P_LOG);
outbound_channel_answered(tech_pvt);
//new_inbound_channel(tech_pvt);
//FIXME if (!celliax_new(p, AST_STATE_RING, tech_pvt->context)) {
@@ -2158,7 +2158,7 @@
usleep(100); //give other threads a chance
}
} else {
- ERRORA("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", SKYPIAX_P_LOG);
+ ERRORA("GSM is not running, maybe crashed. Please run/restart GSM and relaunch Celliax\n", CELLIAX_P_LOG);
running = 0;
return NULL;
}