Contact URI showing sip:asterisk@ipaddress

When i try to make call to header request will show “asterisk@ip address: port”
rather than contact number.
busy will be the status.

packet trace:–>
Contact: <sip:a<asterisk@1x.xx.xx.xxx:5060>
Contact URI: sip:asterisk@1x.xx.xx.xxx:5060
Contact URI User Part: asterisk
Contact URI Host Part: 1.xx.xx.xx
Contact URI Host Port: 5060

pjsip.conf

[mytrunk]
type=registration
transport=transport-udp
outbound_auth=mytrunk_auth
server_uri=sip:1x.xx.xx.xx
client_uri=sip:6xxx@1x.xx.xx.xx
contact_user=6xxx
retry_interval=60
forbidden_retry_interval=600
expiration=3600
line=yes
endpoint=mytrunk

[mytrunk_auth]
type=auth
auth_type=userpass
password=1234
username=6xxx
;realm=1x.xx.xx.xx

[mytrunk]
type=endpoint
transport=transport-udp
context=from-tata
disallow=all
allow=ulaw
outbound_auth=mytrunk_auth
aors=mytrunk
force_rport=yes
direct_media=no

[mytrunk]
type=aor
contact=sip:1x.xx.xx.xx

;[mytrunk]
;type=identify
;endpoint=mytrunk
;match=1x.xx.xx.xx

[tata]
type=endpoint
transport=transport-udp
context=from-tata
disallow=all
allow=ulaw
outbound_auth=tata_auth
;aors=tata
aors=mytrunk
force_rport=yes
direct_media=no

[tata_auth]
type=auth
auth_type=userpass
password=1234
username=6xxx
;realm=1x.xx.xx.xx

                  

extensions.conf

[from-tata]
exten =>6xxxx,1,Log(NOTICE, Bhaiyaji call aa raha hai ${CALLERID(all)} se)
        same => n,Set(CALLERID(num)=6xxxx)
        same => n,Dial(PJSIP/89xxxxx@tata)
        same => n,Hangup()

The user part of the Contact header, is completely opaque to any system except the one that generated it. The only purpose of the Contact header, in anything but registrations, is to provide a URI that will route back to the correct user agent.

There do seem to be a number of broken systems that read more into the Contact header than they are allowed to. I can’t remember if the previous threads came up with a workaround for this, but I’d suggest searching the forum to find those threads.

Although I haven’t used pjsip myself, the documentation appears to say that the contact_user is only used for registrations, and seems to be the equivalent of the callback address in chan_sip.

1 Like