Asterisk 12

VoIP TK Anlage, PBX Software

PJSIP_HEADER() asterisk Beispiele

Beispiele:

 

Set 'somevar' to the value of the 'To' header.
exten => 1,1,Set(somevar=PJSIP_HEADER(read,To))
Set 'somevar' to the value of the 'From' header. 
exten => 1,1,Set(somevar=PJSIP_HEADER(read,From))
Set 'via2' to the value of the 2nd 'Via' header.
exten => 1,1,Set(via2=PJSIP_HEADER(read,Via,2))
Add an 'X-Myheader' header with the value of 'myvalue'.
exten => 1,1,Set(PJSIP_HEADER(add,X-MyHeader)=myvalue)
Add an 'X-Myheader' header with an empty value.
exten => 1,1,Set(PJSIP_HEADER(add,X-MyHeader)=)
Update the value of the header named 'X-Myheader' to 'newvalue'.
!!! 'X-Myheader' must already exist or the call will fail !!!
exten => 1,1,Set(PJSIP_HEADER(update,X-MyHeader)=newvalue)
Remove all headers whose names exactly match 'X-MyHeader'.
exten => 1,1,PJSIP_HEADER(remove,X-MyHeader)
Remove all headers that begin with 'X-My'.
exten => 1,1,PJSIP_HEADER(remove,X-My*)
Remove all previously added headers.
exten => 1,1,PJSIP_HEADER(remove,*)
Quelle:
https://reviewboard.asterisk.org/r/2858/diff/3/

 

sipgate und asterisk pjsip.conf

 

pjsip.conf Beispiel …

[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0:5060

 

[sipgatetrunk]
type=registration
transport=transport-udp
outbound_auth=sipgatetrunk_auth
server_uri=sip:sipgate.de
client_uri=sip:dein_sipgate_accountname@sipgate.de
contact_user=7000 ; auf den App. 7000 wird es dann klingeln
retry_interval=60
forbidden_retry_interval=600
expiration=3600

 

[sipgatetrunk_auth]
type=auth
auth_type=userpass
password=dein_sipgate_passwort
username=dein_sipgate_accountname

 

[sipgatetrunk]
type=aor
contact=sip:sipgate.de:5060

 

[sipgatetrunk]
type=endpoint
transport=transport-udp
context=from-external
disallow=all
allow=alaw
from_domain=sipgate.de
;;;; nicht einschalten !!! from_user=dein_sipgate_accountname !!! wird mit Set(CALLERID(num)=dein_sipgate_accountname im dialplan uebergeben
outbound_auth=sipgatetrunk_auth
aors=sipgatetrunk

 

[sipgatetrunk]
type=identify
endpoint=sipgatetrunk
match=sipgate.de

 

extensions.conf
Beispiel für outgoing ...
exten => _XXXXX.,1,Set(CALLERID(name)=deine_callerID)
exten => _XXXXX.,n,Set(CALLERID(num)=dein_sipgate_accountname) ; !!!!!!!!!!!!!!
exten => _XXXXX.,n,Dial(PJSIP/${EXTEN}@sipgatetrunk)

Asterisk 12