[sr-dev] [kamailio/kamailio] assign CSeq header for REGISTER generation (#1768)

Daniel-Constantin Mierla notifications at github.com
Fri Dec 21 09:08:36 CET 2018


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 at 127.0.0.1 SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bKb10b.9e1030f5000000000000000000000000.0.
To: <sip:test at 127.0.0.1>.
From: <sip:test at 127.0.0.1>;tag=3393f0703fb0ccaca74109ff37de39f5-adaa.
CSeq: 10 INFO.
Call-ID: 6ab3848a2fc2b6c2-29989 at 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 at 127.0.0.1>;tag=9dd61ff61e802d8e2bef5f14621ef3c2.7855.
From: <sip:test at 127.0.0.1>;tag=3393f0703fb0ccaca74109ff37de39f5-adaa.
CSeq: 10 INFO.
Call-ID: 6ab3848a2fc2b6c2-29989 at 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 at 127.0.0.1 SIP/2.0.
Via: SIP/2.0/UDP 127.0.0.1;branch=z9hG4bKc10b.ab8927e3000000000000000000000000.0.
To: <sip:test at 127.0.0.1>.
From: <sip:test at 127.0.0.1>;tag=3393f0703fb0ccaca74109ff37de39f5-adaa.
CSeq: 11 INFO.
Call-ID: 6ab3848a2fc2b6c2-29989 at 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 at 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 at 127.0.0.1>;tag=9dd61ff61e802d8e2bef5f14621ef3c2.7855.
From: <sip:test at 127.0.0.1>;tag=3393f0703fb0ccaca74109ff37de39f5-adaa.
CSeq: 11 INFO.
Call-ID: 6ab3848a2fc2b6c2-29989 at 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.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/1768#issuecomment-449301799
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20181221/7fe54389/attachment.html>


More information about the sr-dev mailing list