[Asterisk-cvs] asterisk/apps app_sms.c,1.15,1.16

markster at lists.digium.com markster at lists.digium.com
Sun Dec 19 12:20:35 CST 2004


Update of /usr/cvsroot/asterisk/apps
In directory mongoose.digium.com:/tmp/cvs-serv5064/apps

Modified Files:
	app_sms.c 
Log Message:
SMS fix, pbx optimization (bug #3098)


Index: app_sms.c
===================================================================
RCS file: /usr/cvsroot/asterisk/apps/app_sms.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- app_sms.c	14 Dec 2004 23:36:29 -0000	1.15
+++ app_sms.c	19 Dec 2004 17:16:39 -0000	1.16
@@ -38,7 +38,7 @@
 /* user ref field */
 
 static volatile unsigned char message_ref;      /* arbitary message ref */
-static volatile unsigned int seq;      /* arbitrary message sequence number for unqiue files */
+static volatile unsigned int seq;       /* arbitrary message sequence number for unqiue files */
 
 static char log_file[255];
 static char spool_dir[255];
@@ -108,6 +108,7 @@
 typedef struct sms_s
 {
    unsigned char hangup;        /* we are done... */
+   unsigned char err;           /* set for any errors */
    unsigned char smsc:1;        /* we are SMSC */
    unsigned char rx:1;          /* this is a received message */
    char queue[30];              /* queue name */
@@ -1200,6 +1201,7 @@
       }
       break;
    case 0x92:                  /* SMS_ERROR */
+      h->err = 1;
       sms_messagetx (h);        /* send whatever we sent again */
       break;
    case 0x93:                  /* SMS_EST */
@@ -1213,6 +1215,7 @@
       sms_nextoutgoing (h);
       break;
    case 0x96:                  /* SMS_NACK */
+      h->err = 1;
       sms_log (h, 'N');
       sms_nextoutgoing (h);
       break;
@@ -1429,9 +1432,11 @@
          {                      /* nothing happening */
             ast_log (LOG_EVENT, "No data, hanging up\n");
             h->hangup = 1;
+            h->err = 1;
          }
          if (h->ierr)
          {                      /* error */
+            h->err = 1;
             h->omsg[0] = 0x92;  /* error */
             h->omsg[1] = 1;
             h->omsg[2] = h->ierr;
@@ -1608,7 +1613,7 @@
    sms_log (&h, '?');           /* log incomplete message */
 
    LOCAL_USER_REMOVE (u);
-   return (h.hangup);
+   return (h.err);
 }
 
 int




More information about the svn-commits mailing list