Skip to content
Snippets Groups Projects
Commit b005d8dd authored by David Vossel's avatar David Vossel
Browse files

Fixes issue with finding correct extension when message context is used.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 92dcabe7
No related branches found
No related tags found
No related merge requests found
......@@ -16116,6 +16116,15 @@ static void receive_message(struct sip_pvt *p, struct sip_request *req, struct a
}
}
 
/* Override the context with the message context _BEFORE_
* getting the destination. This way we can guarantee the correct
* extension is used in the message context when it is present. */
if (!ast_strlen_zero(p->messagecontext)) {
ast_string_field_set(p, context, p->messagecontext);
} else if (!ast_strlen_zero(sip_cfg.messagecontext)) {
ast_string_field_set(p, context, sip_cfg.messagecontext);
}
get_destination(p, NULL, NULL);
 
if (!(msg = ast_msg_alloc())) {
......@@ -16132,14 +16141,7 @@ static void receive_message(struct sip_pvt *p, struct sip_request *req, struct a
res = ast_msg_set_to(msg, "%s", to);
res |= ast_msg_set_from(msg, "%s", get_in_brackets(from));
res |= ast_msg_set_body(msg, "%s", ast_str_buffer(buf));
if (!ast_strlen_zero(p->messagecontext)) {
res |= ast_msg_set_context(msg, "%s", p->messagecontext);
} else if (!ast_strlen_zero(sip_cfg.messagecontext)) {
res |= ast_msg_set_context(msg, "%s", sip_cfg.messagecontext);
} else {
res |= ast_msg_set_context(msg, "%s", p->context);
}
res |= ast_msg_set_context(msg, "%s", p->context);
 
if (!ast_strlen_zero(p->peername)) {
res |= ast_msg_set_var(msg, "SIP_PEERNAME", p->peername);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment