[asterisk-commits] may: branch may/smpp r404530 - in /team/may/smpp/trunk: ./ addons/res_smpp.c

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


Author: may
Date: Fri Dec 20 16:55:59 2013
New Revision: 404530

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=404530
Log:
Multiple revisions 404528-404529

........
  r404528 | may | 2013-12-21 02:42:56 +0400 (Sat, 21 Dec 2013) | 2 lines
  
  don't check last enquire response before enquire request is sent
........
  r404529 | may | 2013-12-21 02:50:33 +0400 (Sat, 21 Dec 2013) | 2 lines
  
  fix sentenq place bug
........

Merged revisions 404528-404529 from http://svn.asterisk.org/svn/asterisk/team/may/smpp/branches/10

Modified:
    team/may/smpp/trunk/   (props changed)
    team/may/smpp/trunk/addons/res_smpp.c

Propchange: team/may/smpp/trunk/
------------------------------------------------------------------------------
--- smpp-10-merge (original)
+++ smpp-10-merge Fri Dec 20 16:55:59 2013
@@ -1,1 +1,1 @@
-/team/may/smpp/branches/10:1-402222,403011,404526
+/team/may/smpp/branches/10:1-404529

Propchange: team/may/smpp/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 20 16:55:59 2013
@@ -1,1 +1,1 @@
-/team/may/smpp/branches/10:400905-401373,401882,402222,403011,404526
+/team/may/smpp/branches/10:400905-401373,401882,402222,403011,404526,404528-404529

Modified: team/may/smpp/trunk/addons/res_smpp.c
URL: http://svnview.digium.com/svn/asterisk/team/may/smpp/trunk/addons/res_smpp.c?view=diff&rev=404530&r1=404529&r2=404530
==============================================================================
--- team/may/smpp/trunk/addons/res_smpp.c (original)
+++ team/may/smpp/trunk/addons/res_smpp.c Fri Dec 20 16:55:59 2013
@@ -464,7 +464,6 @@
 		enq_resp.command_status = ESME_ROK;
 		enq_resp.sequence_number = sequence_number;
 		queue_pdu(smsc, ENQUIRE_LINK_RESP, (void *)&enq_resp);
-		smsc->sentenq = time(NULL);
 	} else if ((uint32_t)enq_resp->command_id == (uint32_t) ENQUIRE_LINK_RESP && enq_resp->command_status == ESME_ROK) {
 		smsc->lastenq = time(NULL);
 	} else {
@@ -644,6 +643,7 @@
 	enq.command_id = ENQUIRE_LINK;
 	enq.command_status = ESME_ROK;
 	enq.sequence_number = smsc->seq++;
+	smsc->sentenq = time(NULL);
 
 	return queue_pdu(smsc, ENQUIRE_LINK, (void *)&enq);
 }
@@ -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;
@@ -957,7 +961,7 @@
 					pthread_testcancel();
 					sleep(12);
 					continue;
-				} 
+				}
 			}
 		}
 




More information about the asterisk-commits mailing list