]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
only do magic pickup when notifycid is enabled
authorDavid Vossel <dvossel@digium.com>
Fri, 13 Aug 2010 18:54:53 +0000 (18:54 +0000)
committerDavid Vossel <dvossel@digium.com>
Fri, 13 Aug 2010 18:54:53 +0000 (18:54 +0000)
A new way of doing BLF pickup was introduced into 1.6.2.  This feature
adds a call-id value into the XML of a SIP_NOTIFY message sent to alert
a subscriber that a device is ringing.  This option should only be enabled
when the new 'notifycid' option is set... but this was not the case.  Instead
the call-id value was included for every RINGING Notify message, which
caused a regression for people who used other methods for call pickup.

(closes issue #17633)
Reported by: urosh
Patches:
      chan_sip.txt uploaded by urosh (license )
      blf_cid_issue.diff uploaded by dvossel (license 671)
Tested by: dvossel, urosh, okrief, alecdavis

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.2@282235 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index e1f5f3cf149f99d54b570b5040f52c24b5d1c9b7..92b37daad92b11dc65fca00de4da9ea168779201 100644 (file)
@@ -11319,23 +11319,24 @@ static int transmit_state_notify(struct sip_pvt *p, int state, int full, int tim
                                        ast_channel_unlock(caller);
                                        caller = NULL;
                                }
+                               /* We create a fake call-id which the phone will send back in an INVITE
+                                * Replaces header which we can grab and do some magic with. */
+                               ast_str_append(&tmp, 0, 
+                                               "<dialog id=\"%s\" call-id=\"pickup-%s\" direction=\"recipient\">\n"
+                                               "<remote>\n"
+                                               /* See the limitations of this above.  Luckily the phone seems to still be
+                                                  happy when these values are not correct. */
+                                               "<identity display=\"%s\">%s</identity>\n"
+                                               "<target uri=\"%s\"/>\n"
+                                               "</remote>\n"
+                                               "<local>\n"
+                                               "<identity>%s</identity>\n"
+                                               "<target uri=\"%s\"/>\n"
+                                               "</local>\n",
+                                               p->exten, p->callid, local_display, local_target, local_target, mto, mto);
+                       } else {
+                               ast_str_append(&tmp, 0, "<dialog id=\"%s\" direction=\"recipient\">\n", p->exten);
                        }
-
-                       /* We create a fake call-id which the phone will send back in an INVITE
-                          Replaces header which we can grab and do some magic with. */
-                       ast_str_append(&tmp, 0, 
-                                       "<dialog id=\"%s\" call-id=\"pickup-%s\" direction=\"recipient\">\n"
-                                       "<remote>\n"
-                                       /* See the limitations of this above.  Luckily the phone seems to still be
-                                          happy when these values are not correct. */
-                                       "<identity display=\"%s\">%s</identity>\n"
-                                       "<target uri=\"%s\"/>\n"
-                                       "</remote>\n"
-                                       "<local>\n"
-                                       "<identity>%s</identity>\n"
-                                       "<target uri=\"%s\"/>\n"
-                                       "</local>\n",
-                                       p->exten, p->callid, local_display, local_target, local_target, mto, mto);
                } else {
                        ast_str_append(&tmp, 0, "<dialog id=\"%s\">\n", p->exten);
                }