]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Properly handle hints that point to multiple devices in chan_sip. Why chan_sip is...
authorJoshua Colp <jcolp@digium.com>
Wed, 9 May 2007 16:51:03 +0000 (16:51 +0000)
committerJoshua Colp <jcolp@digium.com>
Wed, 9 May 2007 16:51:03 +0000 (16:51 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@63610 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 6f83a62e73e6605a1c804479586109fbc980252b..1924c406abca736847cab11a23bf0e2b7ef78cb4 100644 (file)
@@ -5230,11 +5230,14 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int sub
        
        /* Check which device/devices we are watching  and if they are registered */
        if (ast_get_hint(hint, sizeof(hint), NULL, 0, NULL, p->context, p->exten)) {
-               /* If they are not registered, we will override notification and show no availability */
-               if (ast_device_state(hint) == AST_DEVICE_UNAVAILABLE) {
-                       local_state = NOTIFY_CLOSED;
-                       pidfstate = "away";
-                       pidfnote = "Not online";
+               char *hint2 = hint, *individual_hint = NULL;
+               while ((individual_hint = strsep(&hint2, "&"))) {
+                       /* If they are not registered, we will override notification and show no availability */
+                       if (ast_device_state(individual_hint) == AST_DEVICE_UNAVAILABLE) {
+                               local_state = NOTIFY_CLOSED;
+                               pidfstate = "away";
+                               pidfnote = "Not online";
+                       }
                }
        }