<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hello,<br>
<br>
On 02/15/2010 05:05 PM, Anton Roman wrote:
<blockquote
 cite="mid:3a6bf0e81002150805u724a32a3rbc6b8cca9c7e1d1f@mail.gmail.com"
 type="cite">Hi all,<br>
  <br>
I'm trying to implement parallel forking to different users registered
on a Kamailio server. I want to fork the call to a number of different
users (not including the called user). <br>
To do this I added the piece of code below to the default 3.0.0 config
file: <br>
  <br>
  <div style="margin-left: 80px;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ...<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; # account only INVITEs<br>
&nbsp;&nbsp;&nbsp; if (is_method("INVITE")) {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(1); # do accounting<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; setflag(4); #dialog aware<br>
  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if(avp_db_load("$ru/username","$avp(s:fork)"))<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; avp_pushto("$ru/username","$avp(s:fork)/g");<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; };<br>
  <br>
&nbsp;&nbsp;&nbsp; }<br>
  </div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ....<br>
  <br>
This is usr_preference table content:<br>
  <br>
  <div style="margin-left: 80px;">+----+------+----------+--------+-----------+------+-------+---------------------+<br>
| id | uuid | username | domain | attribute | type | value |
last_modified&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |<br>
+----+------+----------+--------+-----------+------+-------+---------------------+<br>
|&nbsp; 4 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 1000&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | fork&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 0 | 1001&nbsp;
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | <br>
|&nbsp; 3 |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | 1000&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | fork&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp; 0 | 1005&nbsp;
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | <br>
+----+------+----------+--------+-----------+------+-------+---------------------+<br>
  </div>
  <br>
Kamailio correctly forks the call to 1001 and 1005, but the Request-URI
of the 1005 user is not correctly set, because the proxy IP is used
instead of the IP where the user is registered (10.1.2.15). You can see
the INVITEs below.<br>
  <br>
Could anybody tell me what I'm doing badly? <br>
</blockquote>
<br>
apart of first destination which is set in the r-uri, the rest become
branches. You have to loop back so they arrive as r-uri and location
lookup resolves the user address. lookup("location") works only with
r-uri.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
<blockquote
 cite="mid:3a6bf0e81002150805u724a32a3rbc6b8cca9c7e1d1f@mail.gmail.com"
 type="cite"><br>
Thanks for your time,<br>
best regards<br>
  <br>
Anton &nbsp; <br>
----------------------------------------------------------------------------------------------------------------------------------------<br>
  <div style="margin-left: 80px;">#<br>
U +0.000328 <a moz-do-not-send="true" href="http://10.1.20.103:5060"
 target="_blank">10.1.20.103:5060</a> -&gt; <a moz-do-not-send="true"
 href="http://10.1.3.18:5061" target="_blank">10.1.3.18:5061</a><br>
INVITE <a moz-do-not-send="true" href="http://sip:1001@10.1.3.18:5061"
 target="_blank">sip:1001@10.1.3.18:5061</a> SIP/2.0<br>
Record-Route: &lt;sip:10.1.20.103;lr=on;did=c34.3ed81d77&gt;<br>
Via: SIP/2.0/UDP 10.1.20.103;branch=z9hG4bKc40b.ec3572a3.0<br>
Via: SIP/2.0/UDP 10.1.3.15:5061;branch=z9hG4bK-213aa77<br>
From: "1002" &lt;<a moz-do-not-send="true"
 href="mailto:sip%3A1002@10.1.20.103" target="_blank">sip:1002@10.1.20.103</a>&gt;;tag=280da520d15d62cfo1<br>
To: "1000" &lt;<a moz-do-not-send="true"
 href="mailto:sip%3A1000@10.1.20.103" target="_blank">sip:1000@10.1.20.103</a>&gt;<br>
Call-ID: <a moz-do-not-send="true"
 href="mailto:8973c34-427096cb@10.1.3.15" target="_blank">8973c34-427096cb@10.1.3.15</a><br>
CSeq: 102 INVITE<br>
Max-Forwards: 69<br>
Contact: "1002" &lt;<a moz-do-not-send="true"
 href="http://sip:1002@10.1.3.15:5061" target="_blank">sip:1002@10.1.3.15:5061</a>&gt;<br>
Expires: 240<br>
User-Agent: Linksys/SPA941-5.1.5<br>
Content-Length: 202<br>
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER<br>
Supported: replaces<br>
Content-Type: application/sdp<br>
  <br>
v=0<br>
o=- 2003696 2003696 IN IP4 10.1.3.15<br>
...<br>
  <br>
#<br>
U +0.000052 <a moz-do-not-send="true" href="http://10.1.20.103:5060"
 target="_blank">10.1.20.103:5060</a> -&gt; <a moz-do-not-send="true"
 href="http://10.1.20.103:5060" target="_blank">10.1.20.103:5060</a><br>
INVITE <a moz-do-not-send="true" href="mailto:sip%3A1005@10.1.20.103"
 target="_blank">sip:1005@10.1.20.103</a> SIP/2.0<br>
Record-Route: &lt;sip:10.1.20.103;lr=on;did=c34.3ed81d77&gt;<br>
Via: SIP/2.0/UDP 10.1.20.103;branch=z9hG4bKc40b.ec3572a3.1<br>
Via: SIP/2.0/UDP 10.1.3.15:5061;branch=z9hG4bK-213aa77<br>
From: "1002" &lt;<a moz-do-not-send="true"
 href="mailto:sip%3A1002@10.1.20.103" target="_blank">sip:1002@10.1.20.103</a>&gt;;tag=280da520d15d62cfo1<br>
To: "1000" &lt;<a moz-do-not-send="true"
 href="mailto:sip%3A1000@10.1.20.103" target="_blank">sip:1000@10.1.20.103</a>&gt;<br>
Call-ID: <a moz-do-not-send="true"
 href="mailto:8973c34-427096cb@10.1.3.15" target="_blank">8973c34-427096cb@10.1.3.15</a><br>
CSeq: 102 INVITE<br>
Max-Forwards: 69<br>
Contact: "1002" &lt;<a moz-do-not-send="true"
 href="http://sip:1002@10.1.3.15:5061" target="_blank">sip:1002@10.1.3.15:5061</a>&gt;<br>
Expires: 240<br>
User-Agent: Linksys/SPA941-5.1.5<br>
Content-Length: 202<br>
Allow: ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS, REFER<br>
Supported: replaces<br>
Content-Type: application/sdp<br>
  <br>
v=0<br>
o=- 2003696 2003696 IN IP4 10.1.3.15<br>
...<br>
  </div>
  <br>
----------------------------------------------------------------------------------------------------------------------------------------<br>
  <br>
  <br>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Kamailio (OpenSER) - Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.kamailio.org">Users@lists.kamailio.org</a>
<a class="moz-txt-link-freetext" href="http://lists.kamailio.org/cgi-bin/mailman/listinfo/users">http://lists.kamailio.org/cgi-bin/mailman/listinfo/users</a>
<a class="moz-txt-link-freetext" href="http://lists.openser-project.org/cgi-bin/mailman/listinfo/users">http://lists.openser-project.org/cgi-bin/mailman/listinfo/users</a></pre>
</blockquote>
</body>
</html>