[Asterisk-code-review] chan pjsip: Set the context and extension on the channel whe... (asterisk[master])
Joshua Colp
asteriskteam at digium.com
Thu Jun 11 19:11:47 CDT 2015
Joshua Colp has submitted this change and it was merged.
Change subject: chan_pjsip: Set the context and extension on the channel when created
......................................................................
chan_pjsip: Set the context and extension on the channel when created
Prior to this patch, chan_pjsip was failing to pass the endpoint's
context and the desired extension to the ast_channel_alloc_* routine.
This caused a new channel snapshot to be issued without a context and
extension, which can cause some reporting issues for users of AMI, CEL,
and other APIs. The channel driver would later set the context and
extension on the channel such that the channel would start in the
correct location in the dialplan, but the information reported in the
initial event would be incorrect.
This patch modifies the channel driver such that it now passes the
context and extension directly into the allocation routine. This
provides the information in the new channel snapshot published over
Stasis.
ASTERISK-25156 #close
Reported by: cloos
Change-Id: Ic6f8542836e596db8f662071d118e8f934fdf25e
---
M channels/chan_pjsip.c
1 file changed, 3 insertions(+), 3 deletions(-)
Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved; Verified
diff --git a/channels/chan_pjsip.c b/channels/chan_pjsip.c
index 14ba4a2..b44d3e0 100644
--- a/channels/chan_pjsip.c
+++ b/channels/chan_pjsip.c
@@ -388,7 +388,9 @@
chan = ast_channel_alloc_with_endpoint(1, state,
S_COR(session->id.number.valid, session->id.number.str, ""),
S_COR(session->id.name.valid, session->id.name.str, ""),
- session->endpoint->accountcode, "", "", assignedids, requestor, 0,
+ session->endpoint->accountcode,
+ exten, session->endpoint->context,
+ assignedids, requestor, 0,
session->endpoint->persistent, "PJSIP/%s-%08x",
ast_sorcery_object_get_id(session->endpoint),
(unsigned) ast_atomic_fetchadd_int((int *) &chan_idx, +1));
@@ -445,8 +447,6 @@
ast_party_id_copy(&ast_channel_caller(chan)->id, &session->id);
ast_party_id_copy(&ast_channel_caller(chan)->ani, &session->id);
- ast_channel_context_set(chan, session->endpoint->context);
- ast_channel_exten_set(chan, S_OR(exten, "s"));
ast_channel_priority_set(chan, 1);
ast_channel_callgroup_set(chan, session->endpoint->pickup.callgroup);
--
To view, visit https://gerrit.asterisk.org/647
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic6f8542836e596db8f662071d118e8f934fdf25e
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list