SIP Headers

SIP Header Requirements

Team Compute requires the use of up to four SIP variables:

  • From Header
    The original caller's number, if NO forwarding otherwise it is the forwarder's number.
    ANI variable in Asterisk

  • P-Asserted-Identity
    The TRUE original caller's number to the destination, even if the "From" header is changed.
    ANI variable in Asterisk

  • Diversion Header
    This header tells the receiving party that the call was redirected/forwarded and contains the number of the person who forwarded the call.
    RDNIS variable in Asterisk.

  • To Header
    The final destination number (the person being forwarded to).
    DNIS variable in Asterisk.

Asterisk

From

Read pjsip

exten => s,n,Set(RAW_FROM=${PJSIP_HEADER(read,From)})

Read chan_sip

exten => s,n,Set(RAW_FROM=${SIP_HEADER(From)})

P-Asserted-Identity

Read pjsip

exten => s,n,Set(MY_PAI_HEADER=${PJSIP_HEADER(read,P-Asserted-Identity)}

Read chan_sip

exten => s,n,Set(MY_PAI_HEADER=${SIP_HEADER(P-Asserted-Identity)})

Write pjsip

same => n,Set(PJSIP_HEADER(add,P-Asserted-Identity)=<sip:123456789@yourdomain.com>)

Write chan_sip

same => n,SipAddHeader(P-Asserted-Identity: <sip:123456789@yourdomain.com>)