Add a "message_context" option for PJSIP endpoints.

........

Merged revisions 411157 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@411158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Michelson
2014-03-25 17:40:51 +00:00
parent c1c8300e27
commit 2bf37a417d
5 changed files with 17 additions and 2 deletions

View File

@@ -464,13 +464,14 @@ static enum pjsip_status_code rx_data_to_ast_msg(pjsip_rx_data *rdata, struct as
const char *field;
pjsip_status_code code;
struct ast_sip_endpoint *endpt = ast_pjsip_rdata_get_endpoint(rdata);
const char *context = S_OR(endpt->message_context, endpt->context);
/* make sure there is an appropriate context and extension*/
if ((code = get_destination(rdata, endpt->context, buf)) != PJSIP_SC_OK) {
if ((code = get_destination(rdata, context, buf)) != PJSIP_SC_OK) {
return code;
}
CHECK_RES(ast_msg_set_context(msg, "%s", endpt->context));
CHECK_RES(ast_msg_set_context(msg, "%s", context));
CHECK_RES(ast_msg_set_exten(msg, "%s", buf));
/* to header */