Webrtc: Unsupported transport (PJSIP_EUNSUPTRANSPORT)' sending MESSAGE request to endpoint

Hello everyone,

I’m running into some issues with WebRTC messaging. I have Kamailio set up as the entry point for Asterisk, and both are running in the same network.

  • When I connect directly to Asterisk, I can both make calls and send messages via WebRTC without any problems.

  • However, when I connect through Kamailio, I can make WebRTC calls, but messages fail. Asterisk receives the MESSAGE requests, but I get the following error:

Unsupported transport (PJSIP_EUNSUPTRANSPORT) sending MESSAGE request to endpoint User1

Here are my transports:

Transport:  tls_transport        tls   0  0  0.0.0.0:5061
Transport:  transport-tcp-nat    tcp   0  0  0.0.0.0:5060
Transport:  transport-udp        udp   0  0  0.0.0.0:4040
Transport:  transport-udp-nat    udp   0  0  0.0.0.0:5060
Transport:  wss_transport        wss   0  0  0.0.0.0:8089

And my endpoint looks like this:

Endpoint:  User1/1000
  InAuth:  User1/User1
  Aor:     User1
  Contacts:
    User1/sip:916c67e8-652f-49ea-b288-2bbbee8d...  Avail
    User1/sip:916c67e8-652f-49ea-b288-2bbbee8d...  Avail
    User1/sip:916c67e8-652f-49ea-b288-2bbbee8d...  Avail
Transport: wss_transport  wss   0  0  0.0.0.0:8089

I’m currently dispatching SIP traffic to port 5060. I also tried 8089, but that didn’t work either.
Has anyone faced this before, or can point me in the right direction? Thanks!

Don’t specify a transport on the endpoint. There is no need to.

You also need to provide more information, like showing the actual console output when you try to send a message.

<--- Received SIP request (1015 bytes) from UDP:10.5.0.8:5001 --->
MESSAGE sip:7@172.31.217.74 SIP/2.0
Record-Route: <sip:172.31.217.74:5001;r2=on;lr;ftag=h0d9s4gjm8>
Record-Route: <sip:172.31.217.74:8087;transport=ws;r2=on;lr;ftag=h0d9s4gjm8>
Via: SIP/2.0/UDP 172.31.217.74:5001;branch=z9hG4bK60e6.820f36a5ba5e13d2be9a9053006aa844.0
Via: SIP/2.0/WSS ik55c4nnaspa.invalid;rport=63629;received=172.31.208.1;branch=z9hG4bK3991568
To: <sip:7@172.31.217.74>
From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:User1@172.31.217.74>;tag=h0d9s4gjm8
CSeq: 2 MESSAGE
Call-ID: u65ih0frd4n788i1lkr8
Max-Forwards: 69
Authorization: Digest algorithm=MD5, username="User1", realm="xxxxxx", nonce="1755968581/cc1d82c904a7d4d7d95b14950a5cfc16", uri="sip:7@172.31.217.74", response="7ad0e1d8a0276674b72551d473aaac75", opaque="4dcac15a54a6303d", qop=auth, cnonce="eon73tk8vfk8", nc=00000001
Supported: outbound
User-Agent: SIP.js/0.21.1
Content-Type: text/plain
Content-Length: 71

{"message":"Hello.","sessionId":"19cb09c0-3cfa-4418-9652-36a613ab13da"}
<--- Transmitting SIP response (640 bytes) to UDP:10.5.0.8:5001 --->
SIP/2.0 202 Accepted
Via: SIP/2.0/UDP 172.31.217.74:5001;rport=5001;received=10.5.0.8;branch=z9hG4bK60e6.820f36a5ba5e13d2be9a9053006aa844.0
Via: SIP/2.0/WSS ik55c4nnaspa.invalid;rport=63629;received=172.31.208.1;branch=z9hG4bK3991568
Record-Route: <sip:10.5.0.8:5001;lr;r2=on;ftag=h0d9s4gjm8>
Record-Route: <sip:172.31.217.74:8087;transport=ws;lr;r2=on;ftag=h0d9s4gjm8>
Call-ID: u65ih0frd4n788i1lkr8
From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:User1@172.31.217.74>;tag=h0d9s4gjm8
To: <sip:7@172.31.217.74>;tag=z9hG4bK60e6.820f36a5ba5e13d2be9a9053006aa844.0
CSeq: 2 MESSAGE
Server: Asterisk PBX 18.24.3
Content-Length:  0


    -- Executing [7@textmessages:1] Gosub("Message/ast_msg_queue", "bot-text,s,1,("SOMETHING_HELPER",7)") in new stack
    -- Executing [s@bot-text:1] NoOp("Message/ast_msg_queue", "Sending Text To: "SOMETHING_HELPER"") in new stack
    -- Executing [s@bot-text:2] Verbose("Message/ast_msg_queue", "1, "ARG2:" 7") in new stack
  "ARG2:" 7
    -- Executing [s@bot-text:3] Set("Message/ast_msg_queue", "PREFIX="916c67e8-652f-49ea-b288-2bbbee8dbf21"") in new stack
    -- Executing [s@bot-text:4] Set("Message/ast_msg_queue", "PREFIX=916c67e8-652f-49ea-b288-2bbbee8dbf21"") in new stack
    -- Executing [s@bot-text:5] Set("Message/ast_msg_queue", "PREFIX=916c67e8-652f-49ea-b288-2bbbee8dbf21") in new stack
    -- Executing [s@bot-text:6] Set("Message/ast_msg_queue", "json={"message":"Hello.","sessionId":"19cb09c0-3cfa-4418-9652-36a613ab13da"}") in new stack
    -- Executing [s@bot-text:7] Set("Message/ast_msg_queue", "messageText=Hello.") in new stack
    -- Executing [s@bot-text:8] Set("Message/ast_msg_queue", "CALL_ID=19cb09c0-3cfa-4418-9652-36a613ab13da") in new stack
    -- Executing [s@bot-text:9] Set("Message/ast_msg_queue", "RAW_CONTACTS=PJSIP/User1/sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast-orig-host=ik55c4nnaspa.invalid:0") in new stack
    -- Executing [s@bot-text:10] Set("Message/ast_msg_queue", "CURRENT_INDEX=0") in new stack
    -- Executing [s@bot-text:11] Set("Message/ast_msg_queue", "TOTAL_CONTACTS=100") in new stack
[2025-08-23 18:03:01.507] WARNING[73][C-00000002]: func_cut.c:224 cut_internal: We're already past the field you wanted?
    -- Executing [s@bot-text:12] Set("Message/ast_msg_queue", "CONTACT=") in new stack
    -- Executing [s@bot-text:13] ExecIf("Message/ast_msg_queue", "0?Goto(found)") in new stack
    -- Executing [s@bot-text:14] Set("Message/ast_msg_queue", "CURRENT_INDEX=1") in new stack
    -- Executing [s@bot-text:15] GotoIf("Message/ast_msg_queue", "1?loop") in new stack
    -- Goto (bot-text,s,12)
    -- Executing [s@bot-text:12] Set("Message/ast_msg_queue", "CONTACT=PJSIP/User1/sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast-orig-host=ik55c4nnaspa.invalid:0") in new stack  
    -- Executing [s@bot-text:13] ExecIf("Message/ast_msg_queue", "1?Goto(found)") in new stack
    -- Goto (bot-text,s,18)
    -- Executing [s@bot-text:18] NoOp("Message/ast_msg_queue", "Contact com prefixo encontrado: PJSIP/User1/sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast-orig-host=ik55c4nnaspa.invalid:0") in new stack
    -- Executing [s@bot-text:19] Set("Message/ast_msg_queue", "PORT=PJSIP/User1/sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast-orig-host=ik55c4nnaspa.invalid:0") in new stack     
    -- Executing [s@bot-text:20] NoOp("Message/ast_msg_queue", "End of Processing") in new stack
    -- Executing [s@bot-text:21] Set("Message/ast_msg_queue", "PORT=PJSIP/User1/sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast-orig-host") in new stack
    -- Executing [s@bot-text:22] Set("Message/ast_msg_queue", "PORT=10.5.0.8:5001;x-ast-orig-host") in new stack
    -- Executing [s@bot-text:23] Set("Message/ast_msg_queue", "PORT=10.5.0.8:5001;x-ast") in new stack
    -- Executing [s@bot-text:24] Set("Message/ast_msg_queue", "PEER=User1") in new stack
    -- Executing [s@bot-text:25] Set("Message/ast_msg_queue", "CALLER_ID=1000") in new stack
    -- Executing [s@bot-text:26] Set("Message/ast_msg_queue", "PROJECT_ID=DEAG9ce5495a33") in new stack
    -- Executing [s@bot-text:27] Set("Message/ast_msg_queue", "ORIGIN=webrtc-chatapp") in new stack
    -- Executing [s@bot-text:28] Set("Message/ast_msg_queue", "BOT_TYPE="SOMETHING_HELPER"") in new stack
    -- Executing [s@bot-text:29] Verbose("Message/ast_msg_queue", "1,Status is:  and Result is: ") in new stack
 Status is:  and Result is:
    -- Executing [s@bot-text:30] Set("Message/ast_msg_queue", "BOT_TEXT=Hello") in new stack
    -- Executing [s@bot-text:31] Set("Message/ast_msg_queue", "BOT_INFO=19cb09c0-3cfa-4418-9652-36a613ab13da`1000`Hello`"SOMETHING_HELPER"`DEAG9ce5495a33`webrtc-chatapp") in new stack
    -- Executing [s@bot-text:32] MRCPSMS("Message/ast_msg_queue", ""builtin:"19cb09c0-3cfa-4418-9652-36a613ab13da`1000`Hello`"SOMETHING_HELPER"`DEAG9ce5495a33`webrtc-chatapp,sit=0") in new stack

[2025-08-23 18:03:03.786] NOTICE[146]: src/mrcp_client_session.c:514  Raise App MRCP Event ASR-2 <6cec6bf7835e4064>
[2025-08-23 18:03:03.865] NOTICE[73][C-00000002]: app_message.c:444 sms_channel_get_results: (ASR-2) Result:

<?xml version="1.0"?>
<result>
  <interpretation confidence="99">
    <instance>Olá! Como posso ajudar-te hoje? Se tiveres alguma dúvida sobre a plataforma da SOMETHING ou qualquer outra questão, estou aqui para ajudar.</instance>
    <input mode="speech">Olá! Como posso ajudar-te hoje? Se tiveres alguma dúvida sobre a plataforma da SOMETHING ou qualquer outra questão, estou aqui para ajudar.</input>
  </interpretation>
</result>

[2025-08-23 18:03:03.867] NOTICE[146]: src/mrcp_client_session.c:385  Receive App Request ASR-2 <6cec6bf7835e4064> [1]
[2025-08-23 18:03:03.867] NOTICE[146]: src/mrcp_client_session.c:828  Terminate Session ASR-2 <6cec6bf7835e4064>
[2025-08-23 18:03:03.867] NOTICE[147]: src/mrcp_client_connection.c:480  Remove Control Channel <6cec6bf7835e4064@smspl> [0]
[2025-08-23 18:03:03.867] NOTICE[147]: src/mrcp_client_connection.c:407  Close TCP/MRCPv2 Connection 10.5.0.2:34864 <-> 10.5.0.4:1544
[2025-08-23 18:03:03.870] NOTICE[148]: src/mpf_rtp_stream.c:944  Close RTP Transmitter 10.5.0.2:10006 -> 10.5.0.4:10002 [s:0 o:0]
[2025-08-23 18:03:03.870] NOTICE[148]: src/mpf_rtp_stream.c:418  Remove RTP Session 10.5.0.2:10006
[2025-08-23 18:03:03.870] NOTICE[148]: src/mpf_rtp_stream.c:1218  Generate RTCP SR [ssrc:1267311786 s:0 o:0 ts:18640]
[2025-08-23 18:03:03.870] NOTICE[148]: src/mpf_rtp_stream.c:1405  Send Compound RTCP Packet [BYE] [72 bytes] 10.5.0.2:10007 -> 10.5.0.4:10003
[2025-08-23 18:03:03.875] NOTICE[149]: src/mrcp_sofiasip_client_agent.c:617  Receive SIP Event [nua_r_bye] Status 200 OK [speech-unimrcp-mrcp2]
[2025-08-23 18:03:03.875] NOTICE[149]: src/mrcp_sofiasip_client_agent.c:617  Receive SIP Event [nua_i_state] Status 200 to BYE [speech-unimrcp-mrcp2]
[2025-08-23 18:03:03.875] NOTICE[149]: src/mrcp_sofiasip_client_agent.c:555  SIP Call State ASR-2 [terminated]
[2025-08-23 18:03:03.876] NOTICE[146]: src/mrcp_client_session.c:207  Session Terminated ASR-2 <6cec6bf7835e4064>
[2025-08-23 18:03:03.876] NOTICE[146]: src/mrcp_client_connection.c:243  Destroy TCP/MRCPv2 Connection 10.5.0.2:34864 <-> 10.5.0.4:1544
[2025-08-23 18:03:03.876] NOTICE[146]: src/mrcp_client.c:707  Remove MRCP Handle ASR-2 <6cec6bf7835e4064>
[2025-08-23 18:03:03.876] NOTICE[146]: src/mrcp_client_session.c:453  Raise App Response ASR-2 <6cec6bf7835e4064> [1] SUCCESS [0]
[2025-08-23 18:03:03.876] NOTICE[146]: src/mrcp_application.c:211  Destroy MRCP Handle ASR-2
[2025-08-23 18:03:03.876] NOTICE[73][C-00000002]: app_message.c:1060 mrcpsms_exit: MRCPSMS() exiting status: OK on Message/ast_msg_queue
    -- Executing [s@bot-text:33] Set("Message/ast_msg_queue", "BOT_RESPONSE=Olá! Como posso ajudar-te hoje? Se tiveres alguma dúvida sobre a plataforma da SOMETHING ou qualquer outra questão, estou aqui para ajudar.") in new stack
    -- Executing [s@bot-text:34] Set("Message/ast_msg_queue", "MESSAGE(body)=Olá! Como posso ajudar-te hoje? Se tiveres alguma dúvida sobre a plataforma da SOMETHING ou qualquer outra questão, estou aqui para ajudar.") in new stack
    -- Executing [s@bot-text:35] Set("Message/ast_msg_queue", "aor=sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast") in new stack
    -- Executing [s@bot-text:36] MessageSend("Message/ast_msg_queue", "pjsip:User1/sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast;transport=ws,"MaxTalk" <sip:7@172.31.217.74>,"ChatApp SOMETHING" <sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast>") in new stack
[2025-08-23 18:03:03.879] ERROR[93]: res_pjsip.c:1769 endpt_send_request: Error 171060 'Unsupported transport (PJSIP_EUNSUPTRANSPORT)' sending MESSAGE request to endpoint User1

And the dialplan that actually determines all of this?

The underlying SIP trace would also be needed for registration.

In my extensions.conf I have this

[textmessages]
exten => 1,1,Gosub(bot-text,s,1,("XXX",1))
exten => 2,1,Gosub(bot-text,s,1,("XXX",2))
exten => 3,1,Gosub(bot-text,s,1,("XXX",3))
exten => 4,1,Gosub(bot-text,s,1,("XXX",4))
exten => 7,1,Gosub(bot-text,s,1,("SOMETHING_HELPER",7))
exten => 8,1,Gosub(bot-text,s,1,("XXX",8))
exten => e,1,Hangup()

[bot-text]
exten => s,1,NoOp(Sending Text To: ${ARG1})

same => n,Verbose(1, "ARG2:" ${ARG2})

;User Prefix(instanceId)
same => n,Set(PREFIX=${CUT(MESSAGE(from), ,1)})
same => n,Set(PREFIX=${PREFIX:1})
same => n,Set(PREFIX=${PREFIX:0:-1})

;Parsificar o JSON para variaveis (CallId e message)
same => n,Set(json=${MESSAGE(body)})
same => n,Set(messageText=${SHELL(echo '${json}' | sed -E 's/.*"message":"([^"]*)".*$/\1/' | tr -d '\n')})
same => n,Set(CALL_ID=${SHELL(echo '${json}' | sed -E 's/.*"sessionId":"([^"]*)".*$/\1/' | tr -d '\n')})

; Search endpoint from contacts list
same => n,Set(RAW_CONTACTS=${PJSIP_DIAL_CONTACTS(User1)})
same => n,Set(CURRENT_INDEX=0)
same => n,Set(TOTAL_CONTACTS=100)
same => n(loop),Set(CONTACT=${CUT(RAW_CONTACTS,&,${CURRENT_INDEX})})
same => n,ExecIf($[${REGEX("${PREFIX}" ${CONTACT})}]?Goto(found))
same => n,Set(CURRENT_INDEX=$[${CURRENT_INDEX} + 1])
same => n,GotoIf($[${CURRENT_INDEX} <= ${TOTAL_CONTACTS}]?loop)
same => n,NoOp(No contact with prefix '${PREFIX}' found)
same => n,Goto(end)
same => n(found),NoOp(Contact with prefix found: ${CONTACT})
same => n,Set(PORT=${CONTACT})
same => n(end),NoOp(End of Processing)
same => n,Set(PORT=${CUT(PORT,=,1)})
same => n,Set(PORT=${CUT(PORT,@,2)})
same => n,Set(PORT=${PORT:0:-10})

;Identify User
same => n,Set(PEER=${CUT(CUT(CUT(MESSAGE(from),@,1),<,2),:,2)})
same => n,Set(CALLER_ID=1000)
same => n,Set(PROJECT_ID=${PJSIP_ENDPOINT(${PEER},PROJECT_ID)})
same => n,Set(ORIGIN=${PJSIP_ENDPOINT(${PEER},ORIGIN)})

;Response
same => n,Set(BOT_TYPE=${ARG1})
same => n,Verbose(1,Status is: ${RECOGSTATUS} and Result is: ${RECOG_RESULT})
same => n,Set(BOT_TEXT=${FILTER(0-9a-zA-ZáéíóúàèìòùâêîôûäëïöüãõñçÁÉÍÓÚÀÈÌÒÙÂÊÎÔÛÄËÏÖÜÃÕÑÇ!?/:\-" ",${messageText})}) ; Remove commas
same => n,Set(BOT_INFO=${CALL_ID}`${CALLER_ID}`${BOT_TEXT}`${BOT_TYPE}`${PROJECT_ID}`${ORIGIN})
same => n,MRCPSMS("builtin:"${BOT_INFO},sit=0)
same => n,Set(BOT_RESPONSE=${RECOG_INSTANCE(0/0)})
same => n,Set(MESSAGE(body)=${BOT_RESPONSE})

;Send message to contact
same => n,Set(aor=sip:${PREFIX}@${PORT})
same => n(sendmsg),MessageSend(pjsip:${PEER}/${aor}\;transport=ws,"MaxTalk" <sip:${ARG2}@{{ LOCAL_IP }}>,"ChatApp SOMETHING" <${aor}>)

As for Register I have this log from asterisk:

<--- Received SIP request (951 bytes) from UDP:10.5.0.8:5001 --->
REGISTER sip:172.31.217.74 SIP/2.0
Via: SIP/2.0/UDP 172.31.217.74:5001;branch=z9hG4bKa58c.55dc30705be2644691374b766ce25dc4.0
Via: SIP/2.0/WSS 1usljh51qna4.invalid;rport=54164;received=172.31.208.1;branch=z9hG4bK1816823
To: <sip:User1@172.31.217.74>
From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:User1@172.31.217.74>;tag=lrslhbq44l
CSeq: 3 REGISTER
Call-ID: 41695052jpqp3aapj2n2
Max-Forwards: 69
Authorization: Digest algorithm=MD5, username="User1", realm="XXX-XXX-XXX.XXX.net", nonce="1755983591/e275352551286b5d6a64751ac6569188", uri="sip:172.31.217.74", response="eff5c2367fc5f0c431c0d97525f10995", opaque="4386bc7653ea7ef5", qop=auth, cnonce="05bmakm30qfg", nc=00000001
Contact: <sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@1usljh51qna4.invalid;transport=ws>;expires=600
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound, path, gruu
User-Agent: SIP.js/0.21.1
Content-Length: 0

-- Added contact 'sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@10.5.0.8:5001;x-ast-orig-host=1usljh51qna4.invalid:0' to AOR 'User1' with expiration of 600 seconds

<--- Transmitting SIP response (624 bytes) to UDP:10.5.0.8:5001 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 172.31.217.74:5001;rport=5001;received=10.5.0.8;branch=z9hG4bKa58c.55dc30705be2644691374b766ce25dc4.0
Via: SIP/2.0/WSS 1usljh51qna4.invalid;rport=54164;received=172.31.208.1;branch=z9hG4bK1816823
Call-ID: 41695052jpqp3aapj2n2
From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:User1@172.31.217.74>;tag=lrslhbq44l
To: <sip:User1@172.31.217.74>;tag=z9hG4bKa58c.55dc30705be2644691374b766ce25dc4.0
CSeq: 3 REGISTER
Date: Sat, 23 Aug 2025 21:13:11 GMT
Contact: <sip:916c67e8-652f-49ea-b288-2bbbee8dbf21@1usljh51qna4.invalid>;expires=599
Server: Asterisk PBX 18.24.3
Content-Length:  0

Problem is Protocol being used, changed to UDP

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.