]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
use the specified 'subscribecontext' for a peer rather than the context found via...
authorKevin P. Fleming <kpfleming@digium.com>
Fri, 19 May 2006 19:39:55 +0000 (19:39 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Fri, 19 May 2006 19:39:55 +0000 (19:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@28794 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 6c4091c1656b0cf4090256bccf7fde8e1c80c838..f3d93f52ad948048f2dc568ede9687a36d8c38d2 100644 (file)
@@ -10823,13 +10823,17 @@ static int handle_request_subscribe(struct sip_pvt *p, struct sip_request *req,
                        }
                        return 0;
                }
-               /* Initialize the context if it hasn't been already */
+               gotdest = get_destination(p, NULL);
+               /* Initialize the context if it hasn't been already;
+                  note this is done _after_ handling any domain lookups,
+                  because the context specified there is for calls, not
+                  subscriptions
+               */
                if (!ast_strlen_zero(p->subscribecontext))
                        ast_copy_string(p->context, p->subscribecontext, sizeof(p->context));
                else if (ast_strlen_zero(p->context))
                        strcpy(p->context, default_context);
                /* Get destination right away */
-               gotdest = get_destination(p, NULL);
                build_contact(p);
                if (gotdest) {
                        if (gotdest < 0)