diff options
Diffstat (limited to 'res/res_pjsip_session.c')
-rw-r--r-- | res/res_pjsip_session.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index d41d2d959..4c68cc9f6 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -1998,6 +1998,12 @@ static enum sip_get_destination_result get_destination(struct ast_sip_session *s if (!strcmp(session->exten, pickupexten) || ast_exists_extension(NULL, session->endpoint->context, session->exten, 1, NULL)) { + size_t size = pj_strlen(&sip_ruri->host) + 1; + char *domain = ast_alloca(size); + + ast_copy_pj_str(domain, &sip_ruri->host, size); + pbx_builtin_setvar_helper(session->channel, "SIPDOMAIN", domain); + return SIP_GET_DEST_EXTEN_FOUND; } /* XXX In reality, we'll likely have further options so that partial matches |