Dear List,
I’m trying to set up the dialog module and I keep getting the error "bad sip message or missing Contact hdr”:
--- Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:219]: populate_leg_info(): bad sip message or missing Contact hdr Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:952]: dlg_new_dialog(): could not add further info to the dialog ---
This is for MRCP traffic and the SIP INVITEs do not contain the Contact header. They look like this:
---- INVITE sip:some.mrcp.server.example.com:8060 SIP/2.0 Via: SIP/2.0/TCP 10.10.10.10:5099;branch=z9hG4bK5Kpey3r13SBNQ Max-Forwards: 70 From: sip:10.10.10.10:5099;tag=134a3eKD2a8Ua To: sip:some.mrcp.server.example.com:8060 Call-ID: 051df0ff-3541-123d-f090-02f373ff014c CSeq: 78491159 INVITE User-Agent: google_stt Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE Supported: timer, 100rel Content-Type: application/sdp Content-Disposition: session Content-Length: 329
v=0 o=FreeSWITCH 2474358185109188492 5282339568667506935 IN IP4 10.10.10.10 s=- c=IN IP4 10.10.10.10 t=0 0 m=application 9 TCP/MRCPv2 1 a=setup:active a=connection:new a=resource:speechrecog a=cmid:1 m=audio 12034 RTP/AVP 0 8 96 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:96 L16/8000 a=sendonly a=mid:1 ----
According to the RFC, the Contact header is not mandatory (https://datatracker.ietf.org/doc/html/rfc3261#section-8.1.1) and I don’t have an easy way of adding the Contact header to the INVITEs. Is there a way to configure Kamailio’s dialog module to do without the Contact header? Any pointers appreciated.
Thank you so much
With best wishes, Unai Rodriguez
Hi Unai,
The CONTACT is used as the R-URI in subsequent replies so upstream providers parse this from my experience.
You can build one yourself in Kamailio if needed using the textops module - https://kamailio.org/docs/modules/5.7.x/modules/textops.html#textops.f.appen...
Rough examples: Native: insert_hf("Contact: $fu\r\n");
Kemi Python: KSR.textopsx.append_hf_value("Contact", "<sip:" + KSR.pv.get("$fU") + "@" + KSR.pv.get("$si") + ":5060>")
Thanks,
John.
On Wed, 24 Jan 2024 at 11:15, Unai Rodriguez via sr-users < sr-users@lists.kamailio.org> wrote:
Dear List,
I’m trying to set up the dialog module and I keep getting the error "bad sip message or missing Contact hdr”:
Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:219]: populate_leg_info(): bad sip message or missing Contact hdr Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:952]: dlg_new_dialog(): could not add further info to the dialog
This is for MRCP traffic and the SIP INVITEs do not contain the Contact header. They look like this:
INVITE sip:some.mrcp.server.example.com:8060 SIP/2.0 Via: SIP/2.0/TCP 10.10.10.10:5099;branch=z9hG4bK5Kpey3r13SBNQ Max-Forwards: 70 From: sip:10.10.10.10:5099;tag=134a3eKD2a8Ua To: sip:some.mrcp.server.example.com:8060 Call-ID: 051df0ff-3541-123d-f090-02f373ff014c CSeq: 78491159 INVITE User-Agent: google_stt Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE Supported: timer, 100rel Content-Type: application/sdp Content-Disposition: session Content-Length: 329
v=0 o=FreeSWITCH 2474358185109188492 5282339568667506935 IN IP4 10.10.10.10 s=- c=IN IP4 10.10.10.10 t=0 0 m=application 9 TCP/MRCPv2 1 a=setup:active a=connection:new a=resource:speechrecog a=cmid:1 m=audio 12034 RTP/AVP 0 8 96 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:96 L16/8000 a=sendonly a=mid:1
According to the RFC, the Contact header is not mandatory ( https://datatracker.ietf.org/doc/html/rfc3261#section-8.1.1) and I don’t have an easy way of adding the Contact header to the INVITEs. Is there a way to configure Kamailio’s dialog module to do without the Contact header? Any pointers appreciated.
Thank you so much
With best wishes, Unai Rodriguez __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
Hi,
Contact is mandatory in INVITEs. Per RFC 3261 § 8.1.1.8 ("Contact"):
The Contact header field MUST be present and contain exactly one SIP or SIPS URI in any request that can result in the establishment of a dialog. For the methods defined in this specification, that includes only the INVITE request.
-- Alex
On 24 Jan 2024, at 05:42, Unai Rodriguez via sr-users sr-users@lists.kamailio.org wrote:
Dear List,
I’m trying to set up the dialog module and I keep getting the error "bad sip message or missing Contact hdr”:
Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:219]: populate_leg_info(): bad sip message or missing Contact hdr Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:952]: dlg_new_dialog(): could not add further info to the dialog
This is for MRCP traffic and the SIP INVITEs do not contain the Contact header. They look like this:
INVITE sip:some.mrcp.server.example.com:8060 SIP/2.0 Via: SIP/2.0/TCP 10.10.10.10:5099;branch=z9hG4bK5Kpey3r13SBNQ Max-Forwards: 70 From: sip:10.10.10.10:5099;tag=134a3eKD2a8Ua To: sip:some.mrcp.server.example.com:8060 Call-ID: 051df0ff-3541-123d-f090-02f373ff014c CSeq: 78491159 INVITE User-Agent: google_stt Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE Supported: timer, 100rel Content-Type: application/sdp Content-Disposition: session Content-Length: 329
v=0 o=FreeSWITCH 2474358185109188492 5282339568667506935 IN IP4 10.10.10.10 s=- c=IN IP4 10.10.10.10 t=0 0 m=application 9 TCP/MRCPv2 1 a=setup:active a=connection:new a=resource:speechrecog a=cmid:1 m=audio 12034 RTP/AVP 0 8 96 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:96 L16/8000 a=sendonly a=mid:1
According to the RFC, the Contact header is not mandatory (https://datatracker.ietf.org/doc/html/rfc3261#section-8.1.1) and I don’t have an easy way of adding the Contact header to the INVITEs. Is there a way to configure Kamailio’s dialog module to do without the Contact header? Any pointers appreciated.
Thank you so much
With best wishes, Unai Rodriguez __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
I tried this (and some variations) to no avail:
request_route { insert_hf("Contact: $fu\r\n"); ... ...
I see the Contact header inserted but after receiving the first SIP INVITE (ie too late). Is there a way I can instruct the DIALOG module to use a value of Contact that’s been computed dynamically on the config? Is it possible to modify what Kamailio holds in memory for the value of Contact before the dialog module processes it? Any other points on how I could deal with this missing Contact header?
Thank you so much
With best wishes, Unai Rodriguez On 24 Jan 2024 at 13:54 +0100, Alex Balashov via sr-users sr-users@lists.kamailio.org, wrote:
Hi,
Contact is mandatory in INVITEs. Per RFC 3261 § 8.1.1.8 ("Contact"):
The Contact header field MUST be present and contain exactly one SIP or SIPS URI in any request that can result in the establishment of a dialog. For the methods defined in this specification, that includes only the INVITE request.
-- Alex
On 24 Jan 2024, at 05:42, Unai Rodriguez via sr-users sr-users@lists.kamailio.org wrote:
Dear List,
I’m trying to set up the dialog module and I keep getting the error "bad sip message or missing Contact hdr”:
Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:219]: populate_leg_info(): bad sip message or missing Contact hdr Jan 23 11:34:17 server.example.com kamailio[2495]: 16(2511) ERROR: {1 78451036 INVITE 2ef1d082-3486-123d-0abc-02c8e9c6c24e} dialog [dlg_handlers.c:952]: dlg_new_dialog(): could not add further info to the dialog
This is for MRCP traffic and the SIP INVITEs do not contain the Contact header. They look like this:
INVITE sip:some.mrcp.server.example.com:8060 SIP/2.0 Via: SIP/2.0/TCP 10.10.10.10:5099;branch=z9hG4bK5Kpey3r13SBNQ Max-Forwards: 70 From: sip:10.10.10.10:5099;tag=134a3eKD2a8Ua To: sip:some.mrcp.server.example.com:8060 Call-ID: 051df0ff-3541-123d-f090-02f373ff014c CSeq: 78491159 INVITE User-Agent: google_stt Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, PRACK, MESSAGE, SUBSCRIBE, NOTIFY, REFER, UPDATE Supported: timer, 100rel Content-Type: application/sdp Content-Disposition: session Content-Length: 329
v=0 o=FreeSWITCH 2474358185109188492 5282339568667506935 IN IP4 10.10.10.10 s=- c=IN IP4 10.10.10.10 t=0 0 m=application 9 TCP/MRCPv2 1 a=setup:active a=connection:new a=resource:speechrecog a=cmid:1 m=audio 12034 RTP/AVP 0 8 96 a=rtpmap:0 PCMU/8000 a=rtpmap:8 PCMA/8000 a=rtpmap:96 L16/8000 a=sendonly a=mid:1
According to the RFC, the Contact header is not mandatory (https://datatracker.ietf.org/doc/html/rfc3261#section-8.1.1) and I don’t have an easy way of adding the Contact header to the INVITEs. Is there a way to configure Kamailio’s dialog module to do without the Contact header? Any pointers appreciated.
Thank you so much
With best wishes, Unai Rodriguez __________________________________________________________ Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
-- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe:
On 25 Jan 2024, at 03:35, Unai Rodriguez via sr-users sr-users@lists.kamailio.org wrote:
I tried this (and some variations) to no avail:
request_route { insert_hf("Contact: $fu\r\n"); ... ...
I see the Contact header inserted but after receiving the first SIP INVITE (ie too late). Is there a way I can instruct the DIALOG module to use a value of Contact that’s been computed dynamically on the config? Is it possible to modify what Kamailio holds in memory for the value of Contact before the dialog module processes it? Any other points on how I could deal with this missing Contact header?
I believe that calling msg_apply_changes() will sync the change lumps to the in-memory message structure.
Whether this will affect the version of the message that `dialog` operates on, I'm not 100% sure...
-- Alex
Hi Alex/All,
So using msg_apply_changes() worked! This is great, thank you! So now that I can see results when I do "kamctl dialog show”. I’m using algorithm “call load distribution” with this config:
# cat /etc/kamailio/dispatcher.list 1 sip:host1.example.com:8060;transport=tcp duid=stt_h01 1 sip:host2.example.com:8060;transport=tcp duid=stt_h02 1 sip:host3.example.com:8060;transport=tcp duid=stt_h03
2 sip:host1.example.com:8060;transport=tcp duid=tts_h01 2 sip:host2.example.com:8060;transport=tcp duid=tts_h02 2 sip:host3.example.com:8060;transport=tcp duid=tts_h03
The output of "kamctl dialog show” does not show any obvious information that the hosts will be load balanced according to the one with the least number of concurrent sessions.. Is this all I need? Am I missing something or this looks correct? How is the information that dialog keeps connected to the configuration of the backends?
Thank you so much
With best wishes, Unai Rodriguez On 25 Jan 2024 at 18:48 +0100, Alex Balashov via sr-users sr-users@lists.kamailio.org, wrote:
On 25 Jan 2024, at 03:35, Unai Rodriguez via sr-users sr-users@lists.kamailio.org wrote:
I tried this (and some variations) to no avail:
request_route { insert_hf("Contact: $fu\r\n"); ... ...
I see the Contact header inserted but after receiving the first SIP INVITE (ie too late). Is there a way I can instruct the DIALOG module to use a value of Contact that’s been computed dynamically on the config? Is it possible to modify what Kamailio holds in memory for the value of Contact before the dialog module processes it? Any other points on how I could deal with this missing Contact header?
I believe that calling msg_apply_changes() will sync the change lumps to the in-memory message structure.
Whether this will affect the version of the message that `dialog` operates on, I'm not 100% sure...
-- Alex
-- Alex Balashov Principal Consultant Evariste Systems LLC Web: https://evaristesys.com Tel: +1-706-510-6800
Kamailio - Users Mailing List - Non Commercial Discussions To unsubscribe send an email to sr-users-leave@lists.kamailio.org Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: