Re: Kamailio + Asterisk: MESSAGE Routing Issue (483 Too Many Hops)

Sergio Charrua via sr-users <[email protected]>
Newsgroups gmane.comp.voip.ser
Message-ID <CALZWR5x9HeG3cqKkbQw=9KGhVmyZSvdj9JM-Tw4CEv96dkbYLA@mail.gmail.com>
my bet goes to the Request URI, not the CSeq, reason why Kamailio is very
likely looping it back to itself until Max-Forwards hits 0 ==> 483 Too Many
Hops.

As far as remember, routing of MESSAGE is based on the Request-URI (R-URI),
not To/From. I think the CSeq mismatch is irrelevant here because these are
out-of-dialog MESSAGEs (no To tag), so each transaction has its own CSeq.

Atenciosamente / Kind Regards / Cordialement / Un saludo,


*Sérgio Charrua*

On Mon, Aug 25, 2025 at 4:05 PM Fernando Lopes via sr-users <
[email protected]> wrote:

> Hello everyone,
>
> I’m having some problems routing a MESSAGE from Asterisk to a WebRTC
> client. Regular calls work fine, but MESSAGE handling is failing.
> Kamailio: 10.5.0.8
> Asterisk: 10.5.0.2
>
> I suspect the problem could be one of two things:
> ->The CSeq values don’t match (CSeq: 2 MESSAGE vs CSeq: 49306 MESSAGE).
> ->The To and From headers might be preventing Kamailio from knowing where
> to send the reply.
> Has anyone seen this behavior before? Any suggestions on how to correctly
> route MESSAGEs through Kamailio to WebRTC clients?
>
> Here are some logs:
> MESSAGE sip:[email protected] SIP/2.0
> Transport: udp
> Record-Route: <sip:172.31.217.74:5001;r2=on;lr;ftag=124pqf5crm;nat=yes>
> Record-Route: <sip:172.31.217.74:8087
> ;transport=ws;r2=on;lr;ftag=124pqf5crm;nat=yes>
> Via: SIP/2.0/UDP 172.31.217.74:5001
> ;branch=z9hG4bK43b3.e83a57badbec3df404fc69a3c7f0e666.0
> Via: SIP/2.0/WSS
> ip9sqfgevvko.invalid;rport=59806;received=172.31.208.1;branch=z9hG4bK324262
> To: <sip:[email protected]>
> From: "916c67e8-652f-49ea-b288-2bbbee8dbf21" <sip:[email protected]
> >;tag=124pqf5crm
> CSeq: 2 MESSAGE
> Call-ID: s1djti0r9egfcvi1n4aa
> Max-Forwards: 69
> Authorization: Digest algorithm=MD5, username="User1", realm="xxxxx",
> nonce="1756131542/ed3931083af68713eb56098000b661ec", uri="
> sip:[email protected]", response="3a474fc4f735e602a7b1940d0c9da564",
> opaque="10b0b5293ff53cc5", qop=auth, cnonce="0reui7po4gfn", nc=00000001
> Supported: outbound
> User-Agent: SIP.js/0.21.1
> Content-Type: text/plain
> Content-Length: 68
>
> {"message":"ola","sessionId":"feff3811-f3b4-4dd7-8125-af9fe80dd523"}
>
> Some log from asterisk: pjsip:User1/sip:916c67e8-652f-
> [email protected]:5001;x-ast;transport=udp,"MaxTalk" <
> sip:[email protected]>,"ChatApp xxxxx"
> <sip:[email protected]:5001;x-ast>"
>
> <--- Transmitting SIP request (687 bytes) to UDP:10.5.0.8:5001 --->
> MESSAGE sip:[email protected]:5001;transport=udp;x-ast
> SIP/2.0
> Via: SIP/2.0/UDP 10.5.0.2:4040
> ;rport;branch=z9hG4bKPj782df7e5-c4b7-4f74-98ff-611d39069cc5
> From: "MaxTalk" <sip:[email protected]
> >;tag=645539f3-3177-436a-88f6-ac7f64735fd4
> To: "ChatApp xxxxx" <sip:[email protected]
> ;x-ast>
> Contact: <sip:[email protected]:4040>
> Call-ID: 2af343eb-67f5-4458-ba07-37b830169ec7
> CSeq: 49306 MESSAGE
> Max-Forwards: 70
> User-Agent: Asterisk PBX 18.24.3
> Content-Type: text/plain
> Content-Length:   138
>
> Olá! Como posso ajudar-te hoje? Se tiveres alguma dúvida sobre a
> plataforma da xxxxx ou qualquer outra questão, estou aqui para ajudar.
> <--- Received SIP response (476 bytes) from UDP:10.5.0.8:5001 --->
> SIP/2.0 483 Too Many Hops
> Via: SIP/2.0/UDP 10.5.0.2:4040
> ;received=10.5.0.2;rport=4040;branch=z9hG4bKPj782df7e5-c4b7-4f74-98ff-611d39069cc5
> From: "MaxTalk" <sip:[email protected]
> >;tag=645539f3-3177-436a-88f6-ac7f64735fd4
> To: "ChatApp xxxxx" <sip:[email protected]
> ;x-ast>;tag=19162a7003f0e5d10acb0ff84f0e52ca.11182266
> Call-ID: 2af343eb-67f5-4458-ba07-37b830169ec7
> CSeq: 49306 MESSAGE
> Server: kamailio (5.7.6 (x86_64/linux))
> Content-Length: 0
>
> Thank you.
> __________________________________________________________
> Kamailio - Users Mailing List - Non Commercial Discussions --
> [email protected]
> To unsubscribe send an email to [email protected]
> Important: keep the mailing list in the recipients, do not reply only to
> the sender!
>

__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions -- [email protected]
To unsubscribe send an email to [email protected]
Important: keep the mailing list in the recipients, do not reply only to the sender!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.