]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
gsmopen: fix FS-4181 , catch gsmlib exceptions
authorGiovanni Maruzzelli <gmaruzz@gmail.com>
Thu, 3 May 2012 13:22:15 +0000 (15:22 +0200)
committerGiovanni Maruzzelli <gmaruzz@gmail.com>
Thu, 3 May 2012 13:22:15 +0000 (15:22 +0200)
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp

index 63d2d1cad58ff81a33376d3430b72acea3ae4097..40d782e7ada43aea435130ff945dcaf77ca598d1 100644 (file)
@@ -1569,6 +1569,7 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
                                }
                        }
 
+
                        /* if we are reading an sms message from memory, put the line into the sms buffer if the line is not "OK" or "ERROR" */
                        if (tech_pvt->reading_sms_msg > 1 && at_ack == -1) {
                                int c;
@@ -1667,6 +1668,7 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
 
 
 #ifdef WANT_GSMLIB
+try{
                                                char content2[1000];
                                                SMSMessageRef sms;
                                                //MessageType messagetype;
@@ -1712,6 +1714,10 @@ int gsmopen_serial_read_AT(private_t *tech_pvt, int look_for_ack, int timeout_us
                                                //servicecentretimestamp = sms->serviceCentreTimestamp();
                                                //sender_recipient_address = sms->address();
 
+}  catch (GsmException &ge)
+  {
+       ERRORA("GsmException= |||%s|||\n", GSMOPEN_P_LOG, ge.what());
+  }
 
 
 #endif // WANT_GSMLIB
@@ -2745,6 +2751,7 @@ int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text)
 
                if (tech_pvt->no_ucs2 || tech_pvt->sms_pdu_not_supported == 0) {
 #ifdef WANT_GSMLIB
+try{
                        SMSMessageRef smsMessage;
 
                        memset(mesg_test, '\0', sizeof(mesg_test));
@@ -2818,6 +2825,11 @@ int gsmopen_sendsms(private_t *tech_pvt, char *dest, char *text)
                        //servicecentretimestamp = sms->serviceCentreTimestamp();
                        //sender_recipient_address = sms->address();
 #endif // NOTDEF
+} catch (GsmException &ge)
+  {
+       ERRORA("GsmException= |||%s|||\n", GSMOPEN_P_LOG, ge.what());
+  }
+
 
 #else // WANT_GSMLIB
                        ERRORA("tech_pvt->no_ucs2 || tech_pvt->sms_pdu_not_supported == 0 && no WANT_GSMLIB\n", GSMOPEN_P_LOG);