<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello,</p>
<p>I am not sure I got the proper picture of what do you want to
achieve. Do you want to authenticate the registration twice, once
by kamailio and second by asterisk?</p>
<p>Cheers,<br>
Daniel<br>
</p>
<br>
<div class="moz-cite-prefix">On 03.04.17 01:05, Marko Tirs wrote:<br>
</div>
<blockquote cite="mid:57946211.9475446.1491174351313@mail.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff;
font-family:Helvetica Neue, Helvetica, Arial, Lucida Grande,
sans-serif;font-size:16px">
<div id="yui_3_16_0_ym19_1_1491149150152_8465">Hello all,</div>
<div id="yui_3_16_0_ym19_1_1491149150152_8511"><br>
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_8464">I am
trying to use Kamailio 5.0 with Asterisk (separate IP
addresses, both port 5060),</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9788"> but
Asterisk doesn't register the SIP clients which comes through
Kamailio.</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_8463">If I
register the same user directly to the Asterisk then it works!
1st REGISTER</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9911"> is
also without Authorization (Digest name) but in the 2nd
REGISTER it exists</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9798"> and
registration goes OK.<br>
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9790"><br>
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9787">How to
use Kamailio with Asterisk in the way the SIP client is
registered on both of them?</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9786">Thank
you</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9590">Marko</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9591"><br>
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9785"><br>
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9561">SIP-CLIENT
DIRECTLY TO ASTERISK:</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9560">-----------------------------------------------------------<br>
</div>
1 2017-04-01 15:20:48.331806 192.168.0.12 192.168.0.2
SIP 544 Request: REGISTER <a class="moz-txt-link-freetext" href="sip:192.168.0.2">sip:192.168.0.2</a> (1 binding) |
<br id="yui_3_16_0_ym19_1_1491149150152_9392">
2 2017-04-01 15:20:48.332998 192.168.0.2 192.168.0.12
SIP 626 Status: 401 Unauthorized | <br
id="yui_3_16_0_ym19_1_1491149150152_9393">
3 2017-04-01 15:20:48.333814 192.168.0.12 192.168.0.2
SIP 700 Request: REGISTER <a class="moz-txt-link-freetext" href="sip:192.168.0.2">sip:192.168.0.2</a> (1 binding) |
<br id="yui_3_16_0_ym19_1_1491149150152_9394">
4 2017-04-01 15:20:48.335975 192.168.0.2 192.168.0.12
SIP 647 Status: 200 OK (1 binding) | <br
id="yui_3_16_0_ym19_1_1491149150152_9395">
<div id="yui_3_16_0_ym19_1_1491149150152_9603"><br>
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9539">Frame
3: 700 bytes on wire (5600 bits), 700 bytes captured (5600
bits) on interface 0<br
id="yui_3_16_0_ym19_1_1491149150152_9631">
Ethernet II, Src: AsrockIn_0a:0b:46 (70:85:c2:0a:0b:46), Dst:
Raspberr_a1:fd:f7 (b8:27:eb:a1:fd:f7)<br
id="yui_3_16_0_ym19_1_1491149150152_9632">
Internet Protocol Version 4, Src: 192.168.0.12, Dst:
192.168.0.2<br id="yui_3_16_0_ym19_1_1491149150152_9633">
User Datagram Protocol, Src Port: 64369, Dst Port: 5060<br
id="yui_3_16_0_ym19_1_1491149150152_9634">
Session Initiation Protocol (REGISTER)<br
id="yui_3_16_0_ym19_1_1491149150152_9635">
Request-Line: REGISTER <a class="moz-txt-link-freetext" href="sip:192.168.0.2">sip:192.168.0.2</a> SIP/2.0<br
id="yui_3_16_0_ym19_1_1491149150152_9636">
Message Header<br
id="yui_3_16_0_ym19_1_1491149150152_9637">
Via: SIP/2.0/UDP
192.168.0.12:64369;rport;branch=z9hG4bKPj9f8759c0537b4834bb411358d0b0a2ff<br
id="yui_3_16_0_ym19_1_1491149150152_9638">
Max-Forwards: 70<br
id="yui_3_16_0_ym19_1_1491149150152_9639">
From: "33"
<a class="moz-txt-link-rfc2396E" href="sip:33@192.168.0.2"><sip:33@192.168.0.2></a>;tag=4c586be1fcf842359e7d429abcb0b213<br
id="yui_3_16_0_ym19_1_1491149150152_9640">
To: "33" <a class="moz-txt-link-rfc2396E" href="sip:33@192.168.0.2"><sip:33@192.168.0.2></a><br
id="yui_3_16_0_ym19_1_1491149150152_9641">
Contact:
<a class="moz-txt-link-rfc2396E" href="sip:74081936@192.168.0.12:64369"><sip:74081936@192.168.0.12:64369></a>;+sip.instance="<urn:uuid:b408367e-d06b-4780-a9a0-291eb99ec83c>"<br
id="yui_3_16_0_ym19_1_1491149150152_9642">
Call-ID: d3c240808c934b77a9bbcb8bd4c1bd8c<br
id="yui_3_16_0_ym19_1_1491149150152_9643">
CSeq: 2 REGISTER<br
id="yui_3_16_0_ym19_1_1491149150152_9644">
Expires: 600<br
id="yui_3_16_0_ym19_1_1491149150152_9645">
Supported: gruu<br
id="yui_3_16_0_ym19_1_1491149150152_9646">
User-Agent: Blink 3.0.0 (Windows)<br
id="yui_3_16_0_ym19_1_1491149150152_9647">
Authorization: Digest username="33", realm="asterisk",
nonce="76ca37d8", uri=<a class="moz-txt-link-rfc2396E" href="sip:192.168.0.2">"sip:192.168.0.2"</a>,
response="19fc1a634abc72c41dcb516470c34fc2", algorithm=MD5<br
id="yui_3_16_0_ym19_1_1491149150152_9648">
Authentication Scheme: Digest<br
id="yui_3_16_0_ym19_1_1491149150152_9649">
Username: "33"<br
id="yui_3_16_0_ym19_1_1491149150152_9650">
Realm: "asterisk"<br
id="yui_3_16_0_ym19_1_1491149150152_9651">
Nonce Value: "76ca37d8"<br
id="yui_3_16_0_ym19_1_1491149150152_9652">
Authentication URI: <a class="moz-txt-link-rfc2396E" href="sip:192.168.0.2">"sip:192.168.0.2"</a><br
id="yui_3_16_0_ym19_1_1491149150152_9653">
Digest Authentication Response:
"19fc1a634abc72c41dcb516470c34fc2"<br
id="yui_3_16_0_ym19_1_1491149150152_9654">
Algorithm: MD5<br
id="yui_3_16_0_ym19_1_1491149150152_9655">
Content-Length: 0<br
id="yui_3_16_0_ym19_1_1491149150152_9656">
<br id="yui_3_16_0_ym19_1_1491149150152_9657">
</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9658"><br>
</div>
<div dir="ltr">SIP-CLIENT TO KAMAILIO WITH FORWARD TO ASTERISK:</div>
<div dir="ltr" id="yui_3_16_0_ym19_1_1491149150152_9540">----------------------------------------------------------------------------------------------<br
id="yui_3_16_0_ym19_1_1491149150152_9541">
</div>
11 2017-04-01 15:21:06.806347 192.168.0.13
192.168.0.2 SIP 459 Request: REGISTER
<a class="moz-txt-link-freetext" href="sip:192.168.0.2:5060">sip:192.168.0.2:5060</a> (1 binding) | <br
id="yui_3_16_0_ym19_1_1491149150152_9397">
12 2017-04-01 15:21:06.807514 192.168.0.2
192.168.0.13 SIP 608 Status: 401 Unauthorized | <br
id="yui_3_16_0_ym19_1_1491149150152_9398">
13 2017-04-01 15:21:06.814819 192.168.0.13
192.168.0.2 SIP 456 Request: REGISTER
<a class="moz-txt-link-freetext" href="sip:192.168.0.2:5060">sip:192.168.0.2:5060</a> (remove 1 binding) | <br
id="yui_3_16_0_ym19_1_1491149150152_9399">
14 2017-04-01 15:21:06.815712 192.168.0.2
192.168.0.13 SIP 608 Status: 401 Unauthorized | <br
id="yui_3_16_0_ym19_1_1491149150152_9400">
15 2017-04-01 15:21:06.821125 192.168.0.13
192.168.0.2 SIP 459 Request: REGISTER
<a class="moz-txt-link-freetext" href="sip:192.168.0.2:5060">sip:192.168.0.2:5060</a> (1 binding) | <br
id="yui_3_16_0_ym19_1_1491149150152_9401">
16 2017-04-01 15:21:06.821910 192.168.0.2
192.168.0.13 SIP 608 Status: 401 Unauthorized | <br
id="yui_3_16_0_ym19_1_1491149150152_9402">
<br id="yui_3_16_0_ym19_1_1491149150152_9403">
Frame 15: 459 bytes on wire (3672 bits), 459 bytes captured
(3672 bits) on interface 0<br
id="yui_3_16_0_ym19_1_1491149150152_9432">
Ethernet II, Src: Micro-St_de:b2:3a (00:24:21:de:b2:3a), Dst:
Raspberr_a1:fd:f7 (b8:27:eb:a1:fd:f7)<br
id="yui_3_16_0_ym19_1_1491149150152_9433">
Internet Protocol Version 4, Src: 192.168.0.13, Dst: 192.168.0.2<br
id="yui_3_16_0_ym19_1_1491149150152_9434">
User Datagram Protocol, Src Port: 5060, Dst Port: 5060<br
id="yui_3_16_0_ym19_1_1491149150152_9435">
Session Initiation Protocol (REGISTER)<br
id="yui_3_16_0_ym19_1_1491149150152_9436">
Request-Line: REGISTER <a class="moz-txt-link-freetext" href="sip:192.168.0.2:5060">sip:192.168.0.2:5060</a> SIP/2.0<br
id="yui_3_16_0_ym19_1_1491149150152_9437">
Message Header<br id="yui_3_16_0_ym19_1_1491149150152_9438">
Via: SIP/2.0/UDP
192.168.0.13;branch=z9hG4bKd101.0ad599b6000000000000000000000000.0<br
id="yui_3_16_0_ym19_1_1491149150152_9439">
To: <a class="moz-txt-link-rfc2396E" href="sip:32@192.168.0.2"><sip:32@192.168.0.2></a><br
id="yui_3_16_0_ym19_1_1491149150152_9440">
SIP to address: <a class="moz-txt-link-freetext" href="sip:32@192.168.0.2">sip:32@192.168.0.2</a><br
id="yui_3_16_0_ym19_1_1491149150152_9441">
From:
<a class="moz-txt-link-rfc2396E" href="sip:32@192.168.0.2"><sip:32@192.168.0.2></a>;tag=533cb9e91f4b999cf76861cbb9ed54ed-85c4<br
id="yui_3_16_0_ym19_1_1491149150152_9442">
SIP from address: <a class="moz-txt-link-freetext" href="sip:32@192.168.0.2">sip:32@192.168.0.2</a><br
id="yui_3_16_0_ym19_1_1491149150152_9443">
SIP from tag: 533cb9e91f4b999cf76861cbb9ed54ed-85c4<br
id="yui_3_16_0_ym19_1_1491149150152_9444">
CSeq: 10 REGISTER<br
id="yui_3_16_0_ym19_1_1491149150152_9445">
Call-ID: <a class="moz-txt-link-abbreviated" href="mailto:41df282f10fdc7b6-2773@127.0.0.1">41df282f10fdc7b6-2773@127.0.0.1</a><br
id="yui_3_16_0_ym19_1_1491149150152_9446">
Max-Forwards: 70<br
id="yui_3_16_0_ym19_1_1491149150152_9447">
Content-Length: 0<br
id="yui_3_16_0_ym19_1_1491149150152_9448">
User-Agent: kamailio (5.0.0 (x86_64/linux))<br
id="yui_3_16_0_ym19_1_1491149150152_9449">
Contact: <a class="moz-txt-link-rfc2396E" href="sip:32@192.168.0.13:5060"><sip:32@192.168.0.13:5060></a><br
id="yui_3_16_0_ym19_1_1491149150152_9450">
Contact URI: <a class="moz-txt-link-freetext" href="sip:32@192.168.0.13:5060">sip:32@192.168.0.13:5060</a><br
id="yui_3_16_0_ym19_1_1491149150152_9451">
Expires: 3600<br
id="yui_3_16_0_ym19_1_1491149150152_9452">
<br id="yui_3_16_0_ym19_1_1491149150152_9453">
<br id="yui_3_16_0_ym19_1_1491149150152_9454">
<br id="yui_3_16_0_ym19_1_1491149150152_9455">
<div id="yui_3_16_0_ym19_1_1491149150152_9764">kamailio.cfg:</div>
<div id="yui_3_16_0_ym19_1_1491149150152_9776">--------------------<br>
</div>
<div id="yui_3_16_0_ym19_1_1491149150152_9758"><br>
</div>
#!define WITH_DEBUG<br id="yui_3_16_0_ym19_1_1491149150152_9459">
#!define WITH_MYSQL<br id="yui_3_16_0_ym19_1_1491149150152_9460">
#!define WITH_AUTH<br id="yui_3_16_0_ym19_1_1491149150152_9461">
#!define WITH_USRLOCDB<br
id="yui_3_16_0_ym19_1_1491149150152_9462">
#!define WITH_ASTERISK<br
id="yui_3_16_0_ym19_1_1491149150152_9463">
...<br id="yui_3_16_0_ym19_1_1491149150152_9465">
<br id="yui_3_16_0_ym19_1_1491149150152_9466">
#!ifdef WITH_ASTERISK<br
id="yui_3_16_0_ym19_1_1491149150152_9467">
asterisk.bindip = "192.168.0.2" desc "Asterisk IP Address"<br
id="yui_3_16_0_ym19_1_1491149150152_9468">
asterisk.bindport = "5060" desc "Asterisk Port"<br
id="yui_3_16_0_ym19_1_1491149150152_9469">
kamailio.bindip = "192.168.0.13" desc "Kamailio IP Address"<br
id="yui_3_16_0_ym19_1_1491149150152_9470">
kamailio.bindport = "5060" desc "Kamailio Port"<br
id="yui_3_16_0_ym19_1_1491149150152_9471">
#!endif<br id="yui_3_16_0_ym19_1_1491149150152_9472">
...<br id="yui_3_16_0_ym19_1_1491149150152_9474">
<br id="yui_3_16_0_ym19_1_1491149150152_9475">
# Forward REGISTER to Asterisk<br
id="yui_3_16_0_ym19_1_1491149150152_9476">
route[REGFWD] {<br id="yui_3_16_0_ym19_1_1491149150152_9477">
if(!is_method("REGISTER"))<br
id="yui_3_16_0_ym19_1_1491149150152_9478">
{<br id="yui_3_16_0_ym19_1_1491149150152_9479">
return;<br id="yui_3_16_0_ym19_1_1491149150152_9480">
}<br id="yui_3_16_0_ym19_1_1491149150152_9481">
$var(rip) = $sel(cfg_get.asterisk.bindip);<br
id="yui_3_16_0_ym19_1_1491149150152_9482">
$uac_req(method)="REGISTER";<br
id="yui_3_16_0_ym19_1_1491149150152_9483">
$uac_req(ruri)="sip:" + $var(rip) + ":" +
$sel(cfg_get.asterisk.bindport);<br
id="yui_3_16_0_ym19_1_1491149150152_9484">
#$uac_req(ruri)="sip:" + $au + "@" + $var(rip) + ":" +
$sel(cfg_get.asterisk.bindport);<br
id="yui_3_16_0_ym19_1_1491149150152_9485">
$uac_req(furi)="sip:" + $au + "@" + $var(rip);<br
id="yui_3_16_0_ym19_1_1491149150152_9486">
$uac_req(turi)="sip:" + $au + "@" + $var(rip);<br
id="yui_3_16_0_ym19_1_1491149150152_9487">
$uac_req(hdrs)="Contact: <sip:" + $au + "@"<br
id="yui_3_16_0_ym19_1_1491149150152_9488">
+ $sel(cfg_get.kamailio.bindip)<br
id="yui_3_16_0_ym19_1_1491149150152_9489">
+ ":" + $sel(cfg_get.kamailio.bindport) +
">\r\n";<br id="yui_3_16_0_ym19_1_1491149150152_9490">
if($sel(contact.expires) != $null)<br
id="yui_3_16_0_ym19_1_1491149150152_9491">
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " +
$sel(contact.expires) + "\r\n";<br
id="yui_3_16_0_ym19_1_1491149150152_9492">
else<br id="yui_3_16_0_ym19_1_1491149150152_9493">
$uac_req(hdrs)= $uac_req(hdrs) + "Expires: " +
$hdr(Expires) + "\r\n";<br
id="yui_3_16_0_ym19_1_1491149150152_9494">
uac_req_send();<br id="yui_3_16_0_ym19_1_1491149150152_9495">
}<br id="yui_3_16_0_ym19_1_1491149150152_9496">
<div id="yui_3_16_0_ym19_1_1491149150152_9827"><br>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a>
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio Advanced Training - May 22-24 (USA) - <a class="moz-txt-link-abbreviated" href="http://www.asipto.com">www.asipto.com</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
</body>
</html>