]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
gsmopen: correctly receives SMSs in GSM7 and UCS2
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Sun, 13 May 2012 23:55:45 +0000 (01:55 +0200)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Mon, 14 May 2012 00:04:36 +0000 (02:04 +0200)
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp

index af89b8dfa48c05d5269059e8060b65ae6dff5a97..5e5cadd9b64ef895e2fa3a5e9d4e471a12e24343 100644 (file)
@@ -1180,10 +1180,12 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
                                                if (res) {
                                                        ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command);
                                                }
-                                               res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"GSM\"");
+/*
+                                               res = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CSCS=\"CIAPALO1\"");
                                                if (res) {
-                                                       ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG);
+                                                       ERRORA("AT+CSCS=\"CIAPALO1\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG);
                                                }
+*/
                                                memset(at_command, 0, sizeof(at_command));
                                                sprintf(at_command, "AT+CMGD=%d", tech_pvt->unread_sms_msg_id); /* delete the message */
                                                tech_pvt->unread_sms_msg_id = 0;
@@ -2399,7 +2401,7 @@ int utf8_to_iso_8859_1(private_t *tech_pvt, char *utf8_in, size_t inbytesleft, c
        iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
 #endif // WIN32
        if (iconv_res == (size_t) -1) {
-               ERRORA("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno);
+               DEBUGA_GSMOPEN("cannot translate in iso_8859_1 error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno);
                return -1;
        }
        DEBUGA_GSMOPEN
@@ -3038,9 +3040,9 @@ int gsmopen_serial_getstatus_AT(private_t *tech_pvt)
                                if (res) {
                                        ERRORA("AT+CMGR (read SMS) do not got OK from the phone, message sent was:|||%s|||\n", GSMOPEN_P_LOG, at_command);
                                }
-                               res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"GSM\"");
+                               res = gsmopen_serial_write_AT_ack(p, "AT+CSCS=\"CIAPALO2\"");
                                if (res) {
-                                       ERRORA("AT+CSCS=\"GSM\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG);
+                                       ERRORA("AT+CSCS=\"CIAPALO2\" (set TE messages to GSM) do not got OK from the phone\n", GSMOPEN_P_LOG);
                                }
                                memset(at_command, 0, sizeof(at_command));
                                sprintf(at_command, "AT+CMGD=%d", p->unread_sms_msg_id);        /* delete the message */