Send variables sip trunk

Hi!

Can I send the variables set in the dialplan in the sip trunk to another asterisk server?

I would like to send the context variables 1, 2, 3 to the dial server on line 4.

Thank you.

exten => 1148412008,1,Set(MAX_LEN=300)
exten => 1148412008,2,Set(MAX_LAN=500)
exten => 1148412008,3,Set(STR=BRN)
exten => 1148412008,4,Dial(SIP/tvn/1000)

SIP has no standard way of doing that, but you could add custom headers, or could encode them in the request URI.

1 Like

Yes.

I do this with SipAddHeader

exten => s,n,SIPAddHeader(X-Asterisk-Switch-Channel: ${CHANNEL})
exten => s,n,SIPAddHeader(X-Asterisk-Switch-UniqueID: ${CDR(uniqueid)})

Then on the other machine I pull them off with

exten => s,n,Set(SwitchChannel=${SIP_HEADER(X-Asterisk-Switch-Channel)})

1 Like