简体   繁体   中英

Forwarding X Headers in Asterisk

We have a soft phone that's dialing out, on a SIP trunk, through our Asterisk server. The soft phone is sending X Headers that we want to send on to the destination. We see the headers coming into Asterisk, but not going out. Is there something we can do to forward the headers along to the destination?

Asterisk is no SIP proxy but a B2BUA. This actually means, that it is not forwarding the original request. The call from your softphone gets terminated on Asterisk. Asterisk starts a second call to the logical destination of your call and connects both calls together.

This is why on the outgoing call you don't have the headers you added on the incoming call. The outgoing call is initiated by Asterisk. If you want to add any headers from the incoming call, you manually have to to it like miken32 said:

    exten => _X.,n,SIPAddHeader(X-Foobar: ${SIP_HEADER(X-Foobar)})
    exten => _X.,n,Dial(SIP/${EXTEN})

Just tell your dialplan to pass them on; maybe something like this:

exten => _X.,n,SIPAddHeader(X-Foobar: ${SIP_HEADER(X-Foobar)})
exten => _X.,n,Dial(SIP/${EXTEN})

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM