mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
chan_pjsip: Assign SIPDOMAIN after creating a channel
session->channel doesn't exist until chan_pjsip creates it, so intead of setting a channel variable every new incoming call sets one and the same global variable. This patch moves the code to chan_pjsip so that SIPDOMAIN is set on a newly created channel, it also removes a misleading reference to channel->session used to fetch call pickup configuraion. ASTERISK-29240 Change-Id: I90c9bbbed01f5d8863585631a29322ae4e046755
This commit is contained in:
committed by
George Joseph
parent
134d2e729d
commit
f2aa6c7017
@@ -3733,7 +3733,7 @@ static enum sip_get_destination_result get_destination(struct ast_sip_session *s
|
||||
*/
|
||||
AST_SIP_USER_OPTIONS_TRUNCATE_CHECK(session->exten);
|
||||
|
||||
pickup_cfg = ast_get_chan_features_pickup_config(session->channel);
|
||||
pickup_cfg = ast_get_chan_features_pickup_config(NULL); /* session->channel doesn't exist yet, using NULL */
|
||||
if (!pickup_cfg) {
|
||||
ast_log(LOG_ERROR, "%s: Unable to retrieve pickup configuration options. Unable to detect call pickup extension\n",
|
||||
ast_sip_session_get_name(session));
|
||||
@@ -3745,12 +3745,6 @@ 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);
|
||||
|
||||
/*
|
||||
* Save off the INVITE Request-URI in case it is
|
||||
* needed: CHANNEL(pjsip,request_uri)
|
||||
|
Reference in New Issue
Block a user