summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorMark Michelson <mmichelson@digium.com>2010-04-28 22:34:15 +0000
committerMark Michelson <mmichelson@digium.com>2010-04-28 22:34:15 +0000
commit9e1b6c72368df41fb164fde6e7e35d3fd4bbbb8f (patch)
treea61071d8bc93c49e2d9957cb1cb7681d1bccf1f0 /channels/chan_sip.c
parent6722251986787e774411341f8b9825023c48c944 (diff)
Don't override peer context with domain context.
(closes issue #17040) Reported by: pprindeville Patches: asterisk-1.6-bugid17040.patch uploaded by pprindeville (license 347) Tested by: pprindeville Review: https://reviewboard.asterisk.org/r/565/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@259957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r--channels/chan_sip.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 4d62561e8..a7b57438a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -13508,8 +13508,9 @@ static int get_destination(struct sip_pvt *p, struct sip_request *oreq, int *cc_
return -2;
}
}
- /* If we have a context defined, overwrite the original context */
- if (!ast_strlen_zero(domain_context))
+ /* If we don't have a peer (i.e. we're a guest call),
+ * overwrite the original context */
+ if (!ast_test_flag(&p->flags[1], SIP_PAGE2_HAVEPEERCONTEXT) && !ast_strlen_zero(domain_context))
ast_string_field_set(p, context, domain_context);
}
@@ -24945,6 +24946,7 @@ static struct sip_peer *build_peer(const char *name, struct ast_variable *v, str
ast_string_field_set(peer, cid_num, v->value);
} else if (!strcasecmp(v->name, "context")) {
ast_string_field_set(peer, context, v->value);
+ ast_set_flag(&peer->flags[1], SIP_PAGE2_HAVEPEERCONTEXT);
} else if (!strcasecmp(v->name, "subscribecontext")) {
ast_string_field_set(peer, subscribecontext, v->value);
} else if (!strcasecmp(v->name, "fromdomain")) {