]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
gsmopen: workaround for reading with timeout, need something to simulate the poll...
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Fri, 13 Apr 2012 16:30:48 +0000 (18:30 +0200)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Fri, 13 Apr 2012 16:30:48 +0000 (18:30 +0200)
src/mod/endpoints/mod_gsmopen/gsmopen.h
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp

index 949444d47dfeceeffcf70df5cf9cebcbe9091ceb..355ae4a588c9562796813a93ccd11371f88858d3 100644 (file)
@@ -537,8 +537,10 @@ int gsmopen_serial_config_AT(private_t *tech_pvt);
 #define gsmopen_serial_write_AT_expect_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 0)
 #define gsmopen_serial_write_AT_expect_noexpcr_tout(P, D, S, T) gsmopen_serial_write_AT_expect1(P, D, S, 0, T)
 // 20.5 sec timeout, used for querying the SIM and sending SMSs
-#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20)
-#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20)
+//#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 20)
+//#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 20)
+#define gsmopen_serial_write_AT_expect_longtime(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 1, 5)
+#define gsmopen_serial_write_AT_expect_longtime_noexpcr(P, D, S) gsmopen_serial_write_AT_expect1(P, D, S, 0, 5)
 int gsmopen_serial_write_AT(private_t *tech_pvt, const char *data);
 int gsmopen_serial_write_AT_nocr(private_t *tech_pvt, const char *data);
 int gsmopen_serial_write_AT_ack(private_t *tech_pvt, const char *data);
index 7943b843554a2fab7affcbbf042fd0da9c51e5f5..c45828856eb3757c7d8e5352d47fd93ddff1a1de 100644 (file)
@@ -1893,7 +1893,8 @@ int gsmopen_serial_write_AT_ack_nocr_longtime(private_t *tech_pvt, const char *d
                return -1;
        }
 
-       at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 20, NULL, 1);   // 20.5 sec timeout
+       //at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 20, NULL, 1); // 20.5 sec timeout
+       at_result = gsmopen_serial_read_AT(tech_pvt, 1, 500000, 3, NULL, 1);    // 3.5 sec timeout
        UNLOCKA(tech_pvt->controldev_lock);
        POPPA_UNLOCKA(tech_pvt->controldev_lock);
 
@@ -2466,7 +2467,7 @@ int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text)
                        failed = 1;
                        goto uscita;
                }
-               err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1);   // wait 1.5s for the prompt, no  crlf
+               err = gsmopen_serial_AT_expect(tech_pvt, "> ", 0, 1);   // wait 1.1s for the prompt, no  crlf
 #if 1
                if (err) {
                        DEBUGA_GSMOPEN
@@ -2557,10 +2558,12 @@ int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text)
                POPPA_UNLOCKA(&tech_pvt->controldev_lock);
        }
 
+#ifdef NOTDEF
        err = gsmopen_serial_write_AT_ack(tech_pvt, "AT+CMGF=0");
        if (err) {
                DEBUGA_GSMOPEN("AT+CMGF=0 (set message sending to PDU (as opposed to TEXT)  do not got OK from the phone, continuing\n", GSMOPEN_P_LOG);
        }
+#endif// NOTDEF
 
        DEBUGA_GSMOPEN("FINISH\n", GSMOPEN_P_LOG);
        if (failed)