[asterisk-users] SIP-Header Pass-Through
Joshua Colp
jcolp at digium.com
Wed Aug 2 08:51:15 CDT 2017
On Wed, Aug 2, 2017, at 10:39 AM, Carsten Bock wrote:
> Hi,
>
> quick question:
> I need to pass-through some headers from the A-Leg to the B-Leg, which
> are connected using PJSIP.
> Currently I do the following:
>
> [handler]
> exten => addheader,1,GotoIf($["${ARG1}" == ""]?3)
> exten => addheader,2,Set(PJSIP_HEADER(add,Route)=${ARG1})
> exten => addheader,3,GotoIf($["${ARG2}" == ""]?5)
> exten => addheader,4,Set(PJSIP_HEADER(add,P-Charging-Vector)=${ARG2})
> exten => addheader,5,GotoIf($["${ARG3}" == ""]?7)
> exten => addheader,6,Set(PJSIP_HEADER(add,P-Visited-Network-ID)=${ARG3})
> exten => addheader,7,GotoIf($["${ARG4}" == ""]?9)
> exten => addheader,8,Set(PJSIP_HEADER(add,X-C-Params)=${ARG4})
> exten => addheader,9,GotoIf($["${ARG5}" == ""]?11)
> exten => addheader,10,Set(PJSIP_HEADER(add,X-URI)=${ARG5})
> exten => addheader,11,Return
>
> [pcscf1]
> exten =>
> _.,1,Dial(PJSIP/pcscf1/sip:${EXTEN}@${SIPDOMAIN},,b(handler^addheader^1,(${PJSIP_HEADER(read,Route)},${PJSIP_HEADER(read,P-Charging-Vector)},${PJSIP_HEADER(read,P-Visited-Network-ID)},${PJSIP_HEADER(read,X-C-Params)},${PJSIP_HEADER(read,X-URI)})))
>
> This works, but you'll have to admit, it's not the most
> readable-Version of an extensions.conf.
>
> Are there any better solutions around?
Not really.
>
> Thanks,
> Carsten
>
> P.S.: I may have found an issue in Asterisk 13.x (LTS); if I send the
> right SIP-Message I can make it crash. I'm currently verifying, if it
> still happens with the latest 13.x release from GIT. If I can confirm
> it with the latest 13.x from GIT, should I post my findings to the
> dev-list or is there some security mailing list, as this would apply
> to all installations around there?
The process for reporting security vulnerabilities is documented on the
wiki[1].
[1]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+Security+Vulnerabilities
--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org
More information about the asterisk-users
mailing list