Modified: freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c (14618 => 14619)
--- freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c 2009-08-24 14:16:19 UTC (rev 14618)
+++ freeswitch/branches/gmaruzz/mod_celliax/celliax_protocol.c 2009-08-24 16:55:31 UTC (rev 14619)
@@ -1564,7 +1564,496 @@
+int celliax_serial_init(private_t *tech_pvt, speed_t controldevice_speed)
+{
+ int fd;
+ int rt;
+ struct termios tp;
+/* if there is a file descriptor, close it. But it is probably just an old value, so don't check for close success*/
+ fd = tech_pvt->controldevfd;
+ if (fd) {
+ close(fd);
+ }
+/* open the serial port */
+#ifdef __CYGWIN__
+ fd = open(tech_pvt->controldevice_name, O_RDWR | O_NOCTTY | O_NONBLOCK);
+ sleep(1);
+ close(fd);
+#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));
+ tech_pvt->controldevfd = fd;
+ return -1;
+ }
+/* flush it */
+ rt = tcflush(fd, TCIFLUSH);
+ if (rt == -1) {
+ ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ }
+/* attributes */
+ tp.c_cflag = B0 | CS8 | CLOCAL | CREAD | HUPCL;
+ tp.c_iflag = IGNPAR;
+ tp.c_cflag &= ~CRTSCTS;
+ tp.c_oflag = 0;
+ tp.c_lflag = 0;
+ tp.c_cc[VMIN] = 1;
+ tp.c_cc[VTIME] = 0;
+/* set controldevice_speed */
+ rt = cfsetispeed(&tp, tech_pvt->controldevice_speed);
+ if (rt == -1) {
+ ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ }
+ rt = cfsetospeed(&tp, tech_pvt->controldevice_speed);
+ if (rt == -1) {
+ ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ }
+/* set port attributes */
+ if (tcsetattr(fd, TCSADRAIN, &tp) == -1) {
+ ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ }
+ rt = tcsetattr(fd, TCSANOW, &tp);
+ if (rt == -1) {
+ ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
+ }
+ unsigned int status = 0;
+#ifndef __CYGWIN__
+ ioctl(fd, TIOCMGET, &status);
+ status |= TIOCM_DTR; /* Set DTR high */
+ status &= ~TIOCM_RTS; /* Set RTS low */
+ ioctl(fd, TIOCMSET, &status);
+ ioctl(fd, TIOCMGET, &status);
+ unsigned int flags = TIOCM_DTR;
+ ioctl(fd, TIOCMBIS, &flags);
+ flags = TIOCM_RTS;
+ ioctl(fd, TIOCMBIC, &flags);
+ ioctl(fd, TIOCMGET, &status);
+#else /* __CYGWIN__ */
+ ioctl(fd, TIOCMGET, &status);
+ status |= TIOCM_DTR; /* Set DTR high */
+ status &= ~TIOCM_RTS; /* Set RTS low */
+ ioctl(fd, TIOCMSET, &status);
+#endif /* __CYGWIN__ */
+ tech_pvt->controldevfd = fd;
+ DEBUGA_SKYPE("Syncing Serial\n", SKYPIAX_P_LOG);
+ rt = celliax_serial_sync(tech_pvt);
+ if (rt == -1) {
+ ERRORA("Serial init error\n", SKYPIAX_P_LOG);
+ return -1;
+ }
+ return (fd);
+}
+
+int celliax_serial_sync(private_t * tech_pvt)
+{
+ if (tech_pvt->controldevprotocol == PROTOCOL_AT)
+ return celliax_serial_sync_AT(tech_pvt);
+#ifdef CELLIAX_FBUS2
+ if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2)
+ return celliax_serial_sync_FBUS2(tech_pvt);
+#endif /* CELLIAX_FBUS2 */
+#ifdef CELLIAX_CVM
+ if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
+ return celliax_serial_sync_CVM_BUSMAIL(tech_pvt);
+#endif /* CELLIAX_CVM */
+
+ return -1;
+}
+
+int celliax_serial_config(private_t * tech_pvt)
+{
+ if (tech_pvt->controldevprotocol == PROTOCOL_AT)
+ return celliax_serial_config_AT(tech_pvt);
+#ifdef CELLIAX_FBUS2
+ if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2)
+ return celliax_serial_config_FBUS2(tech_pvt);
+#endif /* CELLIAX_FBUS2 */
+#ifdef CELLIAX_CVM
+ if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
+ return celliax_serial_config_CVM_BUSMAIL(tech_pvt);
+#endif /* CELLIAX_CVM */
+ return -1;
+}
+
+int celliax_serial_config_AT(private_t * tech_pvt)
+{
+ int res;
+
+/* initial_pause? */
+ if (tech_pvt->at_initial_pause) {
+ DEBUGA_SKYPE("sleeping for %d usec\n", SKYPIAX_P_LOG, tech_pvt->at_initial_pause);
+ usleep(tech_pvt->at_initial_pause);
+ }
+
+/* go until first empty preinit string, or last preinit string */
+ while (1) {
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ break;
+ }
+
+/* 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);
+ 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);
+ 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);
+ }
+ usleep(50000);
+ /* for motorola end */
+
+ /* 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);
+ }
+
+ /* disable AT command echo */
+ res = celliax_serial_write_AT_ack(tech_pvt, "ATE0");
+ if (res) {
+ DEBUGA_SKYPE("ATE0 failed\n", SKYPIAX_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);
+ }
+
+ /* various phone manufacturer identifier */
+ char at_command[5];
+ int i;
+ for (i = 0; i < 10; i++) {
+ memset(at_command, 0, sizeof(at_command));
+ 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);
+ }
+ }
+
+ /* phone manufacturer */
+ res = celliax_serial_write_AT_ack(tech_pvt, "AT+CGMI");
+ if (res) {
+ DEBUGA_SKYPE("AT+CGMI failed\n", SKYPIAX_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);
+ }
+
+ res = celliax_serial_write_AT_ack(tech_pvt, "AT+CGSN");
+ if (res) {
+ DEBUGA_SKYPE("AT+CGSN failed\n", SKYPIAX_P_LOG);
+ }
+
+/* this take a lot of time to complete on devices with slow serial link (eg.: 9600bps) */
+#if 0
+ /* ask for the list of supported AT commands, useful to implement new models and debugging */
+ res = celliax_serial_write_AT_ack(tech_pvt, "AT+CLAC");
+ if (res) {
+ DEBUGA_SKYPE("AT+CLAC failed, continue\n", SKYPIAX_P_LOG);
+ }
+#endif
+ /* 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);
+ 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);
+ }
+ /* 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);
+ }
+ 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);
+ 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);
+ }
+
+ 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);
+ 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);
+ }
+ //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);
+ }
+ } 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);
+ }
+ }
+
+ /* 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);
+ }
+ /* 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);
+ }
+
+ /* 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);
+ }
+
+ /* 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);
+ }
+ /* 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);
+ tech_pvt->at_has_ecam = 0;
+ } else {
+ tech_pvt->at_has_ecam = 1;
+ }
+
+ /* 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);
+ tech_pvt->at_has_clcc = 0;
+ } else {
+ tech_pvt->at_has_clcc = 1;
+ }
+
+ /* 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);
+ }
+ /* 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);
+ }
+ /* for motorola end */
+
+/* go until first empty postinit string, or last postinit string */
+ while (1) {
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ 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);
+ }
+ } else {
+ break;
+ }
+
+ break;
+ }
+
+ return 0;
+}
+
+
+#ifdef NOTDEF
+int celliax_serial_getstatus(private_t * tech_pvt)
+{
+ if (tech_pvt->controldevprotocol == PROTOCOL_AT)
+ return celliax_serial_getstatus_AT(tech_pvt);
+#ifdef CELLIAX_FBUS2
+ if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2)
+ return celliax_serial_getstatus_FBUS2(tech_pvt);
+#endif /* CELLIAX_FBUS2 */
+
+#ifdef CELLIAX_CVM
+ if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
+ return celliax_serial_getstatus_CVM_BUSMAIL(tech_pvt);
+#endif /* CELLIAX_CVM */
+ return -1;
+}
+
+int celliax_serial_read(private_t * tech_pvt)
+{
+ if (tech_pvt->controldevprotocol == PROTOCOL_AT)
+ return celliax_serial_read_AT(tech_pvt, 0, 100000, 0, NULL, 1); // a 10th of a second timeout
+#ifdef CELLIAX_FBUS2
+ if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2)
+ return celliax_serial_read_FBUS2(tech_pvt);
+#endif /* CELLIAX_FBUS2 */
+#ifdef CELLIAX_CVM
+ if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
+ return celliax_serial_read_CVM_BUSMAIL(tech_pvt);
+#endif /* CELLIAX_CVM */
+ return -1;
+}
+
+int celliax_serial_hangup(private_t * tech_pvt)
+{
+ if (tech_pvt->controldevprotocol == PROTOCOL_AT)
+ return celliax_serial_hangup_AT(tech_pvt);
+#ifdef CELLIAX_FBUS2
+ if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2)
+ return celliax_serial_hangup_FBUS2(tech_pvt);
+#endif /* CELLIAX_FBUS2 */
+#ifdef CELLIAX_CVM
+ if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
+ return celliax_serial_hangup_CVM_BUSMAIL(tech_pvt);
+#endif /* CELLIAX_CVM */
+ return -1;
+}
+
+int celliax_serial_answer(private_t * tech_pvt)
+{
+ if (tech_pvt->controldevprotocol == PROTOCOL_AT)
+ return celliax_serial_answer_AT(tech_pvt);
+#ifdef CELLIAX_FBUS2
+ if (tech_pvt->controldevprotocol == PROTOCOL_FBUS2)
+ return celliax_serial_answer_FBUS2(tech_pvt);
+#endif /* CELLIAX_FBUS2 */
+#ifdef CELLIAX_CVM
+ if (tech_pvt->controldevprotocol == PROTOCOL_CVM_BUSMAIL)
+ return celliax_serial_answer_CVM_BUSMAIL(tech_pvt);
+#endif /* CELLIAX_CVM */
+ return -1;
+}
+#endif //NOTDEF
+
+
#undef CELLIAX_ADDITIONAL
#ifdef CELLIAX_ADDITIONAL
@@ -1575,7 +2064,7 @@
extern int celliax_debug;
extern char *celliax_console_active;
extern char celliax_type[];
-extern struct celliax_pvt *celliax_iflist;
+extern private_t *celliax_iflist;
extern int celliax_dir_entry_extension;
#ifndef GIOVA48
@@ -1600,22 +2089,22 @@
*
* \return zero on success, -1 on error.
*/
-int alsa_init(struct celliax_pvt *p)
+int alsa_init(private_t * tech_pvt)
{
- p->alsac = alsa_open_dev(p, SND_PCM_STREAM_CAPTURE);
+ tech_pvt->alsac = alsa_open_dev(p, SND_PCM_STREAM_CAPTURE);
if (!p->alsac) {
- ERRORA("Failed opening ALSA capture device: %s\n", CELLIAX_P_LOG, p->alsacname);
+ ERRORA("Failed opening ALSA capture device: %s\n", SKYPIAX_P_LOG, p->alsacname);
if (alsa_shutdown(p)) {
- ERRORA("alsa_shutdown failed\n", CELLIAX_P_LOG);
+ ERRORA("alsa_shutdown failed\n", SKYPIAX_P_LOG);
return -1;
}
return -1;
}
p->alsap = alsa_open_dev(p, SND_PCM_STREAM_PLAYBACK);
if (!p->alsap) {
- ERRORA("Failed opening ALSA playback device: %s\n", CELLIAX_P_LOG, p->alsapname);
+ ERRORA("Failed opening ALSA playback device: %s\n", SKYPIAX_P_LOG, p->alsapname);
if (alsa_shutdown(p)) {
- ERRORA("alsa_shutdown failed\n", CELLIAX_P_LOG);
+ ERRORA("alsa_shutdown failed\n", SKYPIAX_P_LOG);
return -1;
}
return -1;
@@ -1635,7 +2124,7 @@
* \return zero on success, -1 on error.
*/
-int alsa_shutdown(struct celliax_pvt *p)
+int alsa_shutdown(private_t * tech_pvt)
{
int err;
@@ -1643,13 +2132,13 @@
if (p->alsap) {
err = snd_pcm_drop(p->alsap);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", CELLIAX_P_LOG,
+ ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", SKYPIAX_P_LOG,
p->alsapname, snd_strerror(err));
return -1;
}
err = snd_pcm_close(p->alsap);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", CELLIAX_P_LOG,
+ ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", SKYPIAX_P_LOG,
p->alsapname, snd_strerror(err));
return -1;
}
@@ -1657,13 +2146,13 @@
if (p->alsac) {
err = snd_pcm_drop(p->alsac);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", CELLIAX_P_LOG,
+ ERRORA("device [%s], snd_pcm_drop failed with error '%s'\n", SKYPIAX_P_LOG,
p->alsacname, snd_strerror(err));
return -1;
}
err = snd_pcm_close(p->alsac);
if (err < 0) {
- ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", CELLIAX_P_LOG,
+ ERRORA("device [%s], snd_pcm_close failed with error '%s'\n", SKYPIAX_P_LOG,
p->alsacname, snd_strerror(err));
return -1;
}
@@ -1681,7 +2170,7 @@
*
* \return zero on success, -1 on error.
*/
-snd_pcm_t *alsa_open_dev(struct celliax_pvt * p, snd_pcm_stream_t stream)
+snd_pcm_t *alsa_open_dev(private_t * p, snd_pcm_stream_t stream)
{
snd_pcm_t *handle = NULL;
@@ -1713,7 +2202,7 @@
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", CELLIAX_P_LOG, snd_strerror(err),
+ " is running?\n", SKYPIAX_P_LOG, snd_strerror(err),
stream == SND_PCM_STREAM_CAPTURE ? p->alsacname : p->alsapname);
return NULL;
}
@@ -1721,47 +2210,47 @@
snd_pcm_info_alloca(&info);
if ((err = snd_pcm_info(handle, info)) < 0) {
- ERRORA("info error: %s", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("info error: %s", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_nonblock(handle, 1);
if (err < 0) {
- ERRORA("nonblock setting error: %s", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("nonblock setting error: %s", SKYPIAX_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",
- CELLIAX_P_LOG, snd_strerror(err));
+ SKYPIAX_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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Access type not available: %s\n", SKYPIAX_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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Sample format non available: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
err = snd_pcm_hw_params_set_channels(handle, params, 1);
if (err < 0) {
- DEBUGA_SOUND("Channels count set failed: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ DEBUGA_SOUND("Channels count set failed: %s\n", SKYPIAX_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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Channels count non available: %s\n", SKYPIAX_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", 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,
+ 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,
p->alsapname, p->alsacname);
return NULL;
} else {
@@ -1817,12 +2306,12 @@
err = snd_pcm_hw_params_set_rate_near(handle, params, &rate, 0);
if ((float) p->celliax_sound_rate * 1.05 < rate
|| (float) p->celliax_sound_rate * 0.95 > rate) {
- WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", CELLIAX_P_LOG,
+ WARNINGA("Rate is not accurate (requested = %iHz, got = %iHz)\n", SKYPIAX_P_LOG,
p->celliax_sound_rate, rate);
}
if (err < 0) {
- ERRORA("Error setting rate: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting rate: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
p->celliax_sound_rate = rate;
@@ -1830,7 +2319,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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting period_size: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
@@ -1841,21 +2330,21 @@
err = snd_pcm_hw_params_set_buffer_size_near(handle, params, &p->alsa_buffer_size);
if (err < 0) {
- ERRORA("Error setting buffer_size: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting buffer_size: %s\n", SKYPIAX_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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Unable to install hw params: %s\n", SKYPIAX_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", CELLIAX_P_LOG,
+ ERRORA("Can't use period equal to buffer size (%lu == %lu)\n", SKYPIAX_P_LOG,
chunk_size, buffer_size);
return NULL;
}
@@ -1865,24 +2354,24 @@
#if 0
err = snd_pcm_sw_params_get_xfer_align(swparams, &xfer_align);
if (err < 0) {
- ERRORA("Unable to obtain xfer align: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Unable to obtain xfer align: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
- NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align);
+ NOTICA("xfer_align: %d\n", SKYPIAX_P_LOG, xfer_align);
/* for some reason, on some platforms, xfer_align here is zero, that gives a floating point exception later. So, let's try to force it to 160, the frame size used by celliax */
xfer_align = p->alsa_period_size;
- NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align);
+ NOTICA("xfer_align: %d\n", SKYPIAX_P_LOG, xfer_align);
err = snd_pcm_sw_params_set_xfer_align(handle, swparams, xfer_align);
if (err < 0) {
- ERRORA("Error setting xfer_align: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting xfer_align: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
- NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align);
+ NOTICA("xfer_align: %d\n", SKYPIAX_P_LOG, xfer_align);
err = snd_pcm_sw_params_get_xfer_align(swparams, &xfer_align);
if (err < 0) {
- ERRORA("Unable to obtain xfer align: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Unable to obtain xfer align: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
- NOTICA("xfer_align: %d\n", CELLIAX_P_LOG, xfer_align);
+ NOTICA("xfer_align: %d\n", SKYPIAX_P_LOG, xfer_align);
#endif
/*
@@ -1892,13 +2381,13 @@
0);
if (err < 0) {
- ERRORA("Error setting slep_min: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting slep_min: %s\n", SKYPIAX_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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting avail_min: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
#if 0
/* round up to closest transfer boundary */
@@ -1922,7 +2411,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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting start_threshold: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
if (stop_delay <= 0)
@@ -1937,39 +2426,39 @@
err = snd_pcm_sw_params_set_stop_threshold(handle, swparams, stop_threshold);
if (err < 0) {
- ERRORA("Error setting stop_threshold: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting stop_threshold: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
#if 0
err = snd_pcm_sw_params_set_xfer_align(handle, swparams, xfer_align);
if (err < 0) {
- ERRORA("Error setting xfer_align: %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("Error setting xfer_align: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
#endif
if (snd_pcm_sw_params(handle, swparams) < 0) {
- ERRORA("Error installing software parameters: %s\n", CELLIAX_P_LOG,
+ ERRORA("Error installing software parameters: %s\n", SKYPIAX_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", CELLIAX_P_LOG,
+ ERRORA("Unable to get a poll descriptors count, error is %s\n", SKYPIAX_P_LOG,
snd_strerror(err));
return NULL;
}
if (err != 1) { //number of poll descriptors
- DEBUGA_SOUND("Can't handle more than one device\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("Can't handle more than one device\n", SKYPIAX_P_LOG);
return NULL;
}
err = snd_pcm_poll_descriptors(handle, &p->pfd, err);
if (err != 1) {
- ERRORA("snd_pcm_poll_descriptors failed, %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_pcm_poll_descriptors failed, %s\n", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
- DEBUGA_SOUND("Acquired fd %d from the poll descriptor\n", CELLIAX_P_LOG, p->pfd.fd);
+ DEBUGA_SOUND("Acquired fd %d from the poll descriptor\n", SKYPIAX_P_LOG, p->pfd.fd);
if (stream == SND_PCM_STREAM_CAPTURE) {
p->celliax_sound_capt_fd = p->pfd.fd;
@@ -1981,37 +2470,37 @@
if (state != SND_PCM_STATE_PREPARED) {
err = snd_pcm_prepare(handle);
if (err) {
- ERRORA("snd_pcm_prepare failed, %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_pcm_prepare failed, %s\n", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
- DEBUGA_SOUND("prepared!\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("prepared!\n", SKYPIAX_P_LOG);
}
if (stream == SND_PCM_STREAM_CAPTURE) {
err = snd_pcm_start(handle);
if (err) {
- ERRORA("snd_pcm_start failed, %s\n", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_pcm_start failed, %s\n", SKYPIAX_P_LOG, snd_strerror(err));
return NULL;
}
- DEBUGA_SOUND("started!\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("started!\n", SKYPIAX_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", CELLIAX_P_LOG, snd_strerror(err));
+ ERRORA("snd_output_stdio_attach failed: %s\n", SKYPIAX_P_LOG, snd_strerror(err));
}
snd_pcm_dump(handle, output);
}
if (option_debug > 1)
- DEBUGA_SOUND("ALSA handle = %ld\n", CELLIAX_P_LOG, (long int) handle);
+ DEBUGA_SOUND("ALSA handle = %ld\n", SKYPIAX_P_LOG, (long int) handle);
return handle;
}
/*! \brief Read audio frames from interface */
-struct ast_frame *alsa_read(struct celliax_pvt *p)
+struct ast_frame *alsa_read(private_t * tech_pvt)
{
static struct ast_frame f;
static short __buf[CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2];
@@ -2041,23 +2530,23 @@
state = snd_pcm_state(p->alsac);
if (state != SND_PCM_STATE_RUNNING) {
- DEBUGA_SOUND("ALSA read state is not SND_PCM_STATE_RUNNING\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("ALSA read state is not SND_PCM_STATE_RUNNING\n", SKYPIAX_P_LOG);
if (state != SND_PCM_STATE_PREPARED) {
error = snd_pcm_prepare(p->alsac);
if (error) {
- ERRORA("snd_pcm_prepare failed, %s\n", CELLIAX_P_LOG, snd_strerror(error));
+ ERRORA("snd_pcm_prepare failed, %s\n", SKYPIAX_P_LOG, snd_strerror(error));
return &f;
}
- DEBUGA_SOUND("prepared!\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("prepared!\n", SKYPIAX_P_LOG);
}
usleep(1000);
error = snd_pcm_start(p->alsac);
if (error) {
- ERRORA("snd_pcm_start failed, %s\n", CELLIAX_P_LOG, snd_strerror(error));
+ ERRORA("snd_pcm_start failed, %s\n", SKYPIAX_P_LOG, snd_strerror(error));
return &f;
}
- DEBUGA_SOUND("started!\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("started!\n", SKYPIAX_P_LOG);
usleep(1000);
}
@@ -2081,15 +2570,15 @@
}
if (r == -EPIPE) {
- ERRORA("XRUN read\n\n\n\n\n", CELLIAX_P_LOG);
+ ERRORA("XRUN read\n\n\n\n\n", SKYPIAX_P_LOG);
return &f;
} else if (r == -ESTRPIPE) {
- ERRORA("-ESTRPIPE\n", CELLIAX_P_LOG);
+ ERRORA("-ESTRPIPE\n", SKYPIAX_P_LOG);
return &f;
} else if (r == -EAGAIN) {
DEBUGA_SOUND("ALSA read -EAGAIN, the soundcard is not ready to be read by celliax\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
while (r == -EAGAIN) {
usleep(1000);
@@ -2110,9 +2599,9 @@
}
} else if (r < 0) {
- WARNINGA("ALSA Read error: %s\n", CELLIAX_P_LOG, snd_strerror(r));
+ WARNINGA("ALSA Read error: %s\n", SKYPIAX_P_LOG, snd_strerror(r));
} else if (r >= 0) {
- //DEBUGA_SOUND("read: r=%d, readpos=%d, left=%d, off=%d\n", CELLIAX_P_LOG, r, readpos, left, off);
+ //DEBUGA_SOUND("read: r=%d, readpos=%d, left=%d, off=%d\n", SKYPIAX_P_LOG, r, readpos, left, off);
off -= r; //what is the meaning of this? a leftover, probably
}
/* Update positions */
@@ -2141,7 +2630,7 @@
}
/*! \brief Write audio frames to interface */
-int alsa_write(struct celliax_pvt *p, struct ast_frame *f)
+int alsa_write(private_t * tech_pvt, struct ast_frame *f)
{
static char sizbuf[8000];
static char sizbuf2[16000];
@@ -2158,7 +2647,7 @@
/* We have to digest the frame in 160-byte portions */
if (f->datalen > sizeof(sizbuf) - sizpos) {
- ERRORA("Frame too large\n", CELLIAX_P_LOG);
+ ERRORA("Frame too large\n", SKYPIAX_P_LOG);
res = -1;
} else {
memcpy(sizbuf + sizpos, f->data, f->datalen);
@@ -2173,23 +2662,23 @@
DEBUGA_SOUND
("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",
- CELLIAX_P_LOG, p->alsa_periods_in_buffer);
+ SKYPIAX_P_LOG, p->alsa_periods_in_buffer);
res = snd_pcm_prepare(p->alsap);
if (res) {
- ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play prepare failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
} else {
res = snd_pcm_format_set_silence(celliax_format, silencebuf, len / 2);
if (res < 0) {
- DEBUGA_SOUND("Silence error %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ DEBUGA_SOUND("Silence error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
res = -1;
}
for (i = 0; i < (p->alsa_periods_in_buffer - 1); i++) {
res = snd_pcm_writei(p->alsap, silencebuf, len / 2);
if (res != len / 2) {
- DEBUGA_SOUND("Write returned a different quantity: %d\n", CELLIAX_P_LOG, res);
+ DEBUGA_SOUND("Write returned a different quantity: %d\n", SKYPIAX_P_LOG, res);
res = -1;
} else if (res < 0) {
- DEBUGA_SOUND("Write error %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ DEBUGA_SOUND("Write error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
res = -1;
}
}
@@ -2199,23 +2688,23 @@
res = snd_pcm_delay(p->alsap, &delayp1);
if (res < 0) {
- DEBUGA_SOUND("Error %d on snd_pcm_delay: \"%s\"\n", CELLIAX_P_LOG, res,
+ DEBUGA_SOUND("Error %d on snd_pcm_delay: \"%s\"\n", SKYPIAX_P_LOG, res,
snd_strerror(res));
res = snd_pcm_prepare(p->alsap);
if (res) {
- DEBUGA_SOUND("snd_pcm_prepare failed: '%s'\n", CELLIAX_P_LOG, snd_strerror(res));
+ DEBUGA_SOUND("snd_pcm_prepare failed: '%s'\n", SKYPIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_delay(p->alsap, &delayp1);
}
delayp2 = snd_pcm_avail_update(p->alsap);
if (delayp2 < 0) {
- DEBUGA_SOUND("Error %d on snd_pcm_avail_update: \"%s\"\n", CELLIAX_P_LOG,
+ DEBUGA_SOUND("Error %d on snd_pcm_avail_update: \"%s\"\n", SKYPIAX_P_LOG,
(int) delayp2, snd_strerror(delayp2));
res = snd_pcm_prepare(p->alsap);
if (res) {
- DEBUGA_SOUND("snd_pcm_prepare failed: '%s'\n", CELLIAX_P_LOG, snd_strerror(res));
+ DEBUGA_SOUND("snd_pcm_prepare failed: '%s'\n", SKYPIAX_P_LOG, snd_strerror(res));
}
delayp2 = snd_pcm_avail_update(p->alsap);
}
@@ -2227,29 +2716,29 @@
if (res) {
DEBUGA_SOUND
("snd_pcm_prepare failed while trying to prevent an ALSA write XRUN: %s, delayp1=%d, delayp2=%d\n",
- CELLIAX_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2);
+ SKYPIAX_P_LOG, snd_strerror(res), (int) delayp1, (int) delayp2);
} else {
int i;
for (i = 0; i < (p->alsa_periods_in_buffer - 1); i++) {
res = snd_pcm_format_set_silence(celliax_format, silencebuf, len / 2);
if (res < 0) {
- DEBUGA_SOUND("Silence error %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ DEBUGA_SOUND("Silence error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
res = -1;
}
res = snd_pcm_writei(p->alsap, silencebuf, len / 2);
if (res < 0) {
- DEBUGA_SOUND("Write error %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ DEBUGA_SOUND("Write error %s\n", SKYPIAX_P_LOG, snd_strerror(res));
res = -1;
} else if (res != len / 2) {
- DEBUGA_SOUND("Write returned a different quantity: %d\n", CELLIAX_P_LOG, res);
+ DEBUGA_SOUND("Write returned a different quantity: %d\n", SKYPIAX_P_LOG, res);
res = -1;
}
}
DEBUGA_SOUND
("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",
- CELLIAX_P_LOG, p->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
+ SKYPIAX_P_LOG, p->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
}
}
@@ -2279,10 +2768,10 @@
if (res == -EPIPE) {
DEBUGA_SOUND
("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",
- CELLIAX_P_LOG, p->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
+ SKYPIAX_P_LOG, p->alsa_periods_in_buffer, (int) delayp1, (int) delayp2);
res = snd_pcm_prepare(p->alsap);
if (res) {
- ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play prepare failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
} else {
if (p->alsa_play_is_mono) {
@@ -2311,11 +2800,11 @@
} else {
if (res == -ESTRPIPE) {
- ERRORA("You've got some big problems\n", CELLIAX_P_LOG);
+ ERRORA("You've got some big problems\n", SKYPIAX_P_LOG);
} else if (res == -EAGAIN) {
res = 0;
} else if (res < 0) {
- ERRORA("Error %d on audio write: \"%s\"\n", CELLIAX_P_LOG, res,
+ ERRORA("Error %d on audio write: \"%s\"\n", SKYPIAX_P_LOG, res,
snd_strerror(res));
}
}
@@ -2325,22 +2814,22 @@
time(&now_timestamp);
if ((now_timestamp - p->audio_play_reset_timestamp) > p->audio_play_reset_period) {
if (option_debug)
- DEBUGA_SOUND("reset audio play\n", CELLIAX_P_LOG);
+ DEBUGA_SOUND("reset audio play\n", SKYPIAX_P_LOG);
res = snd_pcm_wait(p->alsap, 1000);
if (res < 0) {
- ERRORA("audio play wait failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play wait failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_drop(p->alsap);
if (res) {
- ERRORA("audio play drop failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play drop failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_prepare(p->alsap);
if (res) {
- ERRORA("audio play prepare failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play prepare failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
}
res = snd_pcm_wait(p->alsap, 1000);
if (res < 0) {
- ERRORA("audio play wait failed: %s\n", CELLIAX_P_LOG, snd_strerror(res));
+ ERRORA("audio play wait failed: %s\n", SKYPIAX_P_LOG, snd_strerror(res));
}
time(&p->audio_play_reset_timestamp);
}
@@ -2356,7 +2845,7 @@
#endif /* CELLIAX_ALSA */
#ifdef CELLIAX_PORTAUDIO
-int celliax_portaudio_devlist(struct celliax_pvt *p)
+int celliax_portaudio_devlist(private_t * tech_pvt)
{
int i, numDevices;
const PaDeviceInfo *deviceInfo;
@@ -2369,14 +2858,14 @@
deviceInfo = Pa_GetDeviceInfo(i);
NOTICA
("Found PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n",
- CELLIAX_P_LOG, i, deviceInfo->name, deviceInfo->maxInputChannels,
+ SKYPIAX_P_LOG, i, deviceInfo->name, deviceInfo->maxInputChannels,
deviceInfo->maxOutputChannels);
}
return numDevices;
}
-int celliax_portaudio_init(struct celliax_pvt *p)
+int celliax_portaudio_init(private_t * tech_pvt)
{
PaError err;
int c;
@@ -2396,13 +2885,13 @@
if (p->portaudiocindex > (numdevices - 1)) {
ERRORA("Portaudio Capture id=%d is out of range: valid id are from 0 to %d\n",
- CELLIAX_P_LOG, p->portaudiocindex, (numdevices - 1));
+ SKYPIAX_P_LOG, p->portaudiocindex, (numdevices - 1));
return -1;
}
if (p->portaudiopindex > (numdevices - 1)) {
ERRORA("Portaudio Playback id=%d is out of range: valid id are from 0 to %d\n",
- CELLIAX_P_LOG, p->portaudiopindex, (numdevices - 1));
+ SKYPIAX_P_LOG, p->portaudiopindex, (numdevices - 1));
return -1;
}
//inputParameters.device = 0;
@@ -2414,12 +2903,12 @@
deviceInfo = Pa_GetDeviceInfo(inputParameters.device);
NOTICA
("Using INPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n",
- CELLIAX_P_LOG, inputParameters.device, deviceInfo->name,
+ SKYPIAX_P_LOG, inputParameters.device, deviceInfo->name,
deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels);
if (deviceInfo->maxInputChannels == 0) {
ERRORA
("No INPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n",
- CELLIAX_P_LOG, inputParameters.device, deviceInfo->name,
+ SKYPIAX_P_LOG, inputParameters.device, deviceInfo->name,
deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels);
return -1;
}
@@ -2438,12 +2927,12 @@
deviceInfo = Pa_GetDeviceInfo(outputParameters.device);
NOTICA
("Using OUTPUT PORTAUDIO device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n",
- CELLIAX_P_LOG, outputParameters.device, deviceInfo->name,
+ SKYPIAX_P_LOG, outputParameters.device, deviceInfo->name,
deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels);
if (deviceInfo->maxOutputChannels == 0) {
ERRORA
("No OUTPUT channels on device: id=%d\tname=%s\tmax input channels=%d\tmax output channels=%d\n",
- CELLIAX_P_LOG, inputParameters.device, deviceInfo->name,
+ SKYPIAX_P_LOG, inputParameters.device, deviceInfo->name,
deviceInfo->maxInputChannels, deviceInfo->maxOutputChannels);
return -1;
}
@@ -2460,7 +2949,7 @@
/* build the pipe that will be polled on by pbx */
c = pipe(p->audiopipe);
if (c) {
- ERRORA("Unable to create audio pipe\n", CELLIAX_P_LOG);
+ ERRORA("Unable to create audio pipe\n", SKYPIAX_P_LOG);
return -1;
}
fcntl(p->audiopipe[0], F_SETFL, O_NONBLOCK);
@@ -2479,7 +2968,7 @@
#endif // GIOVA48
if (err != paNoError) {
- ERRORA("Unable to open audio stream: %s\n", CELLIAX_P_LOG, Pa_GetErrorText(err));
+ ERRORA("Unable to open audio stream: %s\n", SKYPIAX_P_LOG, Pa_GetErrorText(err));
return -1;
}
@@ -2489,7 +2978,7 @@
return 0;
}
-int celliax_portaudio_write(struct celliax_pvt *p, struct ast_frame *f)
+int celliax_portaudio_write(private_t * tech_pvt, struct ast_frame *f)
{
int samples;
#ifdef GIOVA48
@@ -2497,7 +2986,7 @@
short buf[3840];
short *buf2;
- //ERRORA("1 f->datalen=: %d\n", CELLIAX_P_LOG, f->datalen);
+ //ERRORA("1 f->datalen=: %d\n", SKYPIAX_P_LOG, f->datalen);
memset(buf, '\0', CELLIAX_FRAME_SIZE * 2);
@@ -2536,7 +3025,7 @@
}
f->data = &buf;
f->datalen = f->datalen * 6;
- //ERRORA("2 f->datalen=: %d\n", CELLIAX_P_LOG, f->datalen);
+ //ERRORA("2 f->datalen=: %d\n", SKYPIAX_P_LOG, f->datalen);
//f->datalen = f->datalen;
#endif // GIOVA48
@@ -2550,13 +3039,13 @@
#endif /* ASTERISK_VERSION_1_6_0_1 */
if (samples != (int) (f->datalen / sizeof(short)))
- ERRORA("WriteAudioStream wrote: %d of %d\n", CELLIAX_P_LOG, samples,
+ ERRORA("WriteAudioStream wrote: %d of %d\n", SKYPIAX_P_LOG, samples,
(int) (f->datalen / sizeof(short)));
return 0;
}
-struct ast_frame *celliax_portaudio_read(struct celliax_pvt *p)
+struct ast_frame *celliax_portaudio_read(private_t * tech_pvt)
{
static struct ast_frame f;
static short __buf[CELLIAX_FRAME_SIZE + AST_FRIENDLY_OFFSET / 2];
@@ -2631,34 +3120,34 @@
return &f;
}
-int celliax_portaudio_shutdown(struct celliax_pvt *p)
+int celliax_portaudio_shutdown(private_t * tech_pvt)
{
PaError err;
err = CloseAudioStream(p->stream);
if (err != paNoError)
- ERRORA("not able to CloseAudioStream\n", CELLIAX_P_LOG);
+ ERRORA("not able to CloseAudioStream\n", SKYPIAX_P_LOG);
Pa_Terminate();
return 0;
}
#endif // CELLIAX_PORTAUDIO
-int celliax_serial_sync_AT(struct celliax_pvt *p)
+int celliax_serial_sync_AT(private_t * tech_pvt)
{
usleep(10000); /* 10msec */
time(&p->celliax_serial_synced_timestamp);
return 0;
}
-int celliax_serial_getstatus_AT(struct celliax_pvt *p)
+int celliax_serial_getstatus_AT(private_t * tech_pvt)
{
int res;
if (p->owner) {
if (p->owner->_state != AST_STATE_UP && p->owner->_state != AST_STATE_DOWN) {
- DEBUGA_AT("No getstatus, we're neither UP nor DOWN\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("No getstatus, we're neither UP nor DOWN\n", SKYPIAX_P_LOG);
return 0;
}
}
@@ -2668,7 +3157,7 @@
res = celliax_serial_write_AT_ack(p, "AT");
if (res) {
ERRORA("AT was not acknowledged, continuing but maybe there is a problem\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
usleep(1000);
@@ -2676,7 +3165,7 @@
res =
celliax_serial_write_AT_expect(p, p->at_query_battchg, p->at_query_battchg_expect);
if (res) {
- WARNINGA("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ WARNINGA("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_query_battchg, p->at_query_battchg_expect);
}
usleep(1000);
@@ -2686,7 +3175,7 @@
res =
celliax_serial_write_AT_expect(p, p->at_query_signal, p->at_query_signal_expect);
if (res) {
- WARNINGA("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ WARNINGA("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_query_signal, p->at_query_signal_expect);
}
usleep(1000);
@@ -2698,7 +3187,7 @@
if (res) {
WARNINGA
("%s does not get %s from the modem, maybe a long msg is incoming. If this cellmodem is not a Motorola, you are arriving here because your cellmodem do not supports CNMI kind of incoming SMS alert; please let it know to the developers of Celliax. If this cellmodem is a Motorola and this message keeps repeating, and you cannot correctly receive SMSs from this interface, please manually clean all messages from the cellmodem/SIM. Continuing.\n",
- CELLIAX_P_LOG, "AT+MMGL=\"HEADER ONLY\"", "OK");
+ SKYPIAX_P_LOG, "AT+MMGL=\"HEADER ONLY\"", "OK");
} else {
usleep(1000);
if (p->unread_sms_msg_id) {
@@ -2709,7 +3198,7 @@
if (res) {
ERRORA
("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
memset(p->sms_message, 0, sizeof(p->sms_message));
}
}
@@ -2724,13 +3213,13 @@
if (res) {
ERRORA
("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n",
- CELLIAX_P_LOG, at_command);
+ SKYPIAX_P_LOG, at_command);
}
res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"GSM\"");
if (res) {
ERRORA
("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
memset(at_command, 0, sizeof(at_command));
sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */
@@ -2739,7 +3228,7 @@
if (res) {
ERRORA
("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n",
- CELLIAX_P_LOG, at_command);
+ SKYPIAX_P_LOG, at_command);
}
if (strlen(p->sms_message)) {
@@ -2753,7 +3242,7 @@
char *arg1[] = { p->sms_receiving_program, (char *) NULL };
int i;
- NOTICA("incoming SMS message:>>>%s<<<\n", CELLIAX_P_LOG, p->sms_message);
+ NOTICA("incoming SMS message:>>>%s<<<\n", SKYPIAX_P_LOG, p->sms_message);
pipe(fd1);
pid1 = fork();
@@ -2767,7 +3256,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",
- CELLIAX_P_LOG, p->sms_receiving_program, err, strerror(errno),
+ SKYPIAX_P_LOG, p->sms_receiving_program, err, strerror(errno),
p->sms_message);
}
close(fd1[0]); // close output pipe side
@@ -2781,7 +3270,7 @@
} else {
ERRORA
("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n",
- CELLIAX_P_LOG, p->sms_message);
+ SKYPIAX_P_LOG, p->sms_message);
}
}
#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself
@@ -2792,7 +3281,7 @@
if (res) {
ERRORA
("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
}
#endif
@@ -2805,7 +3294,7 @@
return 0;
}
-int celliax_serial_read_AT(struct celliax_pvt *p, int look_for_ack, int timeout_usec,
+int celliax_serial_read_AT(private_t * tech_pvt, int look_for_ack, int timeout_usec,
int timeout_sec, const char *expected_string, int expect_crlf)
{
int select_err;
@@ -2825,7 +3314,7 @@
FD_ZERO(&read_fds);
FD_SET(p->controldevfd, &read_fds);
- //NOTICA (" INSIDE this celliax_serial_device %s \n", CELLIAX_P_LOG, p->controldevice_name);
+ //NOTICA (" INSIDE this celliax_serial_device %s \n", SKYPIAX_P_LOG, p->controldevice_name);
tmp_answer_ptr = tmp_answer;
memset(tmp_answer, 0, sizeof(char) * AT_BUFSIZ);
@@ -2843,7 +3332,7 @@
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",
- CELLIAX_P_LOG, p->controldevice_name);
+ SKYPIAX_P_LOG, p->controldevice_name);
p->controldev_dead = 1;
close(p->controldevfd);
UNLOCKA(&p->controldev_lock);
@@ -2855,8 +3344,8 @@
}
if (option_debug > 90) {
- //DEBUGA_AT("1 read %d bytes, --|%s|--\n", CELLIAX_P_LOG, read_count, tmp_answer_ptr);
- //DEBUGA_AT("2 read %d bytes, --|%s|--\n", CELLIAX_P_LOG, read_count, tmp_answer);
+ //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);
}
tmp_answer_ptr = tmp_answer_ptr + read_count;
@@ -2871,7 +3360,7 @@
if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) {
WARNINGA
("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n",
- CELLIAX_P_LOG, token_ptr, p->line_array.result[la_counter]);
+ SKYPIAX_P_LOG, token_ptr, p->line_array.result[la_counter]);
}
la_counter++;
while ((token_ptr = strtok(NULL, "\n\r"))) {
@@ -2880,7 +3369,7 @@
if (strlen(token_ptr) > AT_MESG_MAX_LENGTH) {
WARNINGA
("AT mesg longer than buffer, original message was: |%s|, in buffer only: |%s|\n",
- CELLIAX_P_LOG, token_ptr, p->line_array.result[la_counter]);
+ SKYPIAX_P_LOG, token_ptr, p->line_array.result[la_counter]);
}
la_counter++;
}
@@ -2889,9 +3378,9 @@
}
if (expected_string && !expect_crlf) {
- DEBUGA_AT
+ DEBUGA_SKYPE
("last_line_ptr=|%s|, expected_string=|%s|, expect_crlf=%d, memcmp(last_line_ptr, expected_string, strlen(expected_string)) = %d\n",
- CELLIAX_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr,
+ SKYPIAX_P_LOG, last_line_ptr, expected_string, expect_crlf, memcmp(last_line_ptr,
expected_string,
strlen
(expected_string)));
@@ -2913,7 +3402,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_AT("Read line %d: |%s|\n", CELLIAX_P_LOG, i, p->line_array.result[i]);
+ DEBUGA_SKYPE("Read line %d: |%s|\n", SKYPIAX_P_LOG, i, p->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 */
@@ -2925,7 +3414,7 @@
/* give CALLID (+CLIP) a chance, wait for the next RING before answering */
if (p->phone_callflow == CALLFLOW_INCOMING_RING) {
/* we're at the second ring, set the interface state, will be answered by celliax_do_monitor */
- DEBUGA_AT("|%s| got second RING\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("|%s| got second RING\n", SKYPIAX_P_LOG, p->line_array.result[i]);
p->interface_state = AST_STATE_RING;
} else {
/* we're at the first ring, so there is no CALLID yet thus clean the previous one
@@ -2935,16 +3424,16 @@
/* only send AT+CLCC? if the device previously reported its support */
if (p->at_has_clcc != 0) {
/* we're at the first ring, try to get CALLID (with +CLCC) */
- DEBUGA_AT("|%s| got first RING, sending AT+CLCC?\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| got first RING, sending AT+CLCC?\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
res = celliax_serial_write_AT_noack(p, "AT+CLCC?");
if (res) {
ERRORA("AT+CLCC? (call list) was not correctly sent to the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
} else {
- DEBUGA_AT("|%s| got first RING, but not sending AT+CLCC? as this device "
- "seems not to support\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("|%s| got first RING, but not sending AT+CLCC? as this device "
+ "seems not to support\n", SKYPIAX_P_LOG, p->line_array.result[i]);
}
}
p->phone_callflow = CALLFLOW_INCOMING_RING;
@@ -2979,7 +3468,7 @@
}
p->phone_callflow = CALLFLOW_INCOMING_RING;
- DEBUGA_AT("|%s| CLCC CALLID: name is %s, number is %s\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CLCC CALLID: name is %s, number is %s\n", SKYPIAX_P_LOG,
p->line_array.result[i],
p->callid_name[0] ? p->callid_name : "not available",
p->callid_number[0] ? p->callid_number : "not available");
@@ -3015,14 +3504,14 @@
if (p->interface_state != AST_STATE_RING) {
gettimeofday(&(p->call_incoming_time), NULL);
- DEBUGA_AT("AST_STATE_RING call_incoming_time.tv_sec=%ld\n",
- CELLIAX_P_LOG, p->call_incoming_time.tv_sec);
+ DEBUGA_SKYPE("AST_STATE_RING call_incoming_time.tv_sec=%ld\n",
+ SKYPIAX_P_LOG, p->call_incoming_time.tv_sec);
}
p->interface_state = AST_STATE_RING;
p->phone_callflow = CALLFLOW_INCOMING_RING;
- DEBUGA_AT("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CLIP INCOMING CALLID: name is %s, number is %s\n", SKYPIAX_P_LOG,
p->line_array.result[i],
p->callid_name[0] != 1 ? p->callid_name : "not available",
p->callid_number[0] ? p->callid_number : "not available");
@@ -3031,37 +3520,37 @@
if ((strcmp(p->line_array.result[i], "BUSY") == 0)) {
p->phone_callflow = CALLFLOW_CALL_LINEBUSY;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_LINEBUSY\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_LINEBUSY\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
ast_setstate(p->owner, AST_STATE_BUSY);
celliax_queue_control(p->owner, AST_CONTROL_BUSY);
} else {
- ERRORA("Why BUSY now?\n", CELLIAX_P_LOG);
+ ERRORA("Why BUSY now?\n", SKYPIAX_P_LOG);
}
}
if ((strcmp(p->line_array.result[i], "NO ANSWER") == 0)) {
p->phone_callflow = CALLFLOW_CALL_NOANSWER;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_NOANSWER\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_NOANSWER\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
p->owner->hangupcause = AST_CAUSE_NO_ANSWER;
celliax_queue_control(p->owner, AST_CONTROL_HANGUP);
} else {
- ERRORA("Why NO ANSWER now?\n", CELLIAX_P_LOG);
+ ERRORA("Why NO ANSWER now?\n", SKYPIAX_P_LOG);
}
}
if ((strcmp(p->line_array.result[i], "NO CARRIER") == 0)) {
p->phone_callflow = CALLFLOW_CALL_NOCARRIER;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_NOCARRIER\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_NOCARRIER\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
p->owner->hangupcause = AST_CAUSE_FAILURE;
celliax_queue_control(p->owner, AST_CONTROL_HANGUP);
} else {
- ERRORA("Why NO CARRIER now?\n", CELLIAX_P_LOG);
+ ERRORA("Why NO CARRIER now?\n", SKYPIAX_P_LOG);
}
}
@@ -3073,34 +3562,34 @@
err =
sscanf(&p->line_array.result[i][6], "%d,%d", &power_supply, &battery_strenght);
if (err < 2) {
- DEBUGA_AT("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("|%s| is not formatted as: |+CBC: xx,yy| now trying |+CBC:xx,yy|\n",
+ SKYPIAX_P_LOG, p->line_array.result[i]);
err =
sscanf(&p->line_array.result[i][5], "%d,%d", &power_supply,
&battery_strenght);
- DEBUGA_AT("|%s| +CBC: Powered by %s, battery strenght=%d\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CBC: Powered by %s, battery strenght=%d\n", SKYPIAX_P_LOG,
p->line_array.result[i], power_supply ? "power supply" : "battery",
battery_strenght);
}
if (err < 2) {
- DEBUGA_AT("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| is not formatted as: |+CBC:xx,yy| giving up\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
else {
if (option_debug > 1)
- DEBUGA_AT("|%s| +CBC: Powered by %s, battery strenght=%d\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CBC: Powered by %s, battery strenght=%d\n", SKYPIAX_P_LOG,
p->line_array.result[i], power_supply ? "power supply" : "battery",
battery_strenght);
if (!power_supply) {
if (battery_strenght < 10) {
- ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", CELLIAX_P_LOG,
+ ERRORA("|%s| BATTERY ALMOST EXHAUSTED\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
} else if (battery_strenght < 20) {
- WARNINGA("|%s| BATTERY LOW\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ WARNINGA("|%s| BATTERY LOW\n", SKYPIAX_P_LOG, p->line_array.result[i]);
}
@@ -3116,18 +3605,18 @@
err = sscanf(&p->line_array.result[i][6], "%d,%d", &signal_quality, &ber);
if (option_debug > 1)
- DEBUGA_AT("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CSQ: Signal Quality: %d, Error Rate=%d\n", SKYPIAX_P_LOG,
p->line_array.result[i], signal_quality, ber);
if (err < 2) {
- ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", CELLIAX_P_LOG,
+ ERRORA("|%s| is not formatted as: |+CSQ: xx,yy|\n", SKYPIAX_P_LOG,
p->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",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ SKYPIAX_P_LOG, p->line_array.result[i]);
} else if (signal_quality < 15) {
- WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", CELLIAX_P_LOG,
+ WARNINGA("|%s| CELLPHONE GETS SIGNAL LOW\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
@@ -3139,9 +3628,9 @@
int err;
err = sscanf(&p->line_array.result[i][7], "%s", p->at_cmgw);
- DEBUGA_AT("|%s| +CMGW: %s\n", CELLIAX_P_LOG, p->line_array.result[i], p->at_cmgw);
+ DEBUGA_SKYPE("|%s| +CMGW: %s\n", SKYPIAX_P_LOG, p->line_array.result[i], p->at_cmgw);
if (err < 1) {
- ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", CELLIAX_P_LOG,
+ ERRORA("|%s| is not formatted as: |+CMGW: xxxx|\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
@@ -3151,12 +3640,12 @@
if ((strcmp(p->line_array.result[i], p->at_call_idle) == 0)) {
p->phone_callflow = CALLFLOW_CALL_IDLE;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_IDLE\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_IDLE\n", SKYPIAX_P_LOG, p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
- DEBUGA_AT("just received a remote HANGUP\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("just received a remote HANGUP\n", SKYPIAX_P_LOG);
p->owner->hangupcause = AST_CAUSE_NORMAL;
celliax_queue_control(p->owner, AST_CONTROL_HANGUP);
- DEBUGA_AT("just sent AST_CONTROL_HANGUP\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("just sent AST_CONTROL_HANGUP\n", SKYPIAX_P_LOG);
}
}
@@ -3165,7 +3654,7 @@
//char list_command[64];
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_INCOMING\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_INCOMING\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->phone_callflow != CALLFLOW_CALL_INCOMING
@@ -3173,8 +3662,8 @@
//mark the time of CALLFLOW_CALL_INCOMING
gettimeofday(&(p->call_incoming_time), NULL);
p->phone_callflow = CALLFLOW_CALL_INCOMING;
- DEBUGA_AT("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n",
- CELLIAX_P_LOG, p->call_incoming_time.tv_sec);
+ DEBUGA_SKYPE("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld\n",
+ SKYPIAX_P_LOG, p->call_incoming_time.tv_sec);
}
}
@@ -3182,34 +3671,34 @@
if ((strcmp(p->line_array.result[i], p->at_call_active) == 0)) {
p->phone_callflow = CALLFLOW_CALL_ACTIVE;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_ACTIVE\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_ACTIVE\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->owner && p->interface_state == CALLFLOW_CALL_DIALING) {
- DEBUGA_PBX("just received a remote ANSWER\n", CELLIAX_P_LOG);
+ DEBUGA_PBX("just received a remote ANSWER\n", SKYPIAX_P_LOG);
if (p->owner->_state != AST_STATE_UP) {
celliax_queue_control(p->owner, AST_CONTROL_RINGING);
- DEBUGA_PBX("just sent AST_CONTROL_RINGING\n", CELLIAX_P_LOG);
- DEBUGA_PBX("going to send AST_CONTROL_ANSWER\n", CELLIAX_P_LOG);
+ DEBUGA_PBX("just sent AST_CONTROL_RINGING\n", SKYPIAX_P_LOG);
+ DEBUGA_PBX("going to send AST_CONTROL_ANSWER\n", SKYPIAX_P_LOG);
celliax_queue_control(p->owner, AST_CONTROL_ANSWER);
- DEBUGA_PBX("just sent AST_CONTROL_ANSWER\n", CELLIAX_P_LOG);
+ DEBUGA_PBX("just sent AST_CONTROL_ANSWER\n", SKYPIAX_P_LOG);
}
} else {
}
p->interface_state = AST_STATE_UP;
- DEBUGA_PBX("just interface_state UP\n", CELLIAX_P_LOG);
+ DEBUGA_PBX("just interface_state UP\n", SKYPIAX_P_LOG);
}
if ((strcmp(p->line_array.result[i], p->at_call_calling) == 0)) {
p->phone_callflow = CALLFLOW_CALL_DIALING;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_DIALING\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_DIALING\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_call_failed) == 0)) {
p->phone_callflow = CALLFLOW_CALL_FAILED;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_FAILED\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_FAILED\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
p->owner->hangupcause = AST_CAUSE_FAILURE;
@@ -3219,13 +3708,13 @@
if ((strncmp(p->line_array.result[i], "+CSCA:", 6) == 0)) { //TODO SMS FIXME in config!
if (option_debug > 1)
- DEBUGA_AT("|%s| +CSCA: Message Center Address!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CSCA: Message Center Address!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strncmp(p->line_array.result[i], "+CMGF:", 6) == 0)) { //TODO SMS FIXME in config!
if (option_debug > 1)
- DEBUGA_AT("|%s| +CMGF: Message Format!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMGF: Message Format!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
@@ -3235,15 +3724,15 @@
//FIXME all the following commands in config!
if (option_debug)
- DEBUGA_AT("|%s| +CMTI: Incoming SMS!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMTI: Incoming SMS!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
err = sscanf(&p->line_array.result[i][12], "%d", &pos);
if (err < 1) {
- ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", CELLIAX_P_LOG,
+ ERRORA("|%s| is not formatted as: |+CMTI: \"MT\",xx|\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
} else {
- DEBUGA_AT("|%s| +CMTI: Incoming SMS in position: %d!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMTI: Incoming SMS in position: %d!\n", SKYPIAX_P_LOG,
p->line_array.result[i], pos);
p->unread_sms_msg_id = pos;
usleep(1000);
@@ -3256,7 +3745,7 @@
if (res) {
ERRORA
("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone, continuing\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
//memset(p->sms_message, 0, sizeof(p->sms_message));
}
}
@@ -3271,13 +3760,13 @@
if (res) {
ERRORA
("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n",
- CELLIAX_P_LOG, at_command);
+ SKYPIAX_P_LOG, at_command);
}
res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"GSM\"");
if (res) {
ERRORA
("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
memset(at_command, 0, sizeof(at_command));
sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id); /* delete the message */
@@ -3286,7 +3775,7 @@
if (res) {
ERRORA
("AT+CMGD (Delete SMS) do not got OK from the phone, message sent was:|||%s|||\n",
- CELLIAX_P_LOG, at_command);
+ SKYPIAX_P_LOG, at_command);
}
if (strlen(p->sms_message)) {
@@ -3299,7 +3788,7 @@
char *arg1[] = { p->sms_receiving_program, (char *) NULL };
int i;
- NOTICA("incoming SMS message:>>>%s<<<\n", CELLIAX_P_LOG, p->sms_message);
+ NOTICA("incoming SMS message:>>>%s<<<\n", SKYPIAX_P_LOG, p->sms_message);
pipe(fd1);
pid1 = fork();
@@ -3314,7 +3803,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",
- CELLIAX_P_LOG, p->sms_receiving_program, err, strerror(errno),
+ SKYPIAX_P_LOG, p->sms_receiving_program, err, strerror(errno),
p->sms_message);
}
close(fd1[0]); // close output pipe side
@@ -3329,7 +3818,7 @@
} else {
ERRORA
("got SMS incoming message, but 'sms_receiving_program' is not set in config file. SMS received was:---%s---\n",
- CELLIAX_P_LOG, p->sms_message);
+ SKYPIAX_P_LOG, p->sms_message);
}
}
#if 1 //is this one needed? maybe it can interrupt an incoming call that is just to announce itself
@@ -3340,7 +3829,7 @@
if (res) {
ERRORA
("AT+CKPD=\"EEE\" (cellphone screen back to user) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
}
#endif
@@ -3355,42 +3844,42 @@
//int unread_msg_id=0;
if (option_debug)
- DEBUGA_AT("|%s| +MMGL: Listing Motorola SMSs!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +MMGL: Listing Motorola SMSs!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
err = sscanf(&p->line_array.result[i][7], "%d", &p->unread_sms_msg_id);
if (err < 1) {
- ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", CELLIAX_P_LOG,
+ ERRORA("|%s| is not formatted as: |+MMGL: xx|\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
}
if ((strncmp(p->line_array.result[i], "+CMGL:", 6) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_AT("|%s| +CMGL: Listing SMSs!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMGL: Listing SMSs!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strncmp(p->line_array.result[i], "+MMGR:", 6) == 0)) { //TODO MOTOROLA SMS FIXME in config!
if (option_debug)
- DEBUGA_AT("|%s| +MMGR: Reading Motorola SMS!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +MMGR: Reading Motorola SMS!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->reading_sms_msg)
p->reading_sms_msg++;
}
if ((strncmp(p->line_array.result[i], "+CMGR: \"STO U", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_AT("|%s| +CMGR: Reading stored UNSENT SMS!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMGR: Reading stored UNSENT SMS!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
} else if ((strncmp(p->line_array.result[i], "+CMGR: \"STO S", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_AT("|%s| +CMGR: Reading stored SENT SMS!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMGR: Reading stored SENT SMS!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
} else if ((strncmp(p->line_array.result[i], "+CMGR: \"REC R", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_AT("|%s| +CMGR: Reading received READ SMS!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMGR: Reading received READ SMS!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
} else if ((strncmp(p->line_array.result[i], "+CMGR: \"REC U", 13) == 0)) { //TODO SMS FIXME in config!
if (option_debug)
- DEBUGA_AT("|%s| +CMGR: Reading received UNREAD SMS!\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| +CMGR: Reading received UNREAD SMS!\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->reading_sms_msg)
p->reading_sms_msg++;
@@ -3399,14 +3888,14 @@
if ((strcmp(p->line_array.result[i], "+MCST: 17") == 0)) { /* motorola call processing unsolicited messages */
p->phone_callflow = CALLFLOW_CALL_INFLUX;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_INFLUX\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_INFLUX\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], "+MCST: 68") == 0)) { /* motorola call processing unsolicited messages */
p->phone_callflow = CALLFLOW_CALL_NOSERVICE;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_NOSERVICE\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_NOSERVICE\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
p->owner->hangupcause = AST_CAUSE_FAILURE;
@@ -3416,7 +3905,7 @@
if ((strcmp(p->line_array.result[i], "+MCST: 70") == 0)) { /* motorola call processing unsolicited messages */
p->phone_callflow = CALLFLOW_CALL_OUTGOINGRESTRICTED;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_OUTGOINGRESTRICTED\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
p->owner->hangupcause = AST_CAUSE_FAILURE;
@@ -3426,7 +3915,7 @@
if ((strcmp(p->line_array.result[i], "+MCST: 72") == 0)) { /* motorola call processing unsolicited messages */
p->phone_callflow = CALLFLOW_CALL_SECURITYFAIL;
if (option_debug > 1)
- DEBUGA_AT("|%s| CALLFLOW_CALL_SECURITYFAIL\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| CALLFLOW_CALL_SECURITYFAIL\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
if (p->interface_state != AST_STATE_DOWN && p->owner) {
p->owner->hangupcause = AST_CAUSE_FAILURE;
@@ -3440,7 +3929,7 @@
int err, first_entry, last_entry, number_lenght, text_lenght;
if (option_debug)
- DEBUGA_AT("phonebook struct: |%s|\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("phonebook struct: |%s|\n", SKYPIAX_P_LOG, p->line_array.result[i]);
err =
sscanf(&p->line_array.result[i][8], "%d-%d),%d,%d", &first_entry, &last_entry,
@@ -3455,13 +3944,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",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ SKYPIAX_P_LOG, p->line_array.result[i]);
} else {
if (option_debug)
- DEBUGA_AT
+ DEBUGA_SKYPE
("First entry: %d, last entry: %d, phone number max lenght: %d, text max lenght: %d\n",
- CELLIAX_P_LOG, first_entry, last_entry, number_lenght, text_lenght);
+ SKYPIAX_P_LOG, first_entry, last_entry, number_lenght, text_lenght);
p->phonebook_first_entry = first_entry;
p->phonebook_last_entry = last_entry;
p->phonebook_number_lenght = number_lenght;
@@ -3477,7 +3966,7 @@
char entry_text[256];
if (option_debug)
- DEBUGA_AT("phonebook entry: |%s|\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("phonebook entry: |%s|\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
err =
@@ -3486,11 +3975,11 @@
if (err < 4) {
ERRORA
("err=%d, phonebook entry: |%s| is not formatted as: |+CPBR: 504,\"+39025458068\",145,\"ciao a tutti\"|\n",
- CELLIAX_P_LOG, err, p->line_array.result[i]);
+ SKYPIAX_P_LOG, err, p->line_array.result[i]);
} else {
//TODO: sanitize entry_text
if (option_debug)
- DEBUGA_AT("Number: %s, Text: %s, Type: %d\n", CELLIAX_P_LOG, entry_number,
+ DEBUGA_SKYPE("Number: %s, Text: %s, Type: %d\n", SKYPIAX_P_LOG, entry_number,
entry_text, entry_type);
/* write entry in phonebook file */
if (p->phonebook_writing_fp) {
@@ -3518,7 +4007,7 @@
char entry_text[256] = "";
if (option_debug)
- DEBUGA_AT("phonebook entry: |%s|\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("phonebook entry: |%s|\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
err =
@@ -3527,23 +4016,23 @@
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",
- CELLIAX_P_LOG, err, p->line_array.result[i]);
+ SKYPIAX_P_LOG, err, p->line_array.result[i]);
} else {
//TODO: sanitize entry_text
if (option_debug)
- DEBUGA_AT("Number: %s, Text: %s, Type: %d\n", CELLIAX_P_LOG, entry_number,
+ DEBUGA_SKYPE("Number: %s, Text: %s, Type: %d\n", SKYPIAX_P_LOG, entry_number,
entry_text, entry_type);
memset(p->callid_name, 0, sizeof(p->callid_name));
memset(p->callid_number, 0, sizeof(p->callid_number));
strncpy(p->callid_name, entry_text, sizeof(p->callid_name));
strncpy(p->callid_number, entry_number, sizeof(p->callid_number));
if (option_debug)
- DEBUGA_AT("incoming callid: Text: %s, Number: %s\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("incoming callid: Text: %s, Number: %s\n", SKYPIAX_P_LOG,
p->callid_name, p->callid_number);
- DEBUGA_AT("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n",
- CELLIAX_P_LOG, p->line_array.result[i],
+ DEBUGA_SKYPE("|%s| CPBR INCOMING CALLID: name is %s, number is %s\n",
+ SKYPIAX_P_LOG, p->line_array.result[i],
p->callid_name[0] != 1 ? p->callid_name : "not available",
p->callid_number[0] ? p->callid_number : "not available");
@@ -3557,7 +4046,7 @@
}
else {
- DEBUGA_AT("phonebook entry: |%s|\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("phonebook entry: |%s|\n", SKYPIAX_P_LOG, p->line_array.result[i]);
}
}
@@ -3582,12 +4071,12 @@
p->phone_callflow = CALLFLOW_CALL_IDLE;
p->interface_state = AST_STATE_DOWN;
if (option_debug > 1)
- DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: IDLE\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
break;
case 1:
if (option_debug > 1)
- DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: CALLING\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
break;
case 2:
@@ -3596,7 +4085,7 @@
}
p->interface_state = CALLFLOW_CALL_DIALING;
if (option_debug > 1)
- DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: CONNECTING\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
break;
case 3:
@@ -3607,26 +4096,26 @@
p->phone_callflow = CALLFLOW_CALL_ACTIVE;
p->interface_state = AST_STATE_UP;
if (option_debug > 1)
- DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: ACTIVE\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
break;
case 4:
if (option_debug > 1)
- DEBUGA_AT
+ DEBUGA_SKYPE
("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle HOLD event\n",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ SKYPIAX_P_LOG, p->line_array.result[i]);
break;
case 5:
if (option_debug > 1)
- DEBUGA_AT
+ DEBUGA_SKYPE
("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle WAITING event\n",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ SKYPIAX_P_LOG, p->line_array.result[i]);
break;
case 6:
if (option_debug > 1)
- DEBUGA_AT
+ DEBUGA_SKYPE
("|%s| Sony-Ericsson *ECAM/*ECAV: don't know how to handle ALERTING event\n",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ SKYPIAX_P_LOG, p->line_array.result[i]);
break;
case 7:
if (p->owner) {
@@ -3636,14 +4125,14 @@
p->phone_callflow = CALLFLOW_CALL_LINEBUSY;
p->interface_state = AST_STATE_BUSY;
if (option_debug > 1)
- DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: BUSY\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
break;
}
} else {
if (option_debug > 1)
- DEBUGA_AT("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n",
- CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("|%s| Sony-Ericsson *ECAM/*ECAV: could not parse parameters\n",
+ SKYPIAX_P_LOG, p->line_array.result[i]);
}
}
@@ -3651,70 +4140,70 @@
/* 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(p->line_array.result[i], p->at_indicator_noservice_string) == 0)) {
if (option_debug > 1)
- ERRORA("|%s| at_indicator_noservice_string\n", CELLIAX_P_LOG,
+ ERRORA("|%s| at_indicator_noservice_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_nosignal_string) == 0)) {
if (option_debug > 1)
- ERRORA("|%s| at_indicator_nosignal_string\n", CELLIAX_P_LOG,
+ ERRORA("|%s| at_indicator_nosignal_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_lowsignal_string) == 0)) {
if (option_debug > 1)
- WARNINGA("|%s| at_indicator_lowsignal_string\n", CELLIAX_P_LOG,
+ WARNINGA("|%s| at_indicator_lowsignal_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_lowbattchg_string) == 0)) {
if (option_debug > 1)
- WARNINGA("|%s| at_indicator_lowbattchg_string\n", CELLIAX_P_LOG,
+ WARNINGA("|%s| at_indicator_lowbattchg_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_nobattchg_string) == 0)) {
if (option_debug > 1)
- ERRORA("|%s| at_indicator_nobattchg_string\n", CELLIAX_P_LOG,
+ ERRORA("|%s| at_indicator_nobattchg_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_callactive_string) == 0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| at_indicator_callactive_string\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| at_indicator_callactive_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_nocallactive_string) == 0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| at_indicator_nocallactive_string\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| at_indicator_nocallactive_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_nocallsetup_string) == 0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| at_indicator_nocallsetup_string\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| at_indicator_nocallsetup_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_callsetupincoming_string) ==
0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| at_indicator_callsetupincoming_string\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| at_indicator_callsetupincoming_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_callsetupoutgoing_string) ==
0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| at_indicator_callsetupoutgoing_string\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| at_indicator_callsetupoutgoing_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
if ((strcmp(p->line_array.result[i], p->at_indicator_callsetupremoteringing_string)
== 0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| at_indicator_callsetupremoteringing_string\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("|%s| at_indicator_callsetupremoteringing_string\n", SKYPIAX_P_LOG,
p->line_array.result[i]);
}
@@ -3726,19 +4215,19 @@
if ((strncmp(p->line_array.result[i], expected_string, strlen(expected_string))
== 0)) {
if (option_debug > 1)
- DEBUGA_AT("|%s| got what EXPECTED\n", CELLIAX_P_LOG, p->line_array.result[i]);
+ DEBUGA_SKYPE("|%s| got what EXPECTED\n", SKYPIAX_P_LOG, p->line_array.result[i]);
at_ack = AT_OK;
}
} else {
if ((strcmp(p->line_array.result[i], "OK") == 0)) {
if (option_debug > 1)
- DEBUGA_AT("got OK\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("got OK\n", SKYPIAX_P_LOG);
at_ack = AT_OK;
}
}
if ((strcmp(p->line_array.result[i], "ERROR") == 0)) {
if (option_debug > 1)
- DEBUGA_AT("got ERROR\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("got ERROR\n", SKYPIAX_P_LOG);
at_ack = AT_ERROR;
}
@@ -3763,18 +4252,18 @@
&& p->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", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
+ //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
} else {
inside_comma = 1;
- //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
+ //NOTICA("inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
}
}
if (p->line_array.result[i][c] == '"'
&& p->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", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
- DEBUGA_AT("content=%s\n", CELLIAX_P_LOG, content);
+ //ERRORA("END_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
+ DEBUGA_SKYPE("content=%s\n", SKYPIAX_P_LOG, content);
strncat(p->sms_message, "---",
((sizeof(p->sms_message) - strlen(p->sms_message)) - 1));
@@ -3797,7 +4286,7 @@
d = 0;
} else {
inside_quote = 1;
- //WARNINGA("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", CELLIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
+ //WARNINGA("START_CONTENT inside_comma=%d, inside_quote=%d, we're at=%s\n", SKYPIAX_P_LOG, inside_comma, inside_quote, &p->line_array.result[i][c]);
}
}
if (inside_quote && p->line_array.result[i][c] != '"') {
@@ -3828,7 +4317,7 @@
strncat(p->sms_message, "|||",
((sizeof(p->sms_message) - strlen(p->sms_message)) - 1));
- DEBUGA_AT("sms_message=%s\n", CELLIAX_P_LOG, p->sms_message);
+ DEBUGA_SKYPE("sms_message=%s\n", SKYPIAX_P_LOG, p->sms_message);
} //it was the UCS2 from cellphone
@@ -3842,7 +4331,7 @@
break;
if (la_counter > AT_MESG_MAX_LINES) {
- ERRORA("Too many lines in result (>%d). Stopping reader.\n", CELLIAX_P_LOG,
+ ERRORA("Too many lines in result (>%d). Stopping reader.\n", SKYPIAX_P_LOG,
AT_MESG_MAX_LINES);
at_ack = AT_ERROR;
break;
@@ -3853,7 +4342,7 @@
POPPA_UNLOCKA(&p->controldev_lock);
if (select_err == -1) {
ERRORA("select returned -1 on %s, setting controldev_dead, error was: %s\n",
- CELLIAX_P_LOG, p->controldevice_name, strerror(errno));
+ SKYPIAX_P_LOG, p->controldevice_name, strerror(errno));
p->controldev_dead = 1;
close(p->controldevfd);
if (p->owner)
@@ -3866,28 +4355,28 @@
struct timeval call_incoming_timeout;
gettimeofday(&call_incoming_timeout, NULL);
call_incoming_timeout.tv_sec -= 3;
- DEBUGA_AT
+ DEBUGA_SKYPE
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ SKYPIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
if (call_incoming_timeout.tv_sec > p->call_incoming_time.tv_sec) {
p->call_incoming_time.tv_sec = 0;
p->call_incoming_time.tv_usec = 0;
- DEBUGA_AT
+ DEBUGA_SKYPE
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ SKYPIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
res = celliax_serial_write_AT_ack(p, "AT+CPBS=RC");
if (res) {
ERRORA
("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
p->phonebook_querying = 1;
res = celliax_serial_write_AT_ack(p, "AT+CPBR=?");
if (res) {
ERRORA
("AT+CPBS=RC (select memory of received calls) was not answered by the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
p->phonebook_querying = 0;
sprintf(list_command, "AT+CPBR=%d,%d", p->phonebook_first_entry,
@@ -3895,7 +4384,7 @@
p->phonebook_listing_received_calls = 1;
res = celliax_serial_write_AT_expect_longtime(p, list_command, "OK");
if (res) {
- WARNINGA("AT+CPBR=%d,%d failed, continue\n", CELLIAX_P_LOG,
+ WARNINGA("AT+CPBR=%d,%d failed, continue\n", SKYPIAX_P_LOG,
p->phonebook_first_entry, p->phonebook_last_entry);
}
p->phonebook_listing_received_calls = 0;
@@ -3906,14 +4395,14 @@
struct timeval call_incoming_timeout;
gettimeofday(&call_incoming_timeout, NULL);
call_incoming_timeout.tv_sec -= 10;
- DEBUGA_AT
+ DEBUGA_SKYPE
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ SKYPIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
if (call_incoming_timeout.tv_sec > p->ringtime.tv_sec) {
- ERRORA("Ringing stopped and I have not answered. Why?\n", CELLIAX_P_LOG);
- DEBUGA_AT
+ ERRORA("Ringing stopped and I have not answered. Why?\n", SKYPIAX_P_LOG);
+ DEBUGA_SKYPE
("CALLFLOW_CALL_INCOMING call_incoming_time.tv_sec=%ld, call_incoming_timeout.tv_sec=%ld\n",
- CELLIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
+ SKYPIAX_P_LOG, p->call_incoming_time.tv_sec, call_incoming_timeout.tv_sec);
if (p->owner) {
celliax_queue_control(p->owner, AST_CONTROL_HANGUP);
p->owner->hangupcause = AST_CAUSE_FAILURE;
@@ -3921,14 +4410,14 @@
}
}
p->line_array.elemcount = la_counter;
- //NOTICA (" OUTSIDE this celliax_serial_device %s \n", CELLIAX_P_LOG, p->controldevice_name);
+ //NOTICA (" OUTSIDE this celliax_serial_device %s \n", SKYPIAX_P_LOG, p->controldevice_name);
if (look_for_ack)
return at_ack;
else
return 0;
}
-int celliax_serial_write_AT(struct celliax_pvt *p, const char *data)
+int celliax_serial_write_AT(private_t * tech_pvt, const char *data)
{
int howmany;
int i;
@@ -3941,65 +4430,65 @@
res = write(p->controldevfd, &data[i], 1);
if (res != 1) {
- DEBUGA_AT("Error sending (%.1s): %d (%s)\n", CELLIAX_P_LOG, &data[i], res,
+ DEBUGA_SKYPE("Error sending (%.1s): %d (%s)\n", SKYPIAX_P_LOG, &data[i], res,
strerror(errno));
usleep(100000);
for (count = 0; count < 10; count++) {
res = write(p->controldevfd, &data[i], 1);
if (res == 1) {
- DEBUGA_AT("Successfully RE-sent (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i],
+ DEBUGA_SKYPE("Successfully RE-sent (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i],
count, res, strerror(errno));
break;
} else
- DEBUGA_AT("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i],
+ DEBUGA_SKYPE("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i],
count, res, strerror(errno));
usleep(100000);
}
if (res != 1) {
- ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count,
+ ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count,
res, strerror(errno));
return -1;
}
}
if (option_debug > 1)
- DEBUGA_AT("sent data... (%.1s)\n", CELLIAX_P_LOG, &data[i]);
+ DEBUGA_SKYPE("sent data... (%.1s)\n", SKYPIAX_P_LOG, &data[i]);
usleep(1000); /* release the cpu */
}
res = write(p->controldevfd, "\r", 1);
if (res != 1) {
- DEBUGA_AT("Error sending (carriage return): %d (%s)\n", CELLIAX_P_LOG, res,
+ DEBUGA_SKYPE("Error sending (carriage return): %d (%s)\n", SKYPIAX_P_LOG, res,
strerror(errno));
usleep(100000);
for (count = 0; count < 10; count++) {
res = write(p->controldevfd, "\r", 1);
if (res == 1) {
- DEBUGA_AT("Successfully RE-sent carriage return: %d %d (%s)\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("Successfully RE-sent carriage return: %d %d (%s)\n", SKYPIAX_P_LOG,
count, res, strerror(errno));
break;
} else
- DEBUGA_AT("Error RE-sending (carriage return): %d %d (%s)\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("Error RE-sending (carriage return): %d %d (%s)\n", SKYPIAX_P_LOG,
count, res, strerror(errno));
usleep(100000);
}
if (res != 1) {
- ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", CELLIAX_P_LOG, count,
+ ERRORA("Error RE-sending (carriage return): %d %d (%s)\n", SKYPIAX_P_LOG, count,
res, strerror(errno));
return -1;
}
}
if (option_debug > 1)
- DEBUGA_AT("sent (carriage return)\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("sent (carriage return)\n", SKYPIAX_P_LOG);
usleep(1000); /* release the cpu */
return howmany;
}
-int celliax_serial_write_AT_nocr(struct celliax_pvt *p, const char *data)
+int celliax_serial_write_AT_nocr(private_t * tech_pvt, const char *data)
{
int howmany;
int i;
@@ -4012,7 +4501,7 @@
res = write(p->controldevfd, &data[i], 1);
if (res != 1) {
- DEBUGA_AT("Error sending (%.1s): %d (%s)\n", CELLIAX_P_LOG, &data[i], res,
+ DEBUGA_SKYPE("Error sending (%.1s): %d (%s)\n", SKYPIAX_P_LOG, &data[i], res,
strerror(errno));
usleep(100000);
for (count = 0; count < 10; count++) {
@@ -4020,19 +4509,19 @@
if (res == 1)
break;
else
- DEBUGA_AT("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i],
+ DEBUGA_SKYPE("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i],
count, res, strerror(errno));
usleep(100000);
}
if (res != 1) {
- ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", CELLIAX_P_LOG, &data[i], count,
+ ERRORA("Error RE-sending (%.1s): %d %d (%s)\n", SKYPIAX_P_LOG, &data[i], count,
res, strerror(errno));
return -1;
}
}
if (option_debug > 1)
- DEBUGA_AT("sent data... (%.1s)\n", CELLIAX_P_LOG, &data[i]);
+ DEBUGA_SKYPE("sent data... (%.1s)\n", SKYPIAX_P_LOG, &data[i]);
usleep(1000); /* release the cpu */
}
@@ -4041,17 +4530,17 @@
return howmany;
}
-int celliax_serial_write_AT_noack(struct celliax_pvt *p, const char *data)
+int celliax_serial_write_AT_noack(private_t * tech_pvt, const char *data)
{
if (option_debug > 1)
- DEBUGA_AT("celliax_serial_write_AT_noack: %s\n", CELLIAX_P_LOG, data);
+ DEBUGA_SKYPE("celliax_serial_write_AT_noack: %s\n", SKYPIAX_P_LOG, data);
PUSHA_UNLOCKA(&p->controldev_lock);
LOKKA(&p->controldev_lock);
if (celliax_serial_write_AT(p, data) != strlen(data)) {
- ERRORA("Error sending data... (%s)\n", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s)\n", SKYPIAX_P_LOG, strerror(errno));
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -4061,16 +4550,16 @@
return 0;
}
-int celliax_serial_write_AT_ack(struct celliax_pvt *p, const char *data)
+int celliax_serial_write_AT_ack(private_t * tech_pvt, const char *data)
{
int at_result = AT_ERROR;
PUSHA_UNLOCKA(&p->controldev_lock);
LOKKA(&p->controldev_lock);
if (option_debug > 1)
- DEBUGA_AT("sending: %s\n", CELLIAX_P_LOG, data);
+ DEBUGA_SKYPE("sending: %s\n", SKYPIAX_P_LOG, data);
if (celliax_serial_write_AT(p, data) != strlen(data)) {
- ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s) \n", SKYPIAX_P_LOG, strerror(errno));
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -4083,16 +4572,16 @@
}
-int celliax_serial_write_AT_ack_nocr_longtime(struct celliax_pvt *p, const char *data)
+int celliax_serial_write_AT_ack_nocr_longtime(private_t * tech_pvt, const char *data)
{
int at_result = AT_ERROR;
PUSHA_UNLOCKA(&p->controldev_lock);
LOKKA(&p->controldev_lock);
if (option_debug > 1)
- DEBUGA_AT("sending: %s\n", CELLIAX_P_LOG, data);
+ DEBUGA_SKYPE("sending: %s\n", SKYPIAX_P_LOG, data);
if (celliax_serial_write_AT_nocr(p, data) != strlen(data)) {
- ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s) \n", SKYPIAX_P_LOG, strerror(errno));
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -4105,7 +4594,7 @@
}
-int celliax_serial_write_AT_expect1(struct celliax_pvt *p, const char *data,
+int celliax_serial_write_AT_expect1(private_t * tech_pvt, const char *data,
const char *expected_string, int expect_crlf,
int seconds)
{
@@ -4114,9 +4603,9 @@
PUSHA_UNLOCKA(&p->controldev_lock);
LOKKA(&p->controldev_lock);
if (option_debug > 1)
- DEBUGA_AT("sending: %s, expecting: %s\n", CELLIAX_P_LOG, data, expected_string);
+ DEBUGA_SKYPE("sending: %s, expecting: %s\n", SKYPIAX_P_LOG, data, expected_string);
if (celliax_serial_write_AT(p, data) != strlen(data)) {
- ERRORA("Error sending data... (%s) \n", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("Error sending data... (%s) \n", SKYPIAX_P_LOG, strerror(errno));
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -4129,7 +4618,7 @@
}
-int celliax_serial_AT_expect(struct celliax_pvt *p, const char *expected_string,
+int celliax_serial_AT_expect(private_t * tech_pvt, const char *expected_string,
int expect_crlf, int seconds)
{
int at_result = AT_ERROR;
@@ -4137,7 +4626,7 @@
PUSHA_UNLOCKA(&p->controldev_lock);
LOKKA(&p->controldev_lock);
if (option_debug > 1)
- DEBUGA_AT("expecting: %s\n", CELLIAX_P_LOG, expected_string);
+ DEBUGA_SKYPE("expecting: %s\n", SKYPIAX_P_LOG, expected_string);
at_result = celliax_serial_read_AT(p, 1, 500000, seconds, expected_string, expect_crlf); // 20.5 sec timeout, used for querying the SIM and sending SMSs
UNLOCKA(&p->controldev_lock);
@@ -4147,43 +4636,43 @@
}
-int celliax_serial_answer_AT(struct celliax_pvt *p)
+int celliax_serial_answer_AT(private_t * tech_pvt)
{
int res;
res = celliax_serial_write_AT_expect(p, p->at_answer, p->at_answer_expect);
if (res) {
- DEBUGA_AT
+ DEBUGA_SKYPE
("at_answer command failed, command used: %s, expecting: %s, trying with AT+CKPD=\"S\"\n",
- CELLIAX_P_LOG, p->at_answer, p->at_answer_expect);
+ SKYPIAX_P_LOG, p->at_answer, p->at_answer_expect);
res = celliax_serial_write_AT_ack(p, "AT+CKPD=\"S\"");
if (res) {
ERRORA("at_answer command failed, command used: 'AT+CKPD=\"S\"', giving up\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
return -1;
}
}
//p->interface_state = AST_STATE_UP;
//p->phone_callflow = CALLFLOW_CALL_ACTIVE;
- DEBUGA_AT("AT: call answered\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT: call answered\n", SKYPIAX_P_LOG);
return 0;
}
-int celliax_serial_hangup_AT(struct celliax_pvt *p)
+int celliax_serial_hangup_AT(private_t * tech_pvt)
{
int res;
if (p->interface_state != AST_STATE_DOWN) {
res = celliax_serial_write_AT_expect(p, p->at_hangup, p->at_hangup_expect);
if (res) {
- DEBUGA_AT
+ DEBUGA_SKYPE
("at_hangup command failed, command used: %s, trying to use AT+CKPD=\"EEE\"\n",
- CELLIAX_P_LOG, p->at_hangup);
+ SKYPIAX_P_LOG, p->at_hangup);
res = celliax_serial_write_AT_ack(p, "AT+CKPD=\"EEE\"");
if (res) {
ERRORA("at_hangup command failed, command used: 'AT+CKPD=\"EEE\"'\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
return -1;
}
}
@@ -4193,13 +4682,13 @@
return 0;
}
-int celliax_serial_config_AT(struct celliax_pvt *p)
+int celliax_serial_config_AT(private_t * tech_pvt)
{
int res;
/* initial_pause? */
if (p->at_initial_pause) {
- DEBUGA_AT("sleeping for %d usec\n", CELLIAX_P_LOG, p->at_initial_pause);
+ DEBUGA_SKYPE("sleeping for %d usec\n", SKYPIAX_P_LOG, p->at_initial_pause);
usleep(p->at_initial_pause);
}
@@ -4209,7 +4698,7 @@
if (strlen(p->at_preinit_1)) {
res = celliax_serial_write_AT_expect(p, p->at_preinit_1, p->at_preinit_1_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_preinit_1, p->at_preinit_1_expect);
}
} else {
@@ -4219,7 +4708,7 @@
if (strlen(p->at_preinit_2)) {
res = celliax_serial_write_AT_expect(p, p->at_preinit_2, p->at_preinit_2_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_preinit_2, p->at_preinit_2_expect);
}
} else {
@@ -4229,7 +4718,7 @@
if (strlen(p->at_preinit_3)) {
res = celliax_serial_write_AT_expect(p, p->at_preinit_3, p->at_preinit_3_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_preinit_3, p->at_preinit_3_expect);
}
} else {
@@ -4239,7 +4728,7 @@
if (strlen(p->at_preinit_4)) {
res = celliax_serial_write_AT_expect(p, p->at_preinit_4, p->at_preinit_4_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_preinit_4, p->at_preinit_4_expect);
}
} else {
@@ -4249,7 +4738,7 @@
if (strlen(p->at_preinit_5)) {
res = celliax_serial_write_AT_expect(p, p->at_preinit_5, p->at_preinit_5_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_preinit_5, p->at_preinit_5_expect);
}
} else {
@@ -4261,21 +4750,21 @@
/* after_preinit_pause? */
if (p->at_after_preinit_pause) {
- DEBUGA_AT("sleeping for %d usec\n", CELLIAX_P_LOG, p->at_after_preinit_pause);
+ DEBUGA_SKYPE("sleeping for %d usec\n", SKYPIAX_P_LOG, p->at_after_preinit_pause);
usleep(p->at_after_preinit_pause);
}
/* phone, brother, art you alive? */
res = celliax_serial_write_AT_ack(p, "AT");
if (res) {
- ERRORA("no response to AT\n", CELLIAX_P_LOG);
+ ERRORA("no response to AT\n", SKYPIAX_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(p, "AT+mode=0");
if (res) {
- DEBUGA_AT("AT+mode=0 does not get OK from the phone. If it is NOT Motorola,"
- " no problem.\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+mode=0 does not get OK from the phone. If it is NOT Motorola,"
+ " no problem.\n", SKYPIAX_P_LOG);
}
usleep(50000);
/* for motorola end */
@@ -4283,19 +4772,19 @@
/* reset AT configuration to phone default */
res = celliax_serial_write_AT_ack(p, "ATZ");
if (res) {
- DEBUGA_AT("ATZ failed\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("ATZ failed\n", SKYPIAX_P_LOG);
}
/* disable AT command echo */
res = celliax_serial_write_AT_ack(p, "ATE0");
if (res) {
- DEBUGA_AT("ATE0 failed\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("ATE0 failed\n", SKYPIAX_P_LOG);
}
/* disable extended error reporting */
res = celliax_serial_write_AT_ack(p, "AT+CMEE=0");
if (res) {
- DEBUGA_AT("AT+CMEE failed\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CMEE failed\n", SKYPIAX_P_LOG);
}
/* various phone manufacturer identifier */
@@ -4306,25 +4795,25 @@
sprintf(at_command, "ATI%d", i);
res = celliax_serial_write_AT_ack(p, at_command);
if (res) {
- DEBUGA_AT("ATI%d command failed, continue\n", CELLIAX_P_LOG, i);
+ DEBUGA_SKYPE("ATI%d command failed, continue\n", SKYPIAX_P_LOG, i);
}
}
/* phone manufacturer */
res = celliax_serial_write_AT_ack(p, "AT+CGMI");
if (res) {
- DEBUGA_AT("AT+CGMI failed\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CGMI failed\n", SKYPIAX_P_LOG);
}
/* phone model */
res = celliax_serial_write_AT_ack(p, "AT+CGMM");
if (res) {
- DEBUGA_AT("AT+CGMM failed\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CGMM failed\n", SKYPIAX_P_LOG);
}
res = celliax_serial_write_AT_ack(p, "AT+CGSN");
if (res) {
- DEBUGA_AT("AT+CGSN failed\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CGSN failed\n", SKYPIAX_P_LOG);
}
/* this take a lot of time to complete on devices with slow serial link (eg.: 9600bps) */
@@ -4332,35 +4821,35 @@
/* ask for the list of supported AT commands, useful to implement new models and debugging */
res = celliax_serial_write_AT_ack(p, "AT+CLAC");
if (res) {
- DEBUGA_AT("AT+CLAC failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CLAC failed, continue\n", SKYPIAX_P_LOG);
}
#endif
/* signal incoming SMS with a +CMTI unsolicited msg */
res = celliax_serial_write_AT_ack(p, "AT+CNMI=3,1,0,0,0");
if (res) {
- DEBUGA_AT("AT+CNMI=3,1,0,0,0 failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CNMI=3,1,0,0,0 failed, continue\n", SKYPIAX_P_LOG);
p->sms_cnmi_not_supported = 1;
p->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(p, "AT+CSCA?");
if (res) {
- DEBUGA_AT("AT+CSCA? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CSCA? failed, continue\n", SKYPIAX_P_LOG);
}
/* what is the Message Format of SMSs? */
res = celliax_serial_write_AT_ack(p, "AT+CMGF?");
if (res) {
- DEBUGA_AT("AT+CMGF? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CMGF? failed, continue\n", SKYPIAX_P_LOG);
}
res = celliax_serial_write_AT_ack(p, "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", CELLIAX_P_LOG);
+ ERRORA("Error setting SMS sending mode to TEXT on the cellphone\n", SKYPIAX_P_LOG);
return RESULT_FAILURE;
}
/* what is the Charset of SMSs? */
res = celliax_serial_write_AT_ack(p, "AT+CSCS?");
if (res) {
- DEBUGA_AT("AT+CSCS? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CSCS? failed, continue\n", SKYPIAX_P_LOG);
}
p->no_ucs2 = 0;
@@ -4368,7 +4857,7 @@
if (res) {
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);
+ SKYPIAX_P_LOG);
p->no_ucs2 = 1;
}
@@ -4376,48 +4865,48 @@
res = celliax_serial_write_AT_ack(p, "AT+CSCS=\"GSM\"");
if (res) {
WARNINGA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
//res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,16"); //"flash", class 0 sms 7 bit
res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,0"); //normal, 7 bit message
if (res) {
- WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", SKYPIAX_P_LOG);
}
} else {
//res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,20"); //"flash", class 0 sms 16 bit unicode
res = celliax_serial_write_AT_ack(p, "AT+CSMP=17,167,0,8"); //unicode, 16 bit message
if (res) {
- WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CSMP do not got OK from the phone, continuing\n", SKYPIAX_P_LOG);
}
}
/* is the unsolicited reporting of mobile equipment event supported? */
res = celliax_serial_write_AT_ack(p, "AT+CMER=?");
if (res) {
- DEBUGA_AT("AT+CMER=? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CMER=? failed, continue\n", SKYPIAX_P_LOG);
}
/* request unsolicited reporting of mobile equipment indicators' events, to be screened by categories reported by +CIND=? */
res = celliax_serial_write_AT_ack(p, "AT+CMER=3,0,0,1");
if (res) {
- DEBUGA_AT("AT+CMER=? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CMER=? failed, continue\n", SKYPIAX_P_LOG);
}
/* is the solicited reporting of mobile equipment indications supported? */
res = celliax_serial_write_AT_ack(p, "AT+CIND=?");
if (res) {
- DEBUGA_AT("AT+CIND=? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CIND=? failed, continue\n", SKYPIAX_P_LOG);
}
/* is the unsolicited reporting of call monitoring supported? sony-ericsson specific */
res = celliax_serial_write_AT_ack(p, "AT*ECAM=?");
if (res) {
- DEBUGA_AT("AT*ECAM=? failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT*ECAM=? failed, continue\n", SKYPIAX_P_LOG);
}
/* enable the unsolicited reporting of call monitoring. sony-ericsson specific */
res = celliax_serial_write_AT_ack(p, "AT*ECAM=1");
if (res) {
- DEBUGA_AT("AT*ECAM=1 failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT*ECAM=1 failed, continue\n", SKYPIAX_P_LOG);
p->at_has_ecam = 0;
} else {
p->at_has_ecam = 1;
@@ -4426,7 +4915,7 @@
/* disable unsolicited signaling of call list */
res = celliax_serial_write_AT_ack(p, "AT+CLCC=0");
if (res) {
- DEBUGA_AT("AT+CLCC=0 failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CLCC=0 failed, continue\n", SKYPIAX_P_LOG);
p->at_has_clcc = 0;
} else {
p->at_has_clcc = 1;
@@ -4435,15 +4924,15 @@
/* give unsolicited caller id when incoming call */
res = celliax_serial_write_AT_ack(p, "AT+CLIP=1");
if (res) {
- DEBUGA_AT("AT+CLIP failed, continue\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+CLIP failed, continue\n", SKYPIAX_P_LOG);
}
/* for motorola */
res = celliax_serial_write_AT_ack(p, "AT+MCST=1"); /* motorola call control codes
(to know when call is disconnected (they
don't give you "no carrier") */
if (res) {
- DEBUGA_AT("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola,"
- " no problem.\n", CELLIAX_P_LOG);
+ DEBUGA_SKYPE("AT+MCST=1 does not get OK from the phone. If it is NOT Motorola,"
+ " no problem.\n", SKYPIAX_P_LOG);
}
/* for motorola end */
@@ -4453,7 +4942,7 @@
if (strlen(p->at_postinit_1)) {
res = celliax_serial_write_AT_expect(p, p->at_postinit_1, p->at_postinit_1_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_postinit_1, p->at_postinit_1_expect);
}
} else {
@@ -4463,7 +4952,7 @@
if (strlen(p->at_postinit_2)) {
res = celliax_serial_write_AT_expect(p, p->at_postinit_2, p->at_postinit_2_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_postinit_2, p->at_postinit_2_expect);
}
} else {
@@ -4473,7 +4962,7 @@
if (strlen(p->at_postinit_3)) {
res = celliax_serial_write_AT_expect(p, p->at_postinit_3, p->at_postinit_3_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_postinit_3, p->at_postinit_3_expect);
}
} else {
@@ -4483,7 +4972,7 @@
if (strlen(p->at_postinit_4)) {
res = celliax_serial_write_AT_expect(p, p->at_postinit_4, p->at_postinit_4_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_postinit_4, p->at_postinit_4_expect);
}
} else {
@@ -4493,7 +4982,7 @@
if (strlen(p->at_postinit_5)) {
res = celliax_serial_write_AT_expect(p, p->at_postinit_5, p->at_postinit_5_expect);
if (res) {
- DEBUGA_AT("%s does not get %s from the phone. Continuing.\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("%s does not get %s from the phone. Continuing.\n", SKYPIAX_P_LOG,
p->at_postinit_5, p->at_postinit_5_expect);
}
} else {
@@ -4506,13 +4995,13 @@
return 0;
}
-int celliax_serial_call_AT(struct celliax_pvt *p, char *dstr)
+int celliax_serial_call_AT(private_t * tech_pvt, char *dstr)
{
int res;
char at_command[256];
if (option_debug)
- DEBUGA_PBX("Dialing %s\n", CELLIAX_P_LOG, dstr);
+ DEBUGA_PBX("Dialing %s\n", SKYPIAX_P_LOG, dstr);
memset(at_command, 0, sizeof(at_command));
p->phone_callflow = CALLFLOW_CALL_DIALING;
p->interface_state = AST_STATE_DIALING;
@@ -4520,14 +5009,14 @@
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",
- CELLIAX_P_LOG, dstr);
+ SKYPIAX_P_LOG, dstr);
return -1;
}
dstr[fixdstr] = '\0';
sprintf(at_command, "%s%s%s", p->at_dial_pre_number, dstr, p->at_dial_post_number);
res = celliax_serial_write_AT_expect(p, at_command, p->at_dial_expect);
if (res) {
- ERRORA("dial command failed, dial string was: %s\n", CELLIAX_P_LOG, at_command);
+ ERRORA("dial command failed, dial string was: %s\n", SKYPIAX_P_LOG, at_command);
return -1;
}
// jet - early audio
@@ -4540,7 +5029,7 @@
int celliax_console_at(int fd, int argc, char *argv[])
{
- struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active);
+ private_t * tech_pvt = celliax_console_find_desc(celliax_console_active);
char at_cmd[1024];
int i, a, c;
@@ -4649,7 +5138,7 @@
return RESULT_SUCCESS; //never reached
}
-int ucs2_to_utf8(struct celliax_pvt *p, char *ucs2_in, char *utf8_out,
+int ucs2_to_utf8(private_t * tech_pvt, char *ucs2_in, char *utf8_out,
size_t outbytesleft)
{
char converted[16000];
@@ -4665,7 +5154,7 @@
memset(converted, '\0', sizeof(converted));
- DEBUGA_AT("ucs2_in=%s\n", CELLIAX_P_LOG, ucs2_in);
+ DEBUGA_SKYPE("ucs2_in=%s\n", SKYPIAX_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]);
@@ -4680,29 +5169,29 @@
iconv_format = iconv_open("UTF8", "UCS-2BE");
if (iconv_format == (iconv_t) - 1) {
- ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("error: %s\n", SKYPIAX_P_LOG, strerror(errno));
return -1;
}
inbytesleft = i;
iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
if (iconv_res == (size_t) - 1) {
- DEBUGA_AT("ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
- CELLIAX_P_LOG, inbuf, inbytesleft, outbuf, outbytesleft, converted,
+ DEBUGA_SKYPE("ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
+ SKYPIAX_P_LOG, inbuf, inbytesleft, outbuf, outbytesleft, converted,
utf8_out);
- DEBUGA_AT("error: %s %d\n", CELLIAX_P_LOG, strerror(errno), errno);
+ DEBUGA_SKYPE("error: %s %d\n", SKYPIAX_P_LOG, strerror(errno), errno);
return -1;
}
- DEBUGA_AT
+ DEBUGA_SKYPE
("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
- CELLIAX_P_LOG, iconv_res, inbuf, inbytesleft, outbuf, outbytesleft, converted,
+ SKYPIAX_P_LOG, iconv_res, inbuf, inbytesleft, outbuf, outbytesleft, converted,
utf8_out);
iconv_close(iconv_format);
return 0;
}
-int utf_to_ucs2(struct celliax_pvt *p, char *utf_in, size_t inbytesleft, char *ucs2_out,
+int utf_to_ucs2(private_t * tech_pvt, char *utf_in, size_t inbytesleft, char *ucs2_out,
size_t outbytesleft)
{
/* cicopet */
@@ -4722,21 +5211,21 @@
iconv_format = iconv_open("UCS-2BE", "UTF8");
if (iconv_format == (iconv_t) - 1) {
- ERRORA("error: %s\n", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("error: %s\n", SKYPIAX_P_LOG, strerror(errno));
return -1;
}
outbytesleft = 16000;
- DEBUGA_AT("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n",
- CELLIAX_P_LOG, inbuf, inbytesleft, outbuf, outbytesleft, utf_in, converted);
+ DEBUGA_SKYPE("in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n",
+ SKYPIAX_P_LOG, inbuf, inbytesleft, outbuf, outbytesleft, utf_in, converted);
iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
if (iconv_res == (size_t) - 1) {
- ERRORA("error: %s %d\n", CELLIAX_P_LOG, strerror(errno), errno);
+ ERRORA("error: %s %d\n", SKYPIAX_P_LOG, strerror(errno), errno);
return -1;
}
- DEBUGA_AT
+ DEBUGA_SKYPE
("iconv_res=%d, in=%s, inleft=%d, out=%s, outleft=%d, utf_in=%s, converted=%s\n",
- CELLIAX_P_LOG, iconv_res, inbuf, inbytesleft, outbuf, outbytesleft, utf_in,
+ SKYPIAX_P_LOG, iconv_res, inbuf, inbytesleft, outbuf, outbytesleft, utf_in,
converted);
iconv_close(iconv_format);
@@ -4744,11 +5233,11 @@
memset(stringa, '\0', sizeof(stringa));
memset(stringa2, '\0', sizeof(stringa2));
sprintf(stringa, "%02X", converted[i]);
- DEBUGA_AT("character is |%02X|\n", CELLIAX_P_LOG, converted[i]);
+ DEBUGA_SKYPE("character is |%02X|\n", SKYPIAX_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_AT("stringa=%s, stringa2=%s, ucs2_out=%s\n", CELLIAX_P_LOG, stringa, stringa2,
+ DEBUGA_SKYPE("stringa=%s, stringa2=%s, ucs2_out=%s\n", SKYPIAX_P_LOG, stringa, stringa2,
ucs2_out);
}
return 0;
@@ -4758,7 +5247,7 @@
{
char *idest = data;
char rdest[256];
- struct celliax_pvt *p = NULL;
+ private_t * tech_pvt = NULL;
char *device;
char *dest;
char *text;
@@ -4814,8 +5303,8 @@
if (strncmp(device, p->name, length) == 0) {
/* this is the requested interface! */
if (option_debug)
- DEBUGA_AT("FOUND! interfacename:%s, destinationnumber:%s, text:%s, p->name=%s\n",
- CELLIAX_P_LOG, device, dest, text, p->name);
+ DEBUGA_SKYPE("FOUND! interfacename:%s, destinationnumber:%s, text:%s, p->name=%s\n",
+ SKYPIAX_P_LOG, device, dest, text, p->name);
found = 1;
break;
@@ -4833,7 +5322,7 @@
if (p->controldevprotocol != PROTOCOL_AT) {
ERRORA("CelliaxSendsms supports only AT command cellphones at the moment :-( !\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
return RESULT_FAILURE;
}
@@ -4854,7 +5343,7 @@
if (err) {
ERRORA
("AT+CSCS=\"UCS2\" (set TE messages to ucs2) do not got OK from the phone\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
memset(dest2, '\0', sizeof(dest2));
@@ -4865,26 +5354,26 @@
//TODO would be better to lock controldev here
err = celliax_serial_write_AT_noack(p, smscommand);
if (err) {
- ERRORA("Error sending SMS\n", CELLIAX_P_LOG);
+ ERRORA("Error sending SMS\n", SKYPIAX_P_LOG);
failed = 1;
goto uscita;
}
err = celliax_serial_AT_expect(p, "> ", 0, 1); // wait 1.5s for the prompt, no crlf
#if 1
if (err) {
- DEBUGA_AT
+ DEBUGA_SKYPE
("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",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
err = celliax_serial_write_AT_ack(p, "ATE1"); //motorola (at least c350) do not echo the '>' prompt when in ATE0... go figure!!!!
if (err) {
- ERRORA("Error activating echo from modem\n", CELLIAX_P_LOG);
+ ERRORA("Error activating echo from modem\n", SKYPIAX_P_LOG);
}
p->at_cmgw[0] = '\0';
sprintf(smscommand, "AT+CMGW=\"%s\"", dest); //TODO: support phones that only accept pdu mode
err = celliax_serial_write_AT_noack(p, smscommand);
if (err) {
- ERRORA("Error writing SMS destination to the cellphone memory\n", CELLIAX_P_LOG);
+ ERRORA("Error writing SMS destination to the cellphone memory\n", SKYPIAX_P_LOG);
failed = 1;
goto uscita;
}
@@ -4892,7 +5381,7 @@
if (err) {
ERRORA
("Error or timeout getting prompt '> ' for writing sms text in cellphone memory\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
failed = 1;
goto uscita;
}
@@ -4908,13 +5397,13 @@
}
smscommand[strlen(smscommand)] = 0x1A;
- DEBUGA_AT("smscommand len is: %d, text is:|||%s|||\n", CELLIAX_P_LOG,
+ DEBUGA_SKYPE("smscommand len is: %d, text is:|||%s|||\n", SKYPIAX_P_LOG,
strlen(smscommand), smscommand);
err = celliax_serial_write_AT_ack_nocr_longtime(p, smscommand);
//TODO would be better to unlock controldev here
if (err) {
- ERRORA("Error writing SMS text to the cellphone memory\n", CELLIAX_P_LOG);
+ ERRORA("Error writing SMS text to the cellphone memory\n", SKYPIAX_P_LOG);
//return RESULT_FAILURE;
failed = 1;
goto uscita;
@@ -4923,7 +5412,7 @@
sprintf(smscommand, "AT+CMSS=%s", p->at_cmgw);
err = celliax_serial_write_AT_expect_longtime(p, smscommand, "OK");
if (err) {
- ERRORA("Error sending SMS from the cellphone memory\n", CELLIAX_P_LOG);
+ ERRORA("Error sending SMS from the cellphone memory\n", SKYPIAX_P_LOG);
//return RESULT_FAILURE;
failed = 1;
goto uscita;
@@ -4931,7 +5420,7 @@
err = celliax_serial_write_AT_ack(p, "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", CELLIAX_P_LOG);
+ ERRORA("Error de-activating echo from modem\n", SKYPIAX_P_LOG);
}
}
uscita:
@@ -4943,14 +5432,14 @@
sprintf(smscommand, "AT+CMGR=%s", p->at_cmgw);
err = celliax_serial_write_AT_ack(p, smscommand);
if (err) {
- ERRORA("Error reading SMS back from the cellphone memory\n", CELLIAX_P_LOG);
+ ERRORA("Error reading SMS back from the cellphone memory\n", SKYPIAX_P_LOG);
}
/* let's delete from cellphone memory what we've sent */
sprintf(smscommand, "AT+CMGD=%s", p->at_cmgw);
err = celliax_serial_write_AT_ack(p, smscommand);
if (err) {
- ERRORA("Error deleting SMS from the cellphone memory\n", CELLIAX_P_LOG);
+ ERRORA("Error deleting SMS from the cellphone memory\n", SKYPIAX_P_LOG);
}
p->at_cmgw[0] = '\0';
@@ -4979,7 +5468,7 @@
{
//TODO: all the realtime stuff has to be re-made
struct ast_config *cfg;
- struct celliax_pvt *p = NULL;
+ private_t * tech_pvt = NULL;
#ifdef ASTERISK_VERSION_1_6_0
struct ast_flags config_flags = { 0 };
#endif /* ASTERISK_VERSION_1_6_0 */
@@ -4995,7 +5484,7 @@
/* Loading config failed. */
WARNINGA
("Loading directoriax.conf config file failed. It's not necessary, continuing.\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
return NULL;
}
return cfg;
@@ -5076,7 +5565,7 @@
struct ast_variable *v;
char *start, *pos, *stringp, *space, *options = NULL, *conv = NULL;
- struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active);
+ private_t * tech_pvt = celliax_console_find_desc(celliax_console_active);
char *context = "default";
char *s;
char *var, *value;
@@ -5134,18 +5623,18 @@
#endif /* CELLIAX_LIBCSV */
if (option_debug)
- NOTICA("celliax_cellphonenumber is: %s\n", CELLIAX_P_LOG, argv[2]);
+ NOTICA("celliax_cellphonenumber is: %s\n", SKYPIAX_P_LOG, argv[2]);
#ifdef CELLIAX_LIBCSV
if (tocsv) {
if (option_debug)
- NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]);
+ NOTICA("filename is: %s\n", SKYPIAX_P_LOG, argv[3]);
//ast_cli(fd, "\n\nnot yet implemented :P \n");
//return RESULT_SUCCESS;
}
if (tovcf) {
if (option_debug)
- NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]);
+ NOTICA("filename is: %s\n", SKYPIAX_P_LOG, argv[3]);
ast_cli(fd, "\n\nnot yet implemented :P \n");
return RESULT_SUCCESS;
}
@@ -5160,18 +5649,18 @@
/* which phonebook to use, use the SIM */
res = celliax_serial_write_AT_ack(p, "AT+CPBS=SM");
if (res) {
- WARNINGA("AT+CPBS=SM failed, continue\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CPBS=SM failed, continue\n", SKYPIAX_P_LOG);
}
/* which phonebook to use, trying to use phone, not SIM */
res = celliax_serial_write_AT_ack(p, "AT+CPBS=ME");
if (res) {
- WARNINGA("AT+CPBS=ME failed, continue\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CPBS=ME failed, continue\n", SKYPIAX_P_LOG);
}
/* retrieve the fields lenght in the selected phonebook */
p->phonebook_querying = 1;
res = celliax_serial_write_AT_ack(p, "AT+CPBR=?");
if (res) {
- WARNINGA("AT+CPBR=? failed, continue\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CPBR=? failed, continue\n", SKYPIAX_P_LOG);
}
p->phonebook_querying = 0;
@@ -5199,8 +5688,8 @@
memset(entry_text, 0, sizeof(entry_text));
memset(final_entry_text, 0, sizeof(final_entry_text));
- DEBUGA_AT("v->name=%s\n", CELLIAX_P_LOG, v->name);
- DEBUGA_AT("v->value=%s\n", CELLIAX_P_LOG, v->value);
+ DEBUGA_SKYPE("v->name=%s\n", SKYPIAX_P_LOG, v->name);
+ DEBUGA_SKYPE("v->value=%s\n", SKYPIAX_P_LOG, v->value);
stringp = start;
strsep(&stringp, ",");
@@ -5213,19 +5702,19 @@
}
if (pos) {
conv = celliax_dir_convert(pos);
- DEBUGA_AT("<pos=>%s<conv=>%s<\n", CELLIAX_P_LOG, pos, conv);
+ DEBUGA_SKYPE("<pos=>%s<conv=>%s<\n", SKYPIAX_P_LOG, pos, conv);
options = strdup(v->value);
strsep(&options, ",");
strsep(&options, ",");
strsep(&options, ",");
strsep(&options, ",");
- DEBUGA_AT("options=%s\n", CELLIAX_P_LOG, options);
+ DEBUGA_SKYPE("options=%s\n", SKYPIAX_P_LOG, options);
while ((s = strsep(&options, "|"))) {
value = s;
if ((var = strsep(&value, "=")) && value) {
- DEBUGA_AT("var=%s value=%s\n", CELLIAX_P_LOG, var, value);
+ DEBUGA_SKYPE("var=%s value=%s\n", SKYPIAX_P_LOG, var, value);
if (!strcmp(var, "phonebook_direct_calling_ext"))
strncpy(phonebook_direct_calling_ext, value, 6);
}
@@ -5238,7 +5727,7 @@
if (res == (p->phonebook_number_lenght + 1)
|| res > (p->phonebook_number_lenght + 1)) {
ERRORA("entry_number truncated, was: '%s%s%d%s%s', now is: '%s'\n",
- CELLIAX_P_LOG, argv[2], "p", p->celliax_dir_prefix, "p",
+ SKYPIAX_P_LOG, argv[2], "p", p->celliax_dir_prefix, "p",
phonebook_direct_calling_ext, entry_number);
//FIXME: abort ???
@@ -5253,10 +5742,10 @@
|| res > (sizeof(write_entry_command) - 1)) {
WARNINGA
("write_entry_command truncated, was supposed: 'AT+CPBW=,\"%s\",,\"%s\"', now is: '%s'\n",
- CELLIAX_P_LOG, entry_number, final_entry_text, write_entry_command);
+ SKYPIAX_P_LOG, entry_number, final_entry_text, write_entry_command);
}
//if (option_debug)
- NOTICA("%s\n", CELLIAX_P_LOG, write_entry_command);
+ NOTICA("%s\n", SKYPIAX_P_LOG, write_entry_command);
}
}
if (conv)
@@ -5296,8 +5785,8 @@
memset(entry_text, 0, sizeof(entry_text));
memset(final_entry_text, 0, sizeof(final_entry_text));
- DEBUGA_AT("v->name=%s\n", CELLIAX_P_LOG, v->name);
- DEBUGA_AT("v->value=%s\n", CELLIAX_P_LOG, v->value);
+ DEBUGA_SKYPE("v->name=%s\n", SKYPIAX_P_LOG, v->name);
+ DEBUGA_SKYPE("v->value=%s\n", SKYPIAX_P_LOG, v->value);
stringp = start;
strsep(&stringp, ",");
@@ -5310,19 +5799,19 @@
}
if (pos) {
conv = celliax_dir_convert(pos);
- DEBUGA_AT("<pos=>%s<conv=>%s<\n", CELLIAX_P_LOG, pos, conv);
+ DEBUGA_SKYPE("<pos=>%s<conv=>%s<\n", SKYPIAX_P_LOG, pos, conv);
options = strdup(v->value);
strsep(&options, ",");
strsep(&options, ",");
strsep(&options, ",");
strsep(&options, ",");
- DEBUGA_AT("options=%s\n", CELLIAX_P_LOG, options);
+ DEBUGA_SKYPE("options=%s\n", SKYPIAX_P_LOG, options);
while ((s = strsep(&options, "|"))) {
value = s;
if ((var = strsep(&value, "=")) && value) {
- DEBUGA_AT("var=%s value=%s\n", CELLIAX_P_LOG, var, value);
+ DEBUGA_SKYPE("var=%s value=%s\n", SKYPIAX_P_LOG, var, value);
if (!strcmp(var, "phonebook_direct_calling_ext"))
strncpy(phonebook_direct_calling_ext, value, 6);
}
@@ -5335,7 +5824,7 @@
if (res == (sizeof(entry_number) - 1)
|| res > (sizeof(entry_number) - 1)) {
ERRORA("entry_number truncated, was: '%s%s%d%s%s', now is: '%s'\n",
- CELLIAX_P_LOG, argv[2], "p", p->celliax_dir_prefix, "p",
+ SKYPIAX_P_LOG, argv[2], "p", p->celliax_dir_prefix, "p",
phonebook_direct_calling_ext, entry_number);
//FIXME: abort ???
@@ -5353,19 +5842,19 @@
write_entry_command[a] = ',';
a++;
}
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
write_entry_command[a] = '"';
a++;
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
for (i = 0; i < strlen(final_entry_text); i++) {
write_entry_command[a] = final_entry_text[i];
a++;
}
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
write_entry_command[a] = '"';
a++;
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
for (i = 0; i < (p->csv_business_phone_pos - p->csv_complete_name_pos); i++) {
if (p->csv_separator_is_semicolon)
write_entry_command[a] = ';';
@@ -5374,22 +5863,22 @@
a++;
}
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
write_entry_command[a] = '"';
a++;
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
for (i = 0; i < strlen(entry_number); i++) {
write_entry_command[a] = entry_number[i];
a++;
}
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
write_entry_command[a] = '"';
a++;
- //NOTICA("i=%d a=%d\n", CELLIAX_P_LOG, i, a);
+ //NOTICA("i=%d a=%d\n", SKYPIAX_P_LOG, i, a);
if (option_debug)
- NOTICA("%s\n", CELLIAX_P_LOG, write_entry_command);
+ NOTICA("%s\n", SKYPIAX_P_LOG, write_entry_command);
}
}
if (conv)
@@ -5415,7 +5904,7 @@
void celliax_cb1(char *s, size_t len, void *data)
{
- struct celliax_pvt *p = data;
+ private_t * tech_pvt = data;
char field_content[256];
p->csv_fields++;
@@ -5441,7 +5930,7 @@
void celliax_cb2(char c, void *data)
{
- struct celliax_pvt *p = data;
+ private_t * tech_pvt = data;
p->csv_rows++;
p->csv_fields = 0;
@@ -5453,7 +5942,7 @@
if (option_debug)
NOTICA
("ROW %d ENDED, complete_name=%s, email=%s, home_phone=%s, mobile_phone=%s, business_phone=%s\n",
- CELLIAX_P_LOG, p->csv_rows,
+ SKYPIAX_P_LOG, p->csv_rows,
strlen(p->csv_complete_name) ? p->csv_complete_name : "N/A",
strlen(p->csv_email) ? p->csv_email : "N/A",
strlen(p->csv_home_phone) ? p->csv_home_phone : "N/A",
@@ -5519,7 +6008,7 @@
int celliax_console_celliax_dir_import(int fd, int argc, char *argv[])
{
int res;
- struct celliax_pvt *p = celliax_console_find_desc(celliax_console_active);
+ private_t * tech_pvt = celliax_console_find_desc(celliax_console_active);
char list_command[64];
char fn[256];
char date[256] = "";
@@ -5591,7 +6080,7 @@
#ifdef CELLIAX_LIBCSV
if (fromvcf) {
if (option_debug)
- NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]);
+ NOTICA("filename is: %s\n", SKYPIAX_P_LOG, argv[3]);
ast_cli(fd, "\n\nnot yet implemented :P \n");
return RESULT_SUCCESS;
}
@@ -5605,7 +6094,7 @@
snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, configfile);
}
if (option_debug)
- NOTICA("Opening '%s'\n", CELLIAX_P_LOG, fn);
+ NOTICA("Opening '%s'\n", SKYPIAX_P_LOG, fn);
time(&t);
ast_copy_string(date, ctime(&t), sizeof(date));
@@ -5617,14 +6106,14 @@
if (p->phonebook_writing_fp) {
if (add_to_celliax_dir_conf) {
if (option_debug)
- NOTICA("Opened '%s' for appending \n", CELLIAX_P_LOG, fn);
+ NOTICA("Opened '%s' for appending \n", SKYPIAX_P_LOG, fn);
fprintf(p->phonebook_writing_fp, ";!\n");
fprintf(p->phonebook_writing_fp, ";! Update Date: %s", date);
fprintf(p->phonebook_writing_fp, ";! Updated by: %s, %d\n", __FILE__, __LINE__);
fprintf(p->phonebook_writing_fp, ";!\n");
} else {
if (option_debug)
- NOTICA("Opened '%s' for writing \n", CELLIAX_P_LOG, fn);
+ NOTICA("Opened '%s' for writing \n", SKYPIAX_P_LOG, fn);
fprintf(p->phonebook_writing_fp, ";!\n");
fprintf(p->phonebook_writing_fp, ";! Automatically generated configuration file\n");
fprintf(p->phonebook_writing_fp, ";! Filename: %s (%s)\n", configfile, fn);
@@ -5639,7 +6128,7 @@
//FIXME: if add_to_celliax_dir_conf parse the "old" config file, so to have the correct next entry id-exten
if (fromcsv) {
if (option_debug)
- NOTICA("filename is: %s\n", CELLIAX_P_LOG, argv[3]);
+ NOTICA("filename is: %s\n", SKYPIAX_P_LOG, argv[3]);
/************************/
FILE *fp;
@@ -5653,12 +6142,12 @@
if (p->csv_separator_is_semicolon) {
if (csv_init(&csvp, options | CSV_USE_SEMICOLON_SEPARATOR) != 0) {
- ERRORA("Failed to initialize csv parser\n", CELLIAX_P_LOG);
+ ERRORA("Failed to initialize csv parser\n", SKYPIAX_P_LOG);
return RESULT_SUCCESS;
}
} else {
if (csv_init(&csvp, options) != 0) {
- ERRORA("Failed to initialize csv parser\n", CELLIAX_P_LOG);
+ ERRORA("Failed to initialize csv parser\n", SKYPIAX_P_LOG);
return RESULT_SUCCESS;
}
@@ -5666,12 +6155,12 @@
fp = fopen(argv[3], "rb");
if (!fp) {
- ERRORA("Failed to open %s: %s\n", CELLIAX_P_LOG, argv[3], strerror(errno));
+ ERRORA("Failed to open %s: %s\n", SKYPIAX_P_LOG, argv[3], strerror(errno));
return RESULT_SUCCESS;
}
while ((bytes_read = fread(buf, 1, 1024, fp)) > 0) {
if (csv_parse(csvp, buf, bytes_read, celliax_cb1, celliax_cb2, p) != bytes_read) {
- ERRORA("Error while parsing file: %s\n", CELLIAX_P_LOG,
+ ERRORA("Error while parsing file: %s\n", SKYPIAX_P_LOG,
csv_strerror(csv_error(csvp)));
}
}
@@ -5679,14 +6168,14 @@
csv_fini(csvp, celliax_cb1, celliax_cb2, p);
if (ferror(fp)) {
- ERRORA("Error while reading file %s\n", CELLIAX_P_LOG, argv[3]);
+ ERRORA("Error while reading file %s\n", SKYPIAX_P_LOG, argv[3]);
fclose(fp);
return RESULT_SUCCESS;
}
fclose(fp);
if (option_debug)
- NOTICA("%s: %d fields, %d rows\n", CELLIAX_P_LOG, argv[3], p->csv_fields,
+ NOTICA("%s: %d fields, %d rows\n", SKYPIAX_P_LOG, argv[3], p->csv_fields,
p->csv_rows);
csv_free(csvp);
@@ -5706,30 +6195,30 @@
/* which phonebook to use, use the SIM */
res = celliax_serial_write_AT_ack(p, "AT+CPBS=SM");
if (res) {
- WARNINGA("AT+CPBS=SM failed, continue\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CPBS=SM failed, continue\n", SKYPIAX_P_LOG);
}
/* which phonebook to use, trying to use combined phone+SIM */
res = celliax_serial_write_AT_ack(p, "AT+CPBS=MT");
if (res) {
- WARNINGA("AT+CPBS=MT failed, continue\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CPBS=MT failed, continue\n", SKYPIAX_P_LOG);
}
/* How many entries in phonebook */
p->phonebook_querying = 1;
res = celliax_serial_write_AT_ack(p, "AT+CPBR=?");
if (res) {
- WARNINGA("AT+CPBR=? failed, continue\n", CELLIAX_P_LOG);
+ WARNINGA("AT+CPBR=? failed, continue\n", SKYPIAX_P_LOG);
}
p->phonebook_querying = 0;
/* list entries in phonebook, give the SIM the time to answer */
WARNINGA
("About to querying the cellphone phonebook, if the SIM do not answer may stuck here for 20 seconds... Don't worry.\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
sprintf(list_command, "AT+CPBR=%d,%d", p->phonebook_first_entry,
p->phonebook_last_entry);
p->phonebook_listing = 1;
res = celliax_serial_write_AT_expect_longtime(p, list_command, "OK");
if (res) {
- WARNINGA("AT+CPBR=%d,%d failed, continue\n", CELLIAX_P_LOG,
+ WARNINGA("AT+CPBR=%d,%d failed, continue\n", SKYPIAX_P_LOG,
p->phonebook_first_entry, p->phonebook_last_entry);
}
p->phonebook_listing = 0;
@@ -5743,7 +6232,7 @@
} else {
ast_cli(fd, "\n\nfailed to open the directoriax.conf configuration file: %s\n", fn);
- ERRORA("failed to open the directoriax.conf configuration file: %s\n", CELLIAX_P_LOG,
+ ERRORA("failed to open the directoriax.conf configuration file: %s\n", SKYPIAX_P_LOG,
fn);
return RESULT_FAILURE;
}
@@ -5758,7 +6247,7 @@
#ifdef CELLIAX_FBUS2
-int celliax_serial_getstatus_FBUS2(struct celliax_pvt *p)
+int celliax_serial_getstatus_FBUS2(private_t * tech_pvt)
{
unsigned char MsgBuffer[7];
int res;
@@ -5776,12 +6265,12 @@
MsgBuffer[6] = celliax_serial_get_seqnum_FBUS2(p);
if (option_debug > 1)
- DEBUGA_FBUS2("asking model, outseqnum %.2X \n", CELLIAX_P_LOG, MsgBuffer[6]);
+ DEBUGA_FBUS2("asking model, outseqnum %.2X \n", SKYPIAX_P_LOG, MsgBuffer[6]);
celliax_serial_write_FBUS2(p, MsgBuffer, 7, FBUS2_TYPE_MODEL_ASK);
usleep(1000);
res = celliax_serial_read_FBUS2(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG);
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -5790,12 +6279,12 @@
res = celliax_serial_read_FBUS2(p);
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG);
UNLOCKA(&p->controldev_lock);
return -1;
}
if (how_many_reads > 10) {
- ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", CELLIAX_P_LOG,
+ ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG,
how_many_reads);
UNLOCKA(&p->controldev_lock);
return -1;
@@ -5807,7 +6296,7 @@
return 0;
}
-int celliax_serial_sync_FBUS2(struct celliax_pvt *p)
+int celliax_serial_sync_FBUS2(private_t * tech_pvt)
{
unsigned char initc = 0x55; /* FBUS2 initialization char */
int c, rt;
@@ -5818,7 +6307,7 @@
usleep(10000);
rt = write(p->controldevfd, &initc, 1);
if (rt != 1) {
- ERRORA("serial error: %s", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("serial error: %s", SKYPIAX_P_LOG, strerror(errno));
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -5829,7 +6318,7 @@
return 0;
}
-int celliax_serial_answer_FBUS2(struct celliax_pvt *p)
+int celliax_serial_answer_FBUS2(private_t * tech_pvt)
{
unsigned char MsgBuffer[6];
@@ -5842,16 +6331,16 @@
MsgBuffer[4] = FBUS2_IS_LAST_FRAME;
MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p);
if (option_debug > 1)
- DEBUGA_FBUS2("celliax_serial_answer_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("celliax_serial_answer_FBUS2, outseqnum %.2X \n", SKYPIAX_P_LOG,
MsgBuffer[5]);
celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY);
- DEBUGA_FBUS2("FBUS2: sent commands to answer the call\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("FBUS2: sent commands to answer the call\n", SKYPIAX_P_LOG);
p->interface_state = AST_STATE_UP; //FIXME
return 0;
}
-int celliax_serial_call_FBUS2(struct celliax_pvt *p, char *dstr)
+int celliax_serial_call_FBUS2(private_t * tech_pvt, char *dstr)
{
unsigned char MsgBufferNum[255];
int i;
@@ -5869,18 +6358,18 @@
MsgBufferNum[4 + strlen(dstr) + 1] = FBUS2_IS_LAST_FRAME;
MsgBufferNum[4 + strlen(dstr) + 2] = celliax_serial_get_seqnum_FBUS2(p);
if (option_debug > 1)
- DEBUGA_FBUS2("celliax_serial_call_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("celliax_serial_call_FBUS2, outseqnum %.2X \n", SKYPIAX_P_LOG,
MsgBufferNum[4 + strlen(dstr) + 2]);
celliax_serial_write_FBUS2(p, MsgBufferNum, 5 + strlen(dstr) + 2, FBUS2_TYPE_SECURITY);
p->phone_callflow = CALLFLOW_CALL_DIALING;
p->interface_state = AST_STATE_DIALING;
if (option_debug)
- DEBUGA_FBUS2("FBUS2: sent commands to call\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("FBUS2: sent commands to call\n", SKYPIAX_P_LOG);
return 0;
}
-int celliax_serial_hangup_FBUS2(struct celliax_pvt *p)
+int celliax_serial_hangup_FBUS2(private_t * tech_pvt)
{
unsigned char MsgBuffer[6];
@@ -5895,11 +6384,11 @@
MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p);
if (option_debug > 1)
- DEBUGA_FBUS2("celliax_serial_hangup_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("celliax_serial_hangup_FBUS2, outseqnum %.2X \n", SKYPIAX_P_LOG,
MsgBuffer[5]);
celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY);
- DEBUGA_FBUS2("FBUS2: sent commands to hangup the call\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("FBUS2: sent commands to hangup the call\n", SKYPIAX_P_LOG);
}
p->interface_state = AST_STATE_DOWN; //FIXME
@@ -5907,7 +6396,7 @@
return 0;
}
-int celliax_serial_config_FBUS2(struct celliax_pvt *p)
+int celliax_serial_config_FBUS2(private_t * tech_pvt)
{
unsigned char MsgBuffer[6];
int res;
@@ -5922,11 +6411,11 @@
if (option_debug > 1)
DEBUGA_FBUS2("activating security commands for getting IMEI, outseqnum %.2X \n",
- CELLIAX_P_LOG, MsgBuffer[5]);
+ SKYPIAX_P_LOG, MsgBuffer[5]);
celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY);
res = celliax_serial_read_FBUS2(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG);
return -1;
}
while (res != MsgBuffer[5] && res != FBUS2_SECURIY_EXTENDED_COMMAND_ON) {
@@ -5934,11 +6423,11 @@
res = celliax_serial_read_FBUS2(p);
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG);
return -1;
}
if (how_many_reads > 10) {
- ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", CELLIAX_P_LOG,
+ ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG,
how_many_reads);
return -1;
}
@@ -5951,12 +6440,12 @@
MsgBuffer[4] = FBUS2_IS_LAST_FRAME;
MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p);
if (option_debug > 1)
- DEBUGA_FBUS2("celliax_serial_get_IMEI_init_FBUS2, outseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("celliax_serial_get_IMEI_init_FBUS2, outseqnum %.2X \n", SKYPIAX_P_LOG,
MsgBuffer[5]);
celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY);
res = celliax_serial_read_FBUS2(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG);
return -1;
}
how_many_reads = 0;
@@ -5965,11 +6454,11 @@
res = celliax_serial_read_FBUS2(p);
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_FBUS2\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG);
return -1;
}
if (how_many_reads > 10) {
- ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", CELLIAX_P_LOG,
+ ERRORA("no expected results in %d celliax_serial_read_FBUS2\n", SKYPIAX_P_LOG,
how_many_reads);
//FIXME return -1;
return 0;
@@ -5977,15 +6466,15 @@
}
if (option_debug > 1)
- DEBUGA_FBUS2("xxxxx GOT IMEI xxxxx res=%d %.2X \n", CELLIAX_P_LOG, res, res);
+ DEBUGA_FBUS2("xxxxx GOT IMEI xxxxx res=%d %.2X \n", SKYPIAX_P_LOG, res, res);
return 0;
}
-int celliax_serial_get_seqnum_FBUS2(struct celliax_pvt *p)
+int celliax_serial_get_seqnum_FBUS2(private_t * tech_pvt)
{
if (p->seqnumfbus > FBUS2_SEQNUM_MAX || p->seqnumfbus < FBUS2_SEQNUM_MIN) {
- ERRORA("p->seqnumfbus: %2.X\n", CELLIAX_P_LOG, p->seqnumfbus);
+ ERRORA("p->seqnumfbus: %2.X\n", SKYPIAX_P_LOG, p->seqnumfbus);
p->seqnumfbus = FBUS2_SEQNUM_MIN;
}
@@ -5995,11 +6484,11 @@
p->seqnumfbus++;
}
if (option_debug > 10)
- DEBUGA_FBUS2("sqnum: %2.X\n", CELLIAX_P_LOG, p->seqnumfbus);
+ DEBUGA_FBUS2("sqnum: %2.X\n", SKYPIAX_P_LOG, p->seqnumfbus);
return p->seqnumfbus;
}
-int celliax_serial_security_command_FBUS2(struct celliax_pvt *p)
+int celliax_serial_security_command_FBUS2(private_t * tech_pvt)
{
unsigned char MsgBuffer[6];
@@ -6011,7 +6500,7 @@
MsgBuffer[5] = celliax_serial_get_seqnum_FBUS2(p);
if (option_debug > 1)
- DEBUGA_FBUS2("activating security commands, outseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("activating security commands, outseqnum %.2X \n", SKYPIAX_P_LOG,
MsgBuffer[5]);
celliax_serial_write_FBUS2(p, MsgBuffer, 6, FBUS2_TYPE_SECURITY);
return 0;
@@ -6028,7 +6517,7 @@
* \return the number of chars written on the serial,
* that can be different from len (or negative) in case of errors.
*/
-int celliax_serial_send_FBUS2(struct celliax_pvt *p, int len, unsigned char *mesg_ptr)
+int celliax_serial_send_FBUS2(private_t * tech_pvt, int len, unsigned char *mesg_ptr)
{
int ret;
size_t actual = 0;
@@ -6041,7 +6530,7 @@
continue;
if (ret < 0) {
if (actual != len)
- ERRORA("celliax_serial_write error: %s", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("celliax_serial_write error: %s", SKYPIAX_P_LOG, strerror(errno));
UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -6065,7 +6554,7 @@
if (debug_buf_pos > ((char *) &debug_buf + 1000))
break;
}
- DEBUGA_FBUS2("%s was sent down the wire\n", CELLIAX_P_LOG, debug_buf);
+ DEBUGA_FBUS2("%s was sent down the wire\n", SKYPIAX_P_LOG, debug_buf);
}
return 0;
@@ -6083,13 +6572,13 @@
*
* \return 0 on error, 1 otherwise
*/
-int celliax_serial_list_acknowledge_FBUS2(struct celliax_pvt *p, int seqnum)
+int celliax_serial_list_acknowledge_FBUS2(private_t * tech_pvt, int seqnum)
{
struct fbus2_msg *ptr;
ptr = p->fbus2_outgoing_list;
if (ptr == NULL) {
- ERRORA("fbus2_outgoing_list is NULL ?\n", CELLIAX_P_LOG);
+ ERRORA("fbus2_outgoing_list is NULL ?\n", SKYPIAX_P_LOG);
return -1;
}
PUSHA_UNLOCKA(&p->fbus2_outgoing_list_lock);
@@ -6100,9 +6589,9 @@
if (ptr->seqnum == seqnum) {
ptr->acknowledged = 1;
if (option_debug > 1)
- DEBUGA_FBUS2("Acknowledgment to %.2X\n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("Acknowledgment to %.2X\n", SKYPIAX_P_LOG, seqnum);
- DEBUGA_FBUS2("PREFREE OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("PREFREE OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list);
if (ptr->previous) {
if (ptr->next) {
@@ -6121,13 +6610,13 @@
if ((NULL == ptr->next) && (NULL == ptr->previous)) { /* bug catched by Wojciech Andralojc */
if (option_debug > 1)
- DEBUGA_FBUS2("FREEING LAST\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("FREEING LAST\n", SKYPIAX_P_LOG);
p->fbus2_outgoing_list = NULL;
p->fbus2_outgoing_list = celliax_serial_list_init_FBUS2(p);
}
free(ptr);
- DEBUGA_FBUS2("POSTFREE OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("POSTFREE OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list);
break;
@@ -6137,7 +6626,7 @@
} else {
ERRORA
("The phone sent us an acknowledgement referring to a msg with a seqnum that is not in our sent list: %.2X\n",
- CELLIAX_P_LOG, seqnum);
+ SKYPIAX_P_LOG, seqnum);
break;
}
}
@@ -6157,7 +6646,7 @@
*
* \return 0 on error, 1 otherwise
*/
-int celliax_serial_send_if_time_FBUS2(struct celliax_pvt *p)
+int celliax_serial_send_if_time_FBUS2(private_t * tech_pvt)
{
struct fbus2_msg *ptr;
struct timeval tv;
@@ -6166,11 +6655,11 @@
gettimeofday(&tv, &tz);
ptr = p->fbus2_outgoing_list;
if (ptr == NULL) {
- ERRORA("fbus2_outgoing_list is NULL ?\n", CELLIAX_P_LOG);
+ ERRORA("fbus2_outgoing_list is NULL ?\n", SKYPIAX_P_LOG);
return -1;
}
while (ptr->next != NULL) {
- WARNINGA("fbus2_outgoing_list->next is not null ?\n", CELLIAX_P_LOG);
+ WARNINGA("fbus2_outgoing_list->next is not null ?\n", SKYPIAX_P_LOG);
ptr = ptr->next; //FIXME what to do?
}
while (ptr->sent == 0 && ptr->acknowledged == 0) {
@@ -6201,13 +6690,13 @@
if ((tv.tv_sec * 1000 + tv.tv_usec / 1000) > ((ptr->tv_sec * 1000 + ptr->tv_usec / 1000) + 1000)) { //retest, maybe has been changed?
if (option_debug > 1)
- DEBUGA_FBUS2("RESEND %.2X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("RESEND %.2X, passed %ld ms, sent %d times\n", SKYPIAX_P_LOG,
ptr->seqnum,
((tv.tv_sec * 1000 + tv.tv_usec / 1000) -
(ptr->tv_sec * 1000 + ptr->tv_usec / 1000)),
ptr->how_many_sent);
if (ptr->how_many_sent > 9) {
- ERRORA("RESEND %.2X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG,
+ ERRORA("RESEND %.2X, passed %ld ms, sent %d times\n", SKYPIAX_P_LOG,
ptr->seqnum,
((tv.tv_sec * 1000 + tv.tv_usec / 1000) -
(ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), ptr->how_many_sent);
@@ -6219,7 +6708,7 @@
celliax_serial_send_FBUS2(p, ptr->len, ptr->buffer);
if (ptr->buffer[3] == FBUS2_ACK_BYTE) {
if (option_debug > 1)
- DEBUGA_FBUS2("RESEND ACK, passed %ld ms, sent %d times\n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("RESEND ACK, passed %ld ms, sent %d times\n", SKYPIAX_P_LOG,
((tv.tv_sec * 1000 + tv.tv_usec / 1000) -
(ptr->tv_sec * 1000 + ptr->tv_usec / 1000)),
ptr->how_many_sent);
@@ -6231,9 +6720,9 @@
ptr->sent = 1;
ptr->how_many_sent++;
if (option_debug > 1) {
- DEBUGA_FBUS2("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list);
- DEBUGA_FBUS2("OUTGOING list END\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("OUTGOING list END\n", SKYPIAX_P_LOG);
}
}
@@ -6251,11 +6740,11 @@
if (ptr->sent == 0 && ptr->acknowledged == 0 && ptr->msg > 0) { //retest, maybe has been changed?
if (option_debug > 1)
- DEBUGA_FBUS2("SENDING 1st TIME %.2X\n", CELLIAX_P_LOG, ptr->seqnum);
+ DEBUGA_FBUS2("SENDING 1st TIME %.2X\n", SKYPIAX_P_LOG, ptr->seqnum);
celliax_serial_send_FBUS2(p, ptr->len, ptr->buffer);
if (ptr->buffer[3] == FBUS2_ACK_BYTE) {
if (option_debug > 1)
- DEBUGA_FBUS2("SENDING 1st TIME ACK\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("SENDING 1st TIME ACK\n", SKYPIAX_P_LOG);
ptr->acknowledged = 1;
ptr->msg = FBUS2_OUTGOING_ACK;
}
@@ -6264,9 +6753,9 @@
ptr->sent = 1;
ptr->how_many_sent++;
if (option_debug > 1) {
- DEBUGA_FBUS2("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list);
- DEBUGA_FBUS2("OUTGOING list END\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("OUTGOING list END\n", SKYPIAX_P_LOG);
}
}
@@ -6278,7 +6767,7 @@
return 0;
}
-int celliax_serial_write_FBUS2(struct celliax_pvt *p, unsigned char *MsgBuffer,
+int celliax_serial_write_FBUS2(private_t * tech_pvt, unsigned char *MsgBuffer,
int MsgLength, unsigned char MsgType)
{
unsigned char buffer2[FBUS2_MAX_TRANSMIT_LENGTH + 10];
@@ -6325,9 +6814,9 @@
break;
}
if (buffer2[3] == FBUS2_ACK_BYTE) {
- DEBUGA_FBUS2("%s to be written, ACK\n", CELLIAX_P_LOG, debug_buf);
+ DEBUGA_FBUS2("%s to be written, ACK\n", SKYPIAX_P_LOG, debug_buf);
} else {
- DEBUGA_FBUS2("%s to be written\n", CELLIAX_P_LOG, debug_buf);
+ DEBUGA_FBUS2("%s to be written\n", SKYPIAX_P_LOG, debug_buf);
}
}
@@ -6343,12 +6832,12 @@
}
p->fbus2_outgoing_list->seqnum = MsgBuffer[MsgLength - 1];
if (option_debug > 1) {
- DEBUGA_FBUS2("OUTGOING LIST seqnum is %2.X\n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("OUTGOING LIST seqnum is %2.X\n", SKYPIAX_P_LOG,
MsgBuffer[MsgLength - 1]);
- DEBUGA_FBUS2("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_FBUS2(p, p->fbus2_outgoing_list);
- DEBUGA_FBUS2("OUTGOING list END\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("OUTGOING list END\n", SKYPIAX_P_LOG);
}
} else {
usleep(100);
@@ -6358,7 +6847,7 @@
return 0;
}
-int celliax_serial_send_ack_FBUS2(struct celliax_pvt *p, unsigned char MsgType,
+int celliax_serial_send_ack_FBUS2(private_t * tech_pvt, unsigned char MsgType,
unsigned char MsgSequence)
{
unsigned char buffer2[2];
@@ -6367,13 +6856,13 @@
buffer2[1] = (MsgSequence - FBUS2_SEQNUM_MIN);
if (option_debug > 1)
- DEBUGA_FBUS2("SENDING ACK to %2.X, seqack %2.X \n", CELLIAX_P_LOG, MsgSequence,
+ DEBUGA_FBUS2("SENDING ACK to %2.X, seqack %2.X \n", SKYPIAX_P_LOG, MsgSequence,
(MsgSequence - FBUS2_SEQNUM_MIN));
/* Sending to phone */
return celliax_serial_write_FBUS2(p, buffer2, 2, FBUS2_ACK_BYTE);
}
-struct fbus2_msg *celliax_serial_list_init_FBUS2(struct celliax_pvt *p)
+struct fbus2_msg *celliax_serial_list_init_FBUS2(private_t * tech_pvt)
{
struct fbus2_msg *list;
list = p->fbus2_outgoing_list;
@@ -6414,7 +6903,7 @@
return list;
}
-int celliax_serial_list_print_FBUS2(struct celliax_pvt *p, struct fbus2_msg *list)
+int celliax_serial_list_print_FBUS2(private_t * tech_pvt, struct fbus2_msg *list)
{
struct fbus2_msg *ptr;
ptr = list;
@@ -6422,14 +6911,14 @@
if (option_debug > 3)
DEBUGA_FBUS2
("PTR msg is: %d, seqnum is %.2X, tv_sec is %d, tv_usec is %d, acknowledged is: %d,"
- " sent is:%d, how_many_sent is: %d\n", CELLIAX_P_LOG, ptr->msg, ptr->seqnum,
+ " sent is:%d, how_many_sent is: %d\n", SKYPIAX_P_LOG, ptr->msg, ptr->seqnum,
ptr->tv_sec, ptr->tv_usec, ptr->acknowledged, ptr->sent, ptr->how_many_sent);
ptr = ptr->previous;
}
return 0;
}
-int celliax_serial_read_FBUS2(struct celliax_pvt *p)
+int celliax_serial_read_FBUS2(private_t * tech_pvt)
{
int read_count;
int select_err;
@@ -6456,7 +6945,7 @@
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",
- CELLIAX_P_LOG, p->controldevice_name);
+ SKYPIAX_P_LOG, p->controldevice_name);
p->controldev_dead = 1;
close(p->controldevfd);
UNLOCKA(&p->controldev_lock);
@@ -6478,7 +6967,7 @@
if (debug_buf_pos > (char *) (&debug_buf + 1000))
break;
}
- DEBUGA_FBUS2("%s READ AT seconds=%ld usec=%6ld read_count=%d\n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("%s READ AT seconds=%ld usec=%6ld read_count=%d\n", SKYPIAX_P_LOG,
debug_buf, p->fbus2_list_tv.tv_sec, p->fbus2_list_tv.tv_usec,
read_count);
}
@@ -6518,12 +7007,12 @@
case FBUS2_ACK_BYTE:
/* this is an ACKnowledgement frame sent to us in reply to an item we sent, take note we were ACKnowledged, no need to resend the item */
if (option_debug > 1)
- DEBUGA_FBUS2("INCOMING ACK, seqack %.2X \n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("INCOMING ACK, seqack %.2X \n", SKYPIAX_P_LOG, seqnum);
if (seqnum == 0x80) { /* reset */
seqnum = 0x00;
DEBUGA_FBUS2
("seqack was 0x80, interpreting as 0x00, first acknowledgement (session begin?) of our first sent item 0x40\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
/* an ACK frame has the same seqnum as the item it acknowledge, minus 0x40, so here we obtain the seqnum of the item that has been ACKnowledged */
fbus_mesg = seqnum + FBUS2_SEQNUM_MIN;
@@ -6535,7 +7024,7 @@
/****************************************************************/
case FBUS2_TYPE_CALL_DIVERT:
if (option_debug > 1)
- DEBUGA_FBUS2("CALL DIVERT SIGNALING seqnum %.2X \n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("CALL DIVERT SIGNALING seqnum %.2X \n", SKYPIAX_P_LOG, seqnum);
fbus_mesg = FBUS2_TYPE_CALL_DIVERT;
/* this signal us that we have some settings in line divert, let's use it as activation of the line when we call */
if (p->interface_state == AST_STATE_DIALING) {
@@ -6546,7 +7035,7 @@
if (option_debug)
DEBUGA_FBUS2
("call is active, I know it's not yet true, but 3310 do not give us remote answer signaling\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
/* this frame has been categorized, bail out from the loop */
known = 1;
@@ -6575,7 +7064,7 @@
break;
}
model[c] = '\0';
- DEBUGA_FBUS2("FBUS2 PHONE MODEL is: %s, inseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("FBUS2 PHONE MODEL is: %s, inseqnum %.2X \n", SKYPIAX_P_LOG,
model, seqnum);
}
known = 1;
@@ -6595,11 +7084,11 @@
/* set the channel state to UP, we've answered */
if (ast_setstate(p->owner, AST_STATE_UP)) {
- ERRORA("ast_setstate failed, BAD\n", CELLIAX_P_LOG);
+ ERRORA("ast_setstate failed, BAD\n", SKYPIAX_P_LOG);
}
if (option_debug > 1)
- DEBUGA_FBUS2("ANSWERED CALL, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("ANSWERED CALL, inseqnum %.2X \n", SKYPIAX_P_LOG, seqnum);
known = 1;
break;
/* this sub-subkind of frames tell us that we released the call */
@@ -6607,7 +7096,7 @@
p->interface_state = AST_STATE_DOWN;
p->phone_callflow = CALLFLOW_CALL_IDLE;
if (option_debug > 1)
- DEBUGA_FBUS2("RELEASED CALL, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("RELEASED CALL, inseqnum %.2X \n", SKYPIAX_P_LOG, seqnum);
fbus_mesg = CALLFLOW_CALL_RELEASED;
known = 1;
break;
@@ -6617,14 +7106,14 @@
case FBUS2_SECURIY_EXTENDED_COMMANDS:
if (option_debug > 1)
DEBUGA_FBUS2("SECURITY EXTENDED COMMANDS ON, inseqnum %.2X \n",
- CELLIAX_P_LOG, seqnum);
+ SKYPIAX_P_LOG, seqnum);
fbus_mesg = FBUS2_SECURIY_EXTENDED_COMMAND_ON;
known = 1;
break;
/* this subkind of frames is an answer to "get IMEI" action */
case FBUS2_SECURIY_IMEI_COMMANDS:
if (option_debug > 1)
- DEBUGA_FBUS2("CALLFLOW_GOT_IMEI, inseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("CALLFLOW_GOT_IMEI, inseqnum %.2X \n", SKYPIAX_P_LOG,
seqnum);
fbus_mesg = CALLFLOW_GOT_IMEI;
known = 1;
@@ -6638,7 +7127,7 @@
/* this subkind of frames is about an INCOMING SMS */
case FBUS2_SMS_INCOMING:
if (option_debug > 1)
- DEBUGA_FBUS2("SMS, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("SMS, inseqnum %.2X \n", SKYPIAX_P_LOG, seqnum);
known = 1;
break;
}
@@ -6653,7 +7142,7 @@
p->interface_state = AST_STATE_DOWN;
p->phone_callflow = CALLFLOW_CALL_IDLE;
if (option_debug > 1)
- DEBUGA_FBUS2("REMOTE PARTY HANG UP, inseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("REMOTE PARTY HANG UP, inseqnum %.2X \n", SKYPIAX_P_LOG,
seqnum);
fbus_mesg = CALLFLOW_INCOMING_HANGUP;
known = 1;
@@ -6661,7 +7150,7 @@
/* this subkind of frame is about the remote CALLID (not signaled by 3310) */
case FBUS2_CALL_CALLID:
if (option_debug > 1)
- DEBUGA_FBUS2("CALLID, inseqnum %.2X \n", CELLIAX_P_LOG, seqnum);
+ DEBUGA_FBUS2("CALLID, inseqnum %.2X \n", SKYPIAX_P_LOG, seqnum);
memset(p->callid_name, 0, sizeof(p->callid_name));
memset(p->callid_number, 0, sizeof(p->callid_number));
for (a = 0; a < p->array[12]; a++) {
@@ -6672,7 +7161,7 @@
}
if (option_debug > 1)
DEBUGA_FBUS2("CALLFLOW_INCOMING_CALLID: name is %s, number is %s\n",
- CELLIAX_P_LOG,
+ SKYPIAX_P_LOG,
p->callid_name[0] != 1 ? p->callid_name : "not available",
p->callid_number[0] ? p->callid_number : "not available");
fbus_mesg = CALLFLOW_INCOMING_CALLID;
@@ -6689,7 +7178,7 @@
/* this subkind of frames is NETWORK STATUS REGISTERED */
case FBUS2_NETWORK_STATUS_REGISTERED:
if (option_debug > 1)
- DEBUGA_FBUS2("NETWORK STATUS REGISTERED, inseqnum %.2X \n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("NETWORK STATUS REGISTERED, inseqnum %.2X \n", SKYPIAX_P_LOG,
seqnum);
if (p->callid_name[0] == 0 && p->owner
&& p->interface_state != AST_STATE_DOWN) {
@@ -6703,7 +7192,7 @@
" callid_name[0]=1 (also if no callid was transmitted by remote"
" party), we use this lack of CALLID as a sign of 3310nness."
" Outside a call, or when CALLID has been signaled, NETWORK STATUS"
- " REGISTERED is ignored.\n", CELLIAX_P_LOG);
+ " REGISTERED is ignored.\n", SKYPIAX_P_LOG);
fbus_mesg = CALLFLOW_INCOMING_HANGUP;
}
known = 1;
@@ -6720,7 +7209,7 @@
p->phone_callflow = CALLFLOW_CALL_IDLE;
if (option_debug > 1)
DEBUGA_FBUS2("STATUS call in progress OFF, inseqnum %.2X \n",
- CELLIAX_P_LOG, seqnum);
+ SKYPIAX_P_LOG, seqnum);
fbus_mesg = CALLFLOW_INCOMING_HANGUP;
known = 1;
break;
@@ -6728,7 +7217,7 @@
case FBUS2_CALL_STATUS_ON:
if (option_debug > 1)
DEBUGA_FBUS2("STATUS call in progress ON, inseqnum %.2X \n",
- CELLIAX_P_LOG, seqnum);
+ SKYPIAX_P_LOG, seqnum);
known = 1;
break;
}
@@ -6738,7 +7227,7 @@
/* categorization of frame is ended, if it has not been recognized, whine */
if (!known) {
- WARNINGA("FBUS2 MSG UNKNOWN, inseqnum %.2X\n", CELLIAX_P_LOG, seqnum);
+ WARNINGA("FBUS2 MSG UNKNOWN, inseqnum %.2X\n", SKYPIAX_P_LOG, seqnum);
}
/* let's print our frame */
@@ -6754,7 +7243,7 @@
if (debug_buf_pos > (char *) (&debug_buf + 1000))
break;
}
- DEBUGA_FBUS2("%s is the RECEIVED FRAME inseqnum %.2X\n", CELLIAX_P_LOG,
+ DEBUGA_FBUS2("%s is the RECEIVED FRAME inseqnum %.2X\n", SKYPIAX_P_LOG,
debug_buf, seqnum);
}
@@ -6774,7 +7263,7 @@
if (errno != EINTR) {
ERRORA
("select returned -1 on %s, marking controldev as dead, errno was: %d, error was: %s\n",
- CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
+ SKYPIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
p->controldev_dead = 1;
close(p->controldevfd);
if (p->owner)
@@ -6782,20 +7271,20 @@
return -1;
} else {
WARNINGA("select returned -1 on %s, errno was: %d, EINTR, error was: %s\n",
- CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
+ SKYPIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
return 0;
}
}
/* OK, reading done, let's browse the list of pending frames to be sent, and act on it */
if (celliax_serial_send_if_time_FBUS2(p)) {
- ERRORA("celliax_serial_send_if_time_FBUS2 failed!\n", CELLIAX_P_LOG);
+ ERRORA("celliax_serial_send_if_time_FBUS2 failed!\n", SKYPIAX_P_LOG);
return -1;
}
if (fbus_mesg == CALLFLOW_INCOMING_HANGUP) {
if (p->owner) {
celliax_queue_control(p->owner, AST_CONTROL_HANGUP);
- DEBUGA_FBUS2("phone call ended\n", CELLIAX_P_LOG);
+ DEBUGA_FBUS2("phone call ended\n", SKYPIAX_P_LOG);
}
}
@@ -6806,29 +7295,29 @@
#ifdef CELLIAX_CVM
-int celliax_serial_sync_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_sync_CVM_BUSMAIL(private_t * tech_pvt)
{
usleep(1000); /* 1msec */
time(&p->celliax_serial_synced_timestamp);
return 0;
}
-int celliax_serial_answer_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_answer_CVM_BUSMAIL(private_t * tech_pvt)
{
if (AST_STATE_RING == p->interface_state) {
- DEBUGA_CVM("Sending commands to answer an incomming call...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Sending commands to answer an incomming call...\n", SKYPIAX_P_LOG);
celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_CONNECT_REQ, 0, NULL);
} else {
DEBUGA_CVM
("SKIPPING Sending commands to answer an incomming call, because: !AST_STATE_RING\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
return 0;
}
-int celliax_serial_call_CVM_BUSMAIL(struct celliax_pvt *p, char *dstr)
+int celliax_serial_call_CVM_BUSMAIL(private_t * tech_pvt, char *dstr)
{
unsigned char bCallType = 0x01; /* INTERNAL */
@@ -6855,11 +7344,11 @@
}
if (option_debug)
- NOTICA("CVM_BUSMAIL: sent commands to call\n", CELLIAX_P_LOG);
+ NOTICA("CVM_BUSMAIL: sent commands to call\n", SKYPIAX_P_LOG);
return 0;
}
-int celliax_serial_hangup_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_hangup_CVM_BUSMAIL(private_t * tech_pvt)
{
unsigned char bReason = 0x0; /* Normal hang-up */
@@ -6867,17 +7356,17 @@
celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_RELEASE_REQ, sizeof(bReason),
&bReason);
- DEBUGA_CVM("CVM_BUSMAIL: sent commands to hangup the call\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("CVM_BUSMAIL: sent commands to hangup the call\n", SKYPIAX_P_LOG);
} else {
DEBUGA_CVM("CVM_BUSMAIL: sent commands to hangup skipped because: AST_STATE_DOWN\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
}
return 0;
}
-int celliax_serial_config_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_config_CVM_BUSMAIL(private_t * tech_pvt)
{
int res;
int how_many_reads = 0;
@@ -6891,7 +7380,7 @@
CVM_LOKKA(&p->controldev_lock);
if (option_debug > 1)
- DEBUGA_CVM("Try to init communication with CVM...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Try to init communication with CVM...\n", SKYPIAX_P_LOG);
/* CVM after reset sends SABM CTRL frame, let's assume that CVM already sent it, that's the reply... */
celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p,
@@ -6910,12 +7399,12 @@
res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread
- DEBUGA_CVM("celliax_serial_read_CVM_BUSMAIL res= %X, expected %X\n", CELLIAX_P_LOG, res,
+ DEBUGA_CVM("celliax_serial_read_CVM_BUSMAIL res= %X, expected %X\n", SKYPIAX_P_LOG, res,
(BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_UN_FRAME |
BUSMAIL_HEADER_SABM));
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -6931,25 +7420,25 @@
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
if (how_many_reads > 10) {
- ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG,
+ ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG,
how_many_reads);
- ERRORA("Unable to initialize cmmunication with CVM...\n", CELLIAX_P_LOG);
+ ERRORA("Unable to initialize cmmunication with CVM...\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
}
- DEBUGA_CVM("Communication with CVM initialized successfully...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Communication with CVM initialized successfully...\n", SKYPIAX_P_LOG);
- DEBUGA_CVM("Attempt to lock to FP...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Attempt to lock to FP...\n", SKYPIAX_P_LOG);
/* Try to connect to FP, try to lock to FP, maybe we registered with it in the past... */
/* CVM can hold up to 2 subscriptions in its EEPROM, celliax.conf contains number we should try */
@@ -6963,7 +7452,7 @@
res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -6975,7 +7464,7 @@
/*
if (0 == (how_many_reads % 10))
{
- DEBUGA_CVM("Attempt to lock to FP... %d\n", CELLIAX_P_LOG, how_many_reads/10 );
+ DEBUGA_CVM("Attempt to lock to FP... %d\n", SKYPIAX_P_LOG, how_many_reads/10 );
celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_LOCK_REQ, sizeof(SubcriptionNo) ,&SubcriptionNo);
}
*/
@@ -6986,24 +7475,24 @@
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
if (how_many_reads > 50) {
- ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG,
+ ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG,
how_many_reads);
- ERRORA("Unable to lock to FP...\n", CELLIAX_P_LOG);
+ ERRORA("Unable to lock to FP...\n", SKYPIAX_P_LOG);
break;
}
}
if (CVM_LOCKED_TO_FP == p->cvm_lock_state) {
- DEBUGA_CVM("CVM locked to FP successfully...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("CVM locked to FP successfully...\n", SKYPIAX_P_LOG);
} else {
- DEBUGA_CVM("Lock to FP failed, Attempt to register to FP...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Lock to FP failed, Attempt to register to FP...\n", SKYPIAX_P_LOG);
RegistartionData[0] = SubcriptionNo;
RegistartionData[1] = 0xFF;
@@ -7034,7 +7523,7 @@
res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -7044,7 +7533,7 @@
while (CVM_UNKNOWN_REGISTER_STATE == p->cvm_register_state) {
if (0 == (how_many_reads % 50)) {
- DEBUGA_CVM("Attempt to register to FP... %d\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("Attempt to register to FP... %d\n", SKYPIAX_P_LOG,
how_many_reads / 10);
celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ACCESS_RIGHTS_REQ,
sizeof(RegistartionData),
@@ -7057,16 +7546,16 @@
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
if (how_many_reads > 300) {
ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n",
- CELLIAX_P_LOG, how_many_reads);
+ SKYPIAX_P_LOG, how_many_reads);
- ERRORA("Unable to communication with CVM...\n", CELLIAX_P_LOG);
+ ERRORA("Unable to communication with CVM...\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
@@ -7074,14 +7563,14 @@
}
if (CVM_REGISTERED_TO_FP != p->cvm_register_state) {
- ERRORA("Unable to register to FP...\n", CELLIAX_P_LOG);
+ ERRORA("Unable to register to FP...\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
} else {
- DEBUGA_CVM("CVM registered to FP successfully...\n", CELLIAX_P_LOG);
- DEBUGA_CVM("Attempt to lock to FP...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("CVM registered to FP successfully...\n", SKYPIAX_P_LOG);
+ DEBUGA_CVM("Attempt to lock to FP...\n", SKYPIAX_P_LOG);
/* Try to connect to FP, try to lock to FP, maybe we registered with it in the past... */
/* CVM can hold up to 2 subscriptions in its EEPROM, celliax.conf contains number we should try */
@@ -7095,7 +7584,7 @@
res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -7105,7 +7594,7 @@
while (CVM_UNKNOWN_LOCK_STATE == p->cvm_lock_state) {
if (0 == (how_many_reads % 10)) {
- DEBUGA_CVM("Attempt to lock to FP... %d\n", CELLIAX_P_LOG, how_many_reads / 10);
+ DEBUGA_CVM("Attempt to lock to FP... %d\n", SKYPIAX_P_LOG, how_many_reads / 10);
celliax_serial_send_info_frame_CVM_BUSMAIL(p, API_PP_ACCESS_RIGHTS_REQ,
sizeof(RegistartionData),
RegistartionData);
@@ -7116,16 +7605,16 @@
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
if (how_many_reads > 100) {
ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n",
- CELLIAX_P_LOG, how_many_reads);
+ SKYPIAX_P_LOG, how_many_reads);
- ERRORA("Unable to communication with CVM...\n", CELLIAX_P_LOG);
+ ERRORA("Unable to communication with CVM...\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
@@ -7133,12 +7622,12 @@
}
if (CVM_LOCKED_TO_FP != p->cvm_lock_state) {
- ERRORA("Unable to lock to FP...\n", CELLIAX_P_LOG);
+ ERRORA("Unable to lock to FP...\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
} else {
- DEBUGA_CVM("CVM locked to FP successfully...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("CVM locked to FP successfully...\n", SKYPIAX_P_LOG);
}
}
}
@@ -7151,7 +7640,7 @@
}
-int celliax_serial_read_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_read_CVM_BUSMAIL(private_t * tech_pvt)
{
int read_count;
int select_err;
@@ -7190,7 +7679,7 @@
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 CVM is stuck, switched off or power down.\n",
- CELLIAX_P_LOG, p->controldevice_name);
+ SKYPIAX_P_LOG, p->controldevice_name);
p->controldev_dead = 1;
close(p->controldevfd);
@@ -7213,7 +7702,7 @@
break;
}
- DEBUGA_CVM("%s READ AT seconds=%ld usec=%6ld read_count=%d\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("%s READ AT seconds=%ld usec=%6ld read_count=%d\n", SKYPIAX_P_LOG,
debug_buf, p->cvm_busmail_list_tv.tv_sec,
p->cvm_busmail_list_tv.tv_usec, read_count);
}
@@ -7255,7 +7744,7 @@
}
DEBUGA_CVM("%s was received, Starting to categorize this frame\n",
- CELLIAX_P_LOG, debug_buf);
+ SKYPIAX_P_LOG, debug_buf);
}
int known = 0;
@@ -7272,11 +7761,11 @@
if (busmail_crc != MsgCrc) {
WARNINGA("BUSMAIL MSG CRC FAILED!, MsgCrc %.2X, calcd %.2X, dropping frame\n",
- CELLIAX_P_LOG, MsgCrc, busmail_crc);
+ SKYPIAX_P_LOG, MsgCrc, busmail_crc);
} else {
/* first step in categorizing frames, look at the general kind of frame, in p->array[BUSMAIL_OFFSET_HEADER] */
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL MSG CRC, MsgCrc %.2X, calcd %.2X...\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("BUSMAIL MSG CRC, MsgCrc %.2X, calcd %.2X...\n", SKYPIAX_P_LOG,
MsgCrc, busmail_crc);
MsgHeader = p->array[BUSMAIL_OFFSET_HEADER];
@@ -7290,14 +7779,14 @@
if (option_debug > 1)
DEBUGA_CVM("BUSMAIL_HEADER_INFO_FRAME TxSeq %X, RxSeq %X\n",
- CELLIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo);
+ SKYPIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo);
if (((p->busmail_rxseq_cvm_last + 1) & 0x7) != MsgTxSeqNo) {
/* some CVM frames are missing, TxSeq of this frame is higher then expected */
/* reject, I expected p->busmail_rxseq_cvm_last + 1, resend it to me, please */
WARNINGA("CVM TxSeq %X, does not match expected value %X\n",
- CELLIAX_P_LOG, MsgTxSeqNo,
+ SKYPIAX_P_LOG, MsgTxSeqNo,
(p->busmail_rxseq_cvm_last + 1) & 0x7);
// celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p, BUSMAIL_HEADER_CTRL_FRAME | BUSMAIL_HEADER_CTRL_SU_FRAME | BUSMAIL_HEADER_SUID_REJ);
@@ -7306,7 +7795,7 @@
WARNINGA
("It looks like our ACK to this frame was MIA :), lets ACK the frame one more time...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
/* if the frame we received informs us that other side is waiting for ACK, let's ACK it */
/* even if it is unknown to us */
@@ -7365,14 +7854,14 @@
if (option_debug > 1)
DEBUGA_CVM
("BUSMAIL_HEADER_INFO_FRAME ProgId %X, TaskId %X, Primitive %X %X\n",
- CELLIAX_P_LOG, MsgProgId, MsgTaskId, MsgPrimitiveMSB, MsgPrimitiveLSB);
+ SKYPIAX_P_LOG, MsgProgId, MsgTaskId, MsgPrimitiveMSB, MsgPrimitiveLSB);
switch (MsgPrimitive) {
case API_PP_ACCESS_RIGHTS_REJ:
/* FP rejected our registration... */
WARNINGA("API_PP_ACCESS_RIGHTS_REJ, FP rejected our registration...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
p->cvm_register_state = CVM_UNREGISTERED_TO_FP;
p->cvm_lock_state = CVM_UNKNOWN_LOCK_STATE;
@@ -7384,7 +7873,7 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_ACCESS_RIGHTS_CFM, FP accepted our registration...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
p->cvm_register_state = CVM_REGISTERED_TO_FP;
p->cvm_lock_state = CVM_UNKNOWN_LOCK_STATE;
@@ -7394,7 +7883,7 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_ACCESS_RIGHTS_CFM, FP accepted our registration, Our handset no. is %d, CVM? %X\n",
- CELLIAX_P_LOG, p->cvm_handset_no, p->cvm_fp_is_cvm);
+ SKYPIAX_P_LOG, p->cvm_handset_no, p->cvm_fp_is_cvm);
known = 1;
break;
@@ -7403,7 +7892,7 @@
/* CVM is connected to FP */
if (option_debug > 1)
DEBUGA_CVM("API_PP_LOCKED_IND, Connection to FP completed...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
p->cvm_register_state = CVM_REGISTERED_TO_FP;
p->cvm_lock_state = CVM_LOCKED_TO_FP;
@@ -7414,7 +7903,7 @@
/* CVM is unlocked with FP, Out of service */
WARNINGA
("API_PP_UNLOCKED_IND, CVM is unlocked with FP, Out of service !!!\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
p->cvm_lock_state = CVM_UNLOCKED_TO_FP;
known = 1;
@@ -7425,7 +7914,7 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_SETUP_ACK_IND, connection to FP established, FP is waiting for a numer to dial...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_DOWN == p->interface_state) {
p->interface_state = AST_STATE_DIALING;
@@ -7438,7 +7927,7 @@
/* Outgoing call, Remote end is ringing */
if (option_debug > 1)
DEBUGA_CVM("API_PP_ALERT_IND, remote end is ringing...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_DIALING == p->interface_state) {
p->interface_state = AST_STATE_RINGING;
@@ -7451,7 +7940,7 @@
/* Outgoing call, the remote end answered our call */
if (option_debug > 1)
DEBUGA_CVM("API_PP_CONNECT_IND, our call was answered...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_RINGING == p->interface_state) {
@@ -7486,13 +7975,13 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_REJECT_IND, FP or ther PP rejected our connection...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_RING == p->interface_state && p->owner) {
/* Attempt to answer incoming call rejected by FP or PP */
if (option_debug > 1)
DEBUGA_CVM("Was it PAGE_ALL CALL, that we should not answered?\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
p->interface_state = AST_STATE_DOWN;
celliax_queue_control(p->owner, AST_CONTROL_HANGUP);
@@ -7511,7 +8000,7 @@
/* Ringback, ignore it... */
if (option_debug > 1)
DEBUGA_CVM("API_PP_SIGNAL_ON_IND, Ringback, ignore it...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
known = 1;
break;
@@ -7520,7 +8009,7 @@
/* Ringback, ignore it... */
if (option_debug > 1)
DEBUGA_CVM("API_PP_SIGNAL_OFF_IND, Ringback, ignore it...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
known = 1;
break;
@@ -7530,14 +8019,14 @@
if (option_debug > 1)
DEBUGA_CVM("API_PP_SETUP_IND, somebody is calling us...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_DOWN == p->interface_state) {
if (API_PP_SETUP_IND_CALL_INT ==
p->array[BUSMAIL_OFFSET_MAIL_PARAMS +
API_PP_SETUP_IND_CALL_TYPE_OFFSET]) {
- DEBUGA_CVM("INTERNAL CALL, receive it...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("INTERNAL CALL, receive it...\n", SKYPIAX_P_LOG);
p->interface_state = AST_STATE_RING;
@@ -7552,7 +8041,7 @@
} else {
DEBUGA_CVM("NOT an INTERNAL CALL, CALL TYPE %X, just ignore it...\n",
- CELLIAX_P_LOG,
+ SKYPIAX_P_LOG,
p->array[BUSMAIL_OFFSET_MAIL_PARAMS +
API_PP_SETUP_IND_CALL_TYPE_OFFSET]);
@@ -7565,7 +8054,7 @@
} else {
WARNINGA
("Ignore incoming call, Wrong interface state, current state %X\n",
- CELLIAX_P_LOG, p->interface_state);
+ SKYPIAX_P_LOG, p->interface_state);
}
known = 1;
@@ -7576,7 +8065,7 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_ALERT_OFF_IND, Ringback, stop alerting about incoming call...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
known = 1;
break;
@@ -7586,10 +8075,10 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_ALERT_ON_IND, Ringback, start alerting about incoming call...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
/*
if (AST_STATE_DOWN == p->interface_state) {
- DEBUGA_CVM("Somebody is calling us, we see a PP_ALERT_ON_IND, receive it...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Somebody is calling us, we see a PP_ALERT_ON_IND, receive it...\n", SKYPIAX_P_LOG);
p->interface_state = AST_STATE_RING;
}
*/
@@ -7601,7 +8090,7 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_CONNECT_CFM, Confirmation for request to answer incoming call...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_RING == p->interface_state && p->owner) {
@@ -7632,7 +8121,7 @@
} else {
WARNINGA
("Ignore connection cfm, Wrong interface state, current state %X\n",
- CELLIAX_P_LOG, p->interface_state);
+ SKYPIAX_P_LOG, p->interface_state);
}
known = 1;
@@ -7643,7 +8132,7 @@
if (option_debug > 1)
DEBUGA_CVM
("API_PP_RELEASE_CFM, Confirmation for request to hangup a call..\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_UP == p->interface_state) {
/* let's close audio */
@@ -7664,7 +8153,7 @@
/* FP releases connection to CVM... */
if (option_debug > 1)
DEBUGA_CVM("API_PP_RELEASE_IND, FP releases connection to CVM...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
if (AST_STATE_UP == p->interface_state && p->owner) {
/* let's close audio */
@@ -7676,7 +8165,7 @@
} else if (AST_STATE_RING == p->interface_state && p->owner) {
/* workaround for PAGE ALL CALL, FIXME!!!! */
if (option_debug > 1)
- DEBUGA_CVM("WAS IT A PAGE ALL ???...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("WAS IT A PAGE ALL ???...\n", SKYPIAX_P_LOG);
p->interface_state = AST_STATE_UP;
usleep(100000);
@@ -7694,18 +8183,18 @@
case API_PP_READ_RSSI_CFM:
if (option_debug > 1)
- DEBUGA_CVM("API_PP_READ_RSSI_CFM, RSSI readout...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("API_PP_READ_RSSI_CFM, RSSI readout...\n", SKYPIAX_P_LOG);
p->cvm_rssi = p->array[BUSMAIL_OFFSET_MAIL_PARAMS + 0];
int rssi_percent = p->cvm_rssi * 100 / 0x3F;
if (option_debug > 1)
- DEBUGA_CVM("RSSI is %X, %d%%...\n", CELLIAX_P_LOG, p->cvm_rssi,
+ DEBUGA_CVM("RSSI is %X, %d%%...\n", SKYPIAX_P_LOG, p->cvm_rssi,
rssi_percent);
known = 1;
break;
default:
- WARNINGA("UNKNOWN MsgPrimitive!!! %X\n", CELLIAX_P_LOG, MsgPrimitive);
+ WARNINGA("UNKNOWN MsgPrimitive!!! %X\n", SKYPIAX_P_LOG, MsgPrimitive);
break;
}
@@ -7713,12 +8202,12 @@
case BUSMAIL_HEADER_CTRL_FRAME:
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_CTRL_FRAME\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("BUSMAIL_HEADER_CTRL_FRAME\n", SKYPIAX_P_LOG);
switch (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SU_BIT_MASK) {
case BUSMAIL_HEADER_CTRL_SU_FRAME:
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_CTRL_SU_FRAME\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("BUSMAIL_HEADER_CTRL_SU_FRAME\n", SKYPIAX_P_LOG);
switch (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_SUID_MASK) {
case BUSMAIL_HEADER_SUID_REJ:
@@ -7727,7 +8216,7 @@
((p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK));
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_SUID_REJ, RxSeq %X\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("BUSMAIL_HEADER_SUID_REJ, RxSeq %X\n", SKYPIAX_P_LOG,
MsgRxSeqNo);
/* Even that it is CVM Reject packet, it still ACKs some packets */
@@ -7741,7 +8230,7 @@
((p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK));
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_SUID_RNR, RxSeq %X\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("BUSMAIL_HEADER_SUID_RNR, RxSeq %X\n", SKYPIAX_P_LOG,
MsgRxSeqNo);
known = 1;
@@ -7752,7 +8241,7 @@
((p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK));
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_SUID_RR, RxSeq %X\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("BUSMAIL_HEADER_SUID_RR, RxSeq %X\n", SKYPIAX_P_LOG,
MsgRxSeqNo);
/* CVM ACKed our frames with RR frame */
@@ -7762,20 +8251,20 @@
break;
default:
- WARNINGA("BUSMAIL_HEADER_SUID_UNKNOWN!!!\n", CELLIAX_P_LOG);
+ WARNINGA("BUSMAIL_HEADER_SUID_UNKNOWN!!!\n", SKYPIAX_P_LOG);
break;
}
break;
case BUSMAIL_HEADER_CTRL_UN_FRAME:
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_CTRL_UN_FRAME\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("BUSMAIL_HEADER_CTRL_UN_FRAME\n", SKYPIAX_P_LOG);
switch (p->array[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_UNID_MASK) {
case BUSMAIL_HEADER_UNID_SABM:
if (option_debug > 1)
- DEBUGA_CVM("BUSMAIL_HEADER_UNID_SABM\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("BUSMAIL_HEADER_UNID_SABM\n", SKYPIAX_P_LOG);
/* reset seq counters */
p->busmail_txseq_celliax_last = 0xFF;
p->busmail_rxseq_cvm_last = 0xFF;
@@ -7786,19 +8275,19 @@
break;
default:
- WARNINGA("BUSMAIL_HEADER_UNID_UNKNOWN!!!\n", CELLIAX_P_LOG);
+ WARNINGA("BUSMAIL_HEADER_UNID_UNKNOWN!!!\n", SKYPIAX_P_LOG);
break;
}
break;
default:
- WARNINGA("BUSMAIL_HEADER_CTRL_UNKNOWN!!!\n", CELLIAX_P_LOG);
+ WARNINGA("BUSMAIL_HEADER_CTRL_UNKNOWN!!!\n", SKYPIAX_P_LOG);
break;
}
break;
default:
- WARNINGA("BUSMAIL_HEADER_UNKNOWN!!!\n", CELLIAX_P_LOG);
+ WARNINGA("BUSMAIL_HEADER_UNKNOWN!!!\n", SKYPIAX_P_LOG);
break;
}
@@ -7806,7 +8295,7 @@
/* categorization of frame is ended, if it has not been recognized, whine */
if (!known) {
- WARNINGA("BUSMAIL MSG UNKNOWN or REJECTED!\n", CELLIAX_P_LOG);
+ WARNINGA("BUSMAIL MSG UNKNOWN or REJECTED!\n", SKYPIAX_P_LOG);
}
}
p->arraycounter++;
@@ -7821,7 +8310,7 @@
if (errno != EINTR) {
ERRORA
("select returned -1 on %s, marking controldev as dead, errno was: %d, error was: %s\n",
- CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
+ SKYPIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
p->controldev_dead = 1;
close(p->controldevfd);
@@ -7832,20 +8321,20 @@
} else {
WARNINGA("select returned -1 on %s, errno was: %d, EINTR, error was: %s\n",
- CELLIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
+ SKYPIAX_P_LOG, p->controldevice_name, errno, strerror(errno));
return 0;
}
}
/* OK, reading done, let's browse the list of pending frames to be sent, and act on it */
if (celliax_serial_send_if_time_CVM_BUSMAIL(p)) {
- ERRORA("celliax_serial_send_if_time_CVM_BUSMAIL failed!\n", CELLIAX_P_LOG);
+ ERRORA("celliax_serial_send_if_time_CVM_BUSMAIL failed!\n", SKYPIAX_P_LOG);
return -1;
}
return cvm_busmail_mesg; //FIXME breaks the convention of returning 0 on success
}
-int celliax_serial_getstatus_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_getstatus_CVM_BUSMAIL(private_t * tech_pvt)
{
int res;
int how_many_reads = 0;
@@ -7854,7 +8343,7 @@
CVM_LOKKA(&p->controldev_lock);
if (option_debug > 1)
- DEBUGA_CVM("Sending RR CTRL frame wit PF bit set\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("Sending RR CTRL frame wit PF bit set\n", SKYPIAX_P_LOG);
/* this ctrl frame can be used as low level keep alive */
celliax_serial_send_ctrl_frame_CVM_BUSMAIL(p,
@@ -7868,7 +8357,7 @@
res = celliax_serial_read_CVM_BUSMAIL(p); //we don't have no monitor neither do_controldev_thread
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -7882,13 +8371,13 @@
how_many_reads++;
if (res == -1) {
- ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG);
+ ERRORA("failed celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
if (how_many_reads > 10) {
- ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", CELLIAX_P_LOG,
+ ERRORA("no expected results in %d celliax_serial_read_CVM_BUSMAIL\n", SKYPIAX_P_LOG,
how_many_reads);
CVM_UNLOCKA(&p->controldev_lock);
return -1;
@@ -7915,7 +8404,7 @@
* \return the number of chars written on the serial,
* that can be different from len (or negative) in case of errors.
*/
-int celliax_serial_send_CVM_BUSMAIL(struct celliax_pvt *p, int len,
+int celliax_serial_send_CVM_BUSMAIL(private_t * tech_pvt, int len,
unsigned char *mesg_ptr)
{
int ret;
@@ -7929,7 +8418,7 @@
continue;
if (ret < 0) {
if (actual != len)
- ERRORA("celliax_serial_write error: %s", CELLIAX_P_LOG, strerror(errno));
+ ERRORA("celliax_serial_write error: %s", SKYPIAX_P_LOG, strerror(errno));
CVM_UNLOCKA(&p->controldev_lock);
return -1;
}
@@ -7959,7 +8448,7 @@
if (debug_buf_pos > ((char *) &debug_buf + 1000))
break;
}
- DEBUGA_CVM("%s was sent down the wire\n", CELLIAX_P_LOG, debug_buf);
+ DEBUGA_CVM("%s was sent down the wire\n", SKYPIAX_P_LOG, debug_buf);
}
return 0;
@@ -7977,7 +8466,7 @@
*
* \return 0 on error, 1 otherwise
*/
-int celliax_serial_list_acknowledge_CVM_BUSMAIL(struct celliax_pvt *p,
+int celliax_serial_list_acknowledge_CVM_BUSMAIL(private_t * tech_pvt,
unsigned char AckTxSeqNo)
{
struct cvm_busmail_msg *ptr = NULL;
@@ -7989,14 +8478,14 @@
ptr = p->cvm_busmail_outgoing_list;
if (ptr == NULL) {
- ERRORA("cvm_busmail_outgoing_list is NULL ?\n", CELLIAX_P_LOG);
+ ERRORA("cvm_busmail_outgoing_list is NULL ?\n", SKYPIAX_P_LOG);
return -1;
}
PUSHA_UNLOCKA(&p->cvm_busmail_outgoing_list_lock);
CVM_LOKKA(&p->cvm_busmail_outgoing_list_lock);
/*
- DEBUGA_CVM("PREFREE OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("PREFREE OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
*/
while (ptr->next != NULL)
@@ -8013,7 +8502,7 @@
/*
if (option_debug > 1)
- DEBUGA_CVM("OUTGOING LIST TxSeq is %X, RxSeq is %X\n", CELLIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo);
+ DEBUGA_CVM("OUTGOING LIST TxSeq is %X, RxSeq is %X\n", SKYPIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo);
*/
unsigned char TxToAck = 0;
@@ -8026,7 +8515,7 @@
if (MsgTxSeqNo <= TxToAck) {
if (option_debug > 1)
- DEBUGA_CVM("Msg with TxSeq=%X ACKed with CvmRxSeq=%X\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("Msg with TxSeq=%X ACKed with CvmRxSeq=%X\n", SKYPIAX_P_LOG,
MsgTxSeqNo, AckTxSeqNo);
old = ptr;
@@ -8052,7 +8541,7 @@
if ((NULL == old->next) && (NULL == old->previous)) {
if (option_debug > 1) {
- DEBUGA_CVM("FREEING LAST\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("FREEING LAST\n", SKYPIAX_P_LOG);
}
p->cvm_busmail_outgoing_list = NULL;
@@ -8061,7 +8550,7 @@
/*
if (option_debug > 1)
- DEBUGA_CVM("FREEING TxSeq is %X, RxSeq is %X\n", CELLIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo);
+ DEBUGA_CVM("FREEING TxSeq is %X, RxSeq is %X\n", SKYPIAX_P_LOG, MsgTxSeqNo, MsgRxSeqNo);
*/
free(old);
@@ -8076,7 +8565,7 @@
}
/*
- DEBUGA_CVM("POSTFREE OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("POSTFREE OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
*/
@@ -8096,7 +8585,7 @@
*
* \return 0 on error, 1 otherwise
*/
-int celliax_serial_send_if_time_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_send_if_time_CVM_BUSMAIL(private_t * tech_pvt)
{
struct cvm_busmail_msg *ptr;
struct timeval tv;
@@ -8106,8 +8595,8 @@
ptr = p->cvm_busmail_outgoing_list;
if (ptr == NULL) {
-/* ERRORA("cvm_busmail_outgoing_list is NULL ?\n", CELLIAX_P_LOG); */
- WARNINGA("cvm_busmail_outgoing_list is NULL, nothing to send...\n", CELLIAX_P_LOG);
+/* ERRORA("cvm_busmail_outgoing_list is NULL ?\n", SKYPIAX_P_LOG); */
+ WARNINGA("cvm_busmail_outgoing_list is NULL, nothing to send...\n", SKYPIAX_P_LOG);
/* return -1; */
return 0;
@@ -8115,7 +8604,7 @@
}
while (ptr->next != NULL) {
- WARNINGA("cvm_busmail_outgoing_list->next is not null ?\n", CELLIAX_P_LOG);
+ WARNINGA("cvm_busmail_outgoing_list->next is not null ?\n", SKYPIAX_P_LOG);
ptr = ptr->next; //FIXME what to do?
}
@@ -8150,13 +8639,13 @@
if ((tv.tv_sec * 1000 + tv.tv_usec / 1000) > ((ptr->tv_sec * 1000 + ptr->tv_usec / 1000) + 1000)) { //retest, maybe has been changed?
if (option_debug > 1)
- DEBUGA_CVM("RESEND TxSeq=%X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("RESEND TxSeq=%X, passed %ld ms, sent %d times\n", SKYPIAX_P_LOG,
ptr->txseqno,
((tv.tv_sec * 1000 + tv.tv_usec / 1000) -
(ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), ptr->how_many_sent);
if (ptr->how_many_sent > 9) {
- ERRORA("RESEND TxSeq=%X, passed %ld ms, sent %d times\n", CELLIAX_P_LOG,
+ ERRORA("RESEND TxSeq=%X, passed %ld ms, sent %d times\n", SKYPIAX_P_LOG,
ptr->txseqno,
((tv.tv_sec * 1000 + tv.tv_usec / 1000) -
(ptr->tv_sec * 1000 + ptr->tv_usec / 1000)), ptr->how_many_sent);
@@ -8174,9 +8663,9 @@
ptr->how_many_sent++;
/*
if (option_debug > 1) {
- DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
- DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list END\n", SKYPIAX_P_LOG);
}
*/
}
@@ -8195,7 +8684,7 @@
if (ptr->sent == 0 && ptr->acknowledged == 0 && ptr->valid == 1) { //retest, maybe has been changed?
if (option_debug > 1)
- DEBUGA_CVM("SENDING 1st TIME TxSeq=%X\n", CELLIAX_P_LOG, ptr->txseqno);
+ DEBUGA_CVM("SENDING 1st TIME TxSeq=%X\n", SKYPIAX_P_LOG, ptr->txseqno);
celliax_serial_send_CVM_BUSMAIL(p, ptr->busmail_msg_len, ptr->busmail_msg_buffer);
@@ -8205,9 +8694,9 @@
ptr->how_many_sent++;
/*
if (option_debug > 1) {
- DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
- DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list END\n", SKYPIAX_P_LOG);
}
*/
}
@@ -8219,7 +8708,7 @@
return 0;
}
-int celliax_serial_write_CVM_BUSMAIL(struct celliax_pvt *p,
+int celliax_serial_write_CVM_BUSMAIL(private_t * tech_pvt,
struct cvm_busmail_frame *busmail_frame)
{
unsigned char buffer2[BUSMAIL_MAX_FRAME_LENGTH];
@@ -8249,7 +8738,7 @@
sizeof(busmail_frame->busmail_mail_task_id) + 2;
if (option_debug > 1)
- DEBUGA_CVM("INFO frame to send\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("INFO frame to send\n", SKYPIAX_P_LOG);
buffer2[BUSMAIL_OFFSET_MAIL_PROGRAM_ID] = busmail_frame->busmail_mail_program_id;
buffer2[BUSMAIL_OFFSET_MAIL_TASK_ID] = busmail_frame->busmail_mail_task_id;
@@ -8281,11 +8770,11 @@
len = BUSMAIL_OFFSET_MAIL + sizeof(busmail_frame->busmail_crc);
if (option_debug > 1)
- DEBUGA_CVM("CTRL frame to send\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("CTRL frame to send\n", SKYPIAX_P_LOG);
}
/*
- DEBUGA_CVM("Its len=%d\n", CELLIAX_P_LOG, len);
+ DEBUGA_CVM("Its len=%d\n", SKYPIAX_P_LOG, len);
*/
busmail_frame->busmail_len[BUSMAIL_LEN_LSB] =
@@ -8342,17 +8831,17 @@
}
if (option_debug > 1)
- DEBUGA_CVM("INFO: %s was prepared to send\n", CELLIAX_P_LOG, debug_buf);
+ DEBUGA_CVM("INFO: %s was prepared to send\n", SKYPIAX_P_LOG, debug_buf);
}
if (option_debug > 1) {
- DEBUGA_CVM("OUTGOING INFO Frame TxSeq is %X, RxSeq is %X\n", CELLIAX_P_LOG,
+ DEBUGA_CVM("OUTGOING INFO Frame TxSeq is %X, RxSeq is %X\n", SKYPIAX_P_LOG,
(buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_TXSEQ_MASK) >> 4,
buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_RXSEQ_MASK);
/*
- DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
- DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG); */
+ DEBUGA_CVM("OUTGOING list END\n", SKYPIAX_P_LOG); */
}
p->cvm_busmail_outgoing_list->txseqno =
(unsigned char) (buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_TXSEQ_MASK) >> 4;
@@ -8370,7 +8859,7 @@
(buffer2[BUSMAIL_OFFSET_HEADER] & BUSMAIL_HEADER_REJ_MASK)) {
if (option_debug > 1)
- DEBUGA_CVM("CTRL REJ frame...\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("CTRL REJ frame...\n", SKYPIAX_P_LOG);
if (0xFF != p->busmail_rxseq_cvm_last) {
buffer2[BUSMAIL_OFFSET_HEADER] |=
@@ -8379,7 +8868,7 @@
if (option_debug > 1)
DEBUGA_CVM
("Skipping sending REJ, because we just cleared RxSeq counter, and probably it was a packet that is invalid now...\n",
- CELLIAX_P_LOG);
+ SKYPIAX_P_LOG);
return 0;
}
@@ -8407,7 +8896,7 @@
}
if (option_debug > 1)
- DEBUGA_CVM("CTRL: %s was prepared to send\n", CELLIAX_P_LOG, debug_buf);
+ DEBUGA_CVM("CTRL: %s was prepared to send\n", SKYPIAX_P_LOG, debug_buf);
}
// usleep(100);
celliax_serial_send_CVM_BUSMAIL(p, len, buffer2);
@@ -8416,7 +8905,7 @@
return 0;
}
-int celliax_serial_send_ctrl_frame_CVM_BUSMAIL(struct celliax_pvt *p,
+int celliax_serial_send_ctrl_frame_CVM_BUSMAIL(private_t * tech_pvt,
unsigned char FrameType)
{
/*FrameType parameter is really a busmail header with info neeeded to tell the frame type to send */
@@ -8436,7 +8925,7 @@
break;
default:
- WARNINGA("UNKNOWN CTRL TYPE specified, sending nothing!!!\n", CELLIAX_P_LOG);
+ WARNINGA("UNKNOWN CTRL TYPE specified, sending nothing!!!\n", SKYPIAX_P_LOG);
return -1;
break;
}
@@ -8447,7 +8936,7 @@
return celliax_serial_write_CVM_BUSMAIL(p, &busmail_frame);
}
-int celliax_serial_send_info_frame_CVM_BUSMAIL(struct celliax_pvt *p, int FrameType,
+int celliax_serial_send_info_frame_CVM_BUSMAIL(private_t * tech_pvt, int FrameType,
unsigned char ParamsLen,
unsigned char *Params)
{
@@ -8474,15 +8963,15 @@
return celliax_serial_write_CVM_BUSMAIL(p, &busmail_frame);
}
-int celliax_serial_lists_free_CVM_BUSMAIL(struct celliax_pvt *p)
+int celliax_serial_lists_free_CVM_BUSMAIL(private_t * tech_pvt)
{
struct cvm_busmail_msg *ptr, *prev;
/*
if (option_debug > 1) {
- DEBUGA_CVM("START FREEING OUTGOING\n", CELLIAX_P_LOG);
- DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("START FREEING OUTGOING\n", SKYPIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
- DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list END\n", SKYPIAX_P_LOG);
}
*/
ptr = p->cvm_busmail_outgoing_list;
@@ -8494,7 +8983,7 @@
while (ptr->previous != NULL) {
if (option_debug > 1)
- DEBUGA_CVM("FREED \n", CELLIAX_P_LOG);
+ DEBUGA_CVM("FREED \n", SKYPIAX_P_LOG);
prev = ptr->previous;
free(ptr);
@@ -8505,22 +8994,22 @@
}
if (option_debug > 1)
- DEBUGA_CVM("LAST FREED \n", CELLIAX_P_LOG);
+ DEBUGA_CVM("LAST FREED \n", SKYPIAX_P_LOG);
p->cvm_busmail_outgoing_list = NULL;
p->cvm_busmail_outgoing_list = celliax_serial_list_init_CVM_BUSMAIL(p);
if (option_debug > 1) {
- DEBUGA_CVM("OUTGOING list:\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list:\n", SKYPIAX_P_LOG);
celliax_serial_list_print_CVM_BUSMAIL(p, p->cvm_busmail_outgoing_list);
- DEBUGA_CVM("OUTGOING list END\n", CELLIAX_P_LOG);
- DEBUGA_CVM("STARTING FREE INGOING\n", CELLIAX_P_LOG);
+ DEBUGA_CVM("OUTGOING list END\n", SKYPIAX_P_LOG);
+ DEBUGA_CVM("STARTING FREE INGOING\n", SKYPIAX_P_LOG);
}
return 0;
}
-struct cvm_busmail_msg *celliax_serial_list_init_CVM_BUSMAIL(struct celliax_pvt *p)
+struct cvm_busmail_msg *celliax_serial_list_init_CVM_BUSMAIL(private_t * tech_pvt)
{
struct cvm_busmail_msg *list;
list = p->cvm_busmail_outgoing_list;
@@ -8563,7 +9052,7 @@
return list;
}
-int celliax_serial_list_print_CVM_BUSMAIL(struct celliax_pvt *p,
+int celliax_serial_list_print_CVM_BUSMAIL(private_t * tech_pvt,
struct cvm_busmail_msg *list)
{
struct cvm_busmail_msg *ptr;
@@ -8578,7 +9067,7 @@
if (option_debug > 3)
DEBUGA_CVM
("PTR msg is: %d, seqnum is %.2X, tv_sec is %d, tv_usec is %d, acknowledged is: %d,"
- " sent is:%d, how_many_sent is: %d\n", CELLIAX_P_LOG, ptr->valid,
+ " sent is:%d, how_many_sent is: %d\n", SKYPIAX_P_LOG, ptr->valid,
/*ptr->seqnum */ 44,
ptr->tv_sec, ptr->tv_usec, ptr->acknowledged, ptr->sent, ptr->how_many_sent);