PJSIP: 481 Call/Transaction Does Not Exist (only) For MESSAGE Method

Home » Asterisk Users » PJSIP: 481 Call/Transaction Does Not Exist (only) For MESSAGE Method
Asterisk Users 1 Comment

I have a PJSIP trunk set up which works fine for voice. I can call out and I receive calls from it once it registers.

What isn’t working though is receiving MESSAGE (i.e. SIP SIMPLE)
events. It was working earlier today but I seem to have done something as I was enabling voice on the trunk to mess it up. On receiving of a MESSAGE, my Asterisk sends a 401 for the ITSP to authenticate it’s message, which it does, to which my Asterisk responds with a “481
Call/Transaction Does Not Exist” and displays nothing at all in the console.

The configuration of the ITSP is:

[trunk]
type=registration transport=transport-udp outbound_auth=trunk-auth server_uri=sip:itsp.example.com client_uri=sip:userid@itsp.example.com

[trunk-auth]
type=auth auth_type=userpass password=********
username=userid

[trunk-endpoint](!)
type=endpoint transport=transport-udp context=from-trunk message_context=messages disallow=all allow=ulaw from_user=userid outbound_auth=trunk-auth auth=trunk-auth send_pai=yes

[trunk-aor](!)
type=aor qualify_frequency=15

[trunk-foo](trunk-endpoint)
aors=trunk-foo
[trunk-foo](trunk-aor)
contact=sip:userid@itsp.example.com:5060

[trunk-foo]
type=identify endpoint=trunk-foo match=itsp.example.com

The SIP conversation when the ITSP is trying to send the MESSAGE:

<--- Received SIP request (456 bytes) from UDP:10.0.0.1:5060 --->
MESSAGE sip:s@10.75.22.8:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK51d6d4da;rport Max-Forwards: 70
From: “5555551212” ;tag=as6c34cb69
To:
Contact:
Call-ID: 3e9735b4313e58f90b4b61c82f392c2e@10.0.0.1:5060
CSeq: 102 MESSAGE
User-Agent: itsp.example.com X-SMS-To: 5551234567
Content-Type: text/plain;charset=UTF-8
Content-Length: 1

test message
<--- Transmitting SIP response (515 bytes) to UDP:10.0.0.1:5060 --->
SIP/2.0 401 Unauthorized Via: SIP/2.0/UDP 10.0.0.1:5060;rport=5060;received=10.0.0.1;branch=z9hG4bK51d6d4da Call-ID: 3e9735b4313e58f90b4b61c82f392c2e@10.0.0.1:5060
From: “5555551212” ;tag=as6c34cb69
To: ;tag=z9hG4bK51d6d4da CSeq: 102 MESSAGE
WWW-Authenticate: Digest realm=”asterisk”,nonce=”1550441754/[redacted]”,opaque=”2c504a1035f74a1d”,algorithm=md5,qop=”auth”
Server: Asterisk PBX 13.25.0
Content-Length: 0

<--- Received SIP request (707 bytes) from UDP:10.0.0.1:5060 --->
MESSAGE sip:s@10.75.22.8:5060 SIP/2.0
Via: SIP/2.0/UDP 10.0.0.1:5060;branch=z9hG4bK516e2ba7;rport Max-Forwards: 70
From: “5555551212” ;tag=as6c34cb69
To: ;tag=z9hG4bK51d6d4da Call-ID: 3e9735b4313e58f90b4b61c82f392c2e@10.0.0.1:5060
CSeq: 103 MESSAGE
User-Agent: itsp.example.com Proxy-Authorization: Digest username=”userid”, realm=”asterisk”, algorithm=MD5, uri=”sip:s@172.1.2.3:5060″, nonce=”1550441754/[redacted]”, response=”[redacted]”, opaque=”2c504a1035f74a1d”, qop=auth, cnonce=”544772bb”, nc=00000002
X-SMS-To: 5551234567
Content-Type: text/plain;charset=UTF-8
Content-Length: 1

c
<--- Transmitting SIP response (388 bytes) to UDP:10.0.0.1:5060 --->
SIP/2.0 481 Call/Transaction Does Not Exist Via: SIP/2.0/UDP 10.0.0.1:5060;rport=5060;received=10.0.0.1;branch=z9hG4bK516e2ba7
Call-ID: 3e9735b4313e58f90b4b61c82f392c2e@10.0.0.1:5060
From: “5555551212” ;tag=as6c34cb69
To: ;tag=z9hG4bK51d6d4da CSeq: 103 MESSAGE
Server: Asterisk PBX 13.25.0
Content-Length: 0

I couldn’t find any solutions to a 481 in response to a MESSAGE after much searching.

I know MESSAGE does work, as I had it working earlier today. I just seemed to have messed it up adding the additional configuration to the trunk to support incoming and outgoing calls.

Any ideas?

Cheers, b.

One thought on - PJSIP: 481 Call/Transaction Does Not Exist (only) For MESSAGE Method