[Asterisk-code-review] Modified the PJSIP Transfer REFER behavior to include the Re... (asterisk[master])

Joshua Colp asteriskteam at digium.com
Thu Oct 1 09:34:47 CDT 2015


Joshua Colp has posted comments on this change.

Change subject: Modified the PJSIP Transfer REFER behavior to include the Referred-By header.
......................................................................


Patch Set 1:

(2 comments)

https://gerrit.asterisk.org/#/c/1149/1/channels/chan_pjsip.c
File channels/chan_pjsip.c:

Line 1459: 	ref_by_val = pbx_builtin_getvar_helper(session->channel, "SIPREFERREDBYHDR");
         : 	if (!ast_strlen_zero(ref_by_val)) {
         : 		hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(packet->pool, &ref_by, pj_cstr(&tmp2, ref_by_val));
         : 	} else {
         : 		hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(packet->pool, &ref_by, &session->inv_session->dlg->local.info_str);
         : 	}
         : 	pjsip_msg_add_hdr(packet->msg, hdr);
I think it would be better if we kept this kind of stuff self contained to the ast_sip_add_header function. It's one less place to update if need be and it's easier for novices to read/understanding what is going on.

As a result you'd need to copy the dialog local string out to a temporary buffer but that's minor.

I could be swayed otherwise though.


Line 1459: 	ref_by_val = pbx_builtin_getvar_helper(session->channel, "SIPREFERREDBYHDR");
         : 	if (!ast_strlen_zero(ref_by_val)) {
         : 		hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(packet->pool, &ref_by, pj_cstr(&tmp2, ref_by_val));
         : 	} else {
         : 		hdr = (pjsip_hdr*)pjsip_generic_string_hdr_create(packet->pool, &ref_by, &session->inv_session->dlg->local.info_str);
         : 	}
         : 	pjsip_msg_add_hdr(packet->msg, hdr);
> The res_pjsip_refer module currently has support for adding Referred-By but
After Dan experimented with this it's not actually possible, the session supplements aren't invoked as we have to use the PJSIP UA REFER support to do things (which includes sending the request).


-- 
To view, visit https://gerrit.asterisk.org/1149
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I3d17912ce548667edf53cb549e88a25475eda245
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Dan Cropp <dan at amtelco.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list