[asterisk-users] Setting PJSIP header from AMI

Joshua C. Colp jcolp at sangoma.com
Mon Apr 10 18:35:25 CDT 2023


On Mon, Apr 10, 2023 at 8:25 PM Alex Zarubin <alex at teletownhall.com> wrote:

> Hello,
>
>
>
> We are moving from an older asterisk/SIP to a newer (18+) asterisk/PJSIP
> and trying to figure out how to add [identity] header when originating a
> call from AMI/PAMI.
>
> In the older version we would just set a variable like this:
>
>
>
> $action = new OriginateAction("SIP/….”);
>
> $action->setVariable('__SIPADDHEADER51',"Identity:
> $identity");              // $identity contains generated by 3rd party
> header
>
>
>
> Is there anything similar for
>
>
>
> $action = new OriginateAction("PJSIP/….”);
>
> ???
>
>
>
> that would work for PJSIP?
>

Yes, the PJSIP_HEADER dialplan function[1].

[1]
https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_PJSIP_HEADER

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and www.asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20230410/e936c089/attachment.html>


More information about the asterisk-users mailing list