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

Modified Files:
        chan_sip.c 
Log Message:
preserve hint watchers and laststate across 'extensions reload' (issue #2522)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.821
retrieving revision 1.822
diff -u -d -r1.821 -r1.822
--- chan_sip.c  26 Aug 2005 20:04:28 -0000      1.821
+++ chan_sip.c  27 Aug 2005 23:55:14 -0000      1.822
@@ -5733,20 +5733,24 @@
 }
 
 /*--- cb_extensionstate: Part of thte SUBSCRIBE support subsystem ---*/
-static int cb_extensionstate(char *context, char* exten, int state, void *data)
+static int cb_extensionstate(char *context, char* exten, enum 
ast_extension_states state, void *data)
 {
        struct sip_pvt *p = data;
-       if (state == -1) {
+
+       switch (state) {
+       case AST_EXTENSION_DEACTIVATED:
+       case AST_EXTENSION_REMOVED:
+               transmit_state_notify(p, state, 1);
                sip_scheddestroy(p, 15000);
                p->stateid = -1;
                return 0;
+       default:
+               transmit_state_notify(p, state, 1);
+               
+               if (option_debug > 1)
+                       ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new 
state %d for Notify User %s\n", exten, state, p->username);
+               return 0;
        }
- 
-       transmit_state_notify(p, state, 1);
-
-       if (option_debug > 1)
-               ast_verbose(VERBOSE_PREFIX_1 "Extension Changed %s new state %d 
for Notify User %s\n", exten, state, p->username);
-       return 0;
 }
 
 /*--- register_verify: Verify registration of user */

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to