aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-09 16:51:03 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-05-09 16:51:03 +0000
commit3e69f93c83c5252012e0579e75623c2620fef6ad (patch)
treeaec0a0e368c00437a47eb4c6433593d074ae066f /channels
parent71efc8a4211a8cc2d6bd2d51c9e6112dea5a4f85 (diff)
Properly handle hints that point to multiple devices in chan_sip. Why chan_sip is even doing this I have no idea but I would rather not go into a rant. (issue #9536 reported by rlister)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@63610 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 6f83a62e7..1924c406a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -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";
+ }
}
}