[asterisk-commits] may: branch may/smpp r404528 - /team/may/smpp/branches/10/addons/res_smpp.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Dec 20 16:42:59 CST 2013


Author: may
Date: Fri Dec 20 16:42:56 2013
New Revision: 404528

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=404528
Log:
don't check last enquire response before enquire request is sent

Modified:
    team/may/smpp/branches/10/addons/res_smpp.c

Modified: team/may/smpp/branches/10/addons/res_smpp.c
URL: http://svnview.digium.com/svn/asterisk/team/may/smpp/branches/10/addons/res_smpp.c?view=diff&rev=404528&r1=404527&r2=404528
==============================================================================
--- team/may/smpp/branches/10/addons/res_smpp.c (original)
+++ team/may/smpp/branches/10/addons/res_smpp.c Fri Dec 20 16:42:56 2013
@@ -780,6 +780,8 @@
 				sleep(12);
 				pthread_testcancel();
 				continue;	// reconnect if bind was unsuccessfull
+			} else {
+				smsc->lastenq = time(NULL);
 			}
 		}
 
@@ -818,7 +820,7 @@
 				process_pdu(smsc, unpack);
 			}
 		} else {
-			if (smsc->enquire && time(NULL) - smsc->lastenq >= smsc->enquire * 2) {
+			if (smsc->enquire && smsc->sentenq && time(NULL) - smsc->lastenq >= smsc->enquire * 2) {
 				smsc->stop = 1;
 				pthread_testcancel();
 				continue;
@@ -907,6 +909,8 @@
 		ast_verb(2,"Esme thread for %s started\n", smsc->name);
 	}
 
+	smsc->lastenq = time(NULL);
+
 	if (!(sched = ast_sched_context_create())) {
 		ast_log(LOG_ERROR, "Unable to create schedule context on smsc %s\n", smsc->name);
 		close(smsc->socket);
@@ -946,7 +950,7 @@
 				process_pdu(smsc, unpack);
 			}
 		} else {
-			if (smsc->enquire && time(NULL) - smsc->lastenq >= smsc->enquire * 2) {
+			if (smsc->enquire && smsc->sentenq && time(NULL) - smsc->lastenq >= smsc->enquire * 2) {
 				smsc->stop = 1;
 				pthread_testcancel();
 				continue;




More information about the asterisk-commits mailing list