Hello everyone,
I use from uac_req_send()function from UAC module for generation of REGISTER request in onreply_route , I assign new values for all headers of my packet before sending my new generated request but I can't assign value for CSeq header. It doesn't define and when I try to assign it, I got an error . I analysed packet flow through Wireshark and recognized always value of CSeq header for my new register request is 10. I want to assign new value for my REGISTER packet in configuration file..
Can you give more details about the expected behavior and your configuration? If you need more help in debugging it, it would be good to discuss it first on the sr-users e-mail list
Hello, I wanted to generate "Authorized REGISTER" after receiving "401 unauthorized" response from upstream server by my kamailio core . I could assign new values for many headers like this($uac_req(ruri)="sip:" + $var(uri); ) but it was impossible to assign new value for Common Sequence header .it wasn't defined in source codes . With your permission I solved my problem with modification in (uac.s and uac_send.c source code) then I recompiled kamailio core again. after changes I can assign new value to CSeq header ( $uac_req(cseq)= $(cs{s.int}) + 1;) and my problem solved. with this solution upstream server accepts my response because CSeq is more than "401 unauthorized " response from its side. If you would like I can send my modifications and configuration file . thanks in advance
On Sat, Dec 15, 2018 at 2:55 PM Henning Westerholt notifications@github.com wrote:
Can you give more details about the expected behavior and your configuration? If you need more help in debugging it, it would be good to discuss it first on the sr-users e-mail list
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kamailio/kamailio/issues/1768#issuecomment-447561420, or mute the thread https://github.com/notifications/unsubscribe-auth/Arw_NixyfCM_xKcxPyZ2JS_z8pSpf7jJks5u5NwWgaJpZM4ZUmBV .
Have you tried setting `track_cseq_updates` from dialog module?
https://kamailio.org/docs/modules/5.2.x/modules/dialog.html#dialog.p.track_c...
@maryamb99 - have you set the username and password before uac_req_send() -- see the attributes at:
* https://www.kamailio.org/wiki/cookbooks/devel/pseudovariables#uac_req_key
The CSeq is incremented automatically when getting the 401/407.
@maryamb99 - have you set the username and password before uac_req_send() -- see the attributes at:
The CSeq is incremented automatically when getting the 401/407.
I need something like $uac_req(method) which let me to assign new value to CSeq header of my new packet but it isn't defined in structure of uac module and I added this part in source of uac and tm modules according to my observations , always CSeq number is 10 in type of my requirements and my definitions , not incremental after receiving 401
I checked the code and it should be incremented. Can you paste here the part of the config where you set $uac_req() attributes and do uac_req_send()?
Did a small check and the CSeq is incremented, the config snippet:
``` request_route {
if(is_method("OPTIONS")) { sl_send_reply("200", "ok"); $uac_req(method)="INFO"; $uac_req(ruri)="sip:test@" + $Ri; $uac_req(furi)="sip:test@" + $Ri; $uac_req(turi)="sip:test@" + $Ri; $uac_req(auser)="test"; $uac_req(apasswd)="test123"; uac_req_send(); exit; } if(is_method("INFO")) { if (!pv_auth_check("$fd", "test123", "0", "1")) { auth_challenge("$fd", "0"); exit; } } sl_send_reply("200", "ok"); } ```
And the sip trace for info request:
``` # U 127.0.0.1:5060 -> 127.0.0.1:5060 INFO sip:test@127.0.0.1 SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bKb10b.9e1030f5000000000000000000000000.0. To: sip:test@127.0.0.1. From: sip:test@127.0.0.1;tag=3393f0703fb0ccaca74109ff37de39f5-adaa. CSeq: 10 INFO. Call-ID: 6ab3848a2fc2b6c2-29989@127.0.0.1. Max-Forwards: 70. Content-Length: 0. User-Agent: kamailio (5.3.0-dev1 (x86_64/darwin)). ..
# U 127.0.0.1:5060 -> 127.0.0.1:5060 SIP/2.0 407 Proxy Authentication Required. Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bKb10b.9e1030f5000000000000000000000000.0. To: sip:test@127.0.0.1;tag=9dd61ff61e802d8e2bef5f14621ef3c2.7855. From: sip:test@127.0.0.1;tag=3393f0703fb0ccaca74109ff37de39f5-adaa. CSeq: 10 INFO. Call-ID: 6ab3848a2fc2b6c2-29989@127.0.0.1. Proxy-Authenticate: Digest realm="127.0.0.1", nonce="XByfSlwcnh4wAtPk/1CPl5TfZtjZdKHe". Server: kamailio (5.3.0-dev1 (x86_64/darwin)). Content-Length: 0. ..
# U 127.0.0.1:5060 -> 127.0.0.1:5060 INFO sip:test@127.0.0.1 SIP/2.0. Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bKc10b.ab8927e3000000000000000000000000.0. To: sip:test@127.0.0.1. From: sip:test@127.0.0.1;tag=3393f0703fb0ccaca74109ff37de39f5-adaa. CSeq: 11 INFO. Call-ID: 6ab3848a2fc2b6c2-29989@127.0.0.1. Max-Forwards: 70. Content-Length: 0. User-Agent: kamailio (5.3.0-dev1 (x86_64/darwin)). Proxy-Authorization: Digest username="test", realm="127.0.0.1", nonce="XByfSlwcnh4wAtPk/1CPl5TfZtjZdKHe", uri="sip:test@127.0.0.1", response="8363f2ebe2e13d9ae03eb48c923f3580", algorithm=MD5. ..
# U 127.0.0.1:5060 -> 127.0.0.1:5060 SIP/2.0 200 ok. Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bKc10b.ab8927e3000000000000000000000000.0. To: sip:test@127.0.0.1;tag=9dd61ff61e802d8e2bef5f14621ef3c2.7855. From: sip:test@127.0.0.1;tag=3393f0703fb0ccaca74109ff37de39f5-adaa. CSeq: 11 INFO. Call-ID: 6ab3848a2fc2b6c2-29989@127.0.0.1. Server: kamailio (5.3.0-dev1 (x86_64/darwin)). Content-Length: 0. .. ```
If you want to do something else, then likely you want a new feature. Closing this one.
Closed #1768.