[asterisk-users] SIP-Header Pass-Through

Carsten Bock carsten at ng-voice.com
Wed Aug 2 08:39:47 CDT 2017


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?

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?

-- 
Carsten Bock
CEO (Geschäftsführer)

ng-voice GmbH
Millerntorplatz 1
20359 Hamburg / Germany

http://www.ng-voice.com
mailto:carsten at ng-voice.com

Office +49 40 5247593-40
Fax +49 40 5247593-99

Sitz der Gesellschaft: Hamburg
Registergericht: Amtsgericht Hamburg, HRB 120189
Geschäftsführer: Carsten Bock
Ust-ID: DE279344284

Hier finden Sie unsere handelsrechtlichen Pflichtangaben:
http://www.ng-voice.com/imprint/



More information about the asterisk-users mailing list