<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="State"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="place"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
 name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:595.3pt 841.9pt;
        margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-GB link=blue vlink=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi Reda,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Sorry, I should have been more specific &#8211;
I am referring to instances where the media server is for example Asterisk. If
first call goes through Asterisk 1, second call goes through Asterisk 2, when
Asterisk 2 receives the REFER it does not know of initial call on Asterisk 1.
The only way we have found for it to work is to ensure the second call is
dispatched to the same Asterisk box as the first.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I would be pleased to hear of an
alternative method.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Regards,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Charles<o:p></o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span lang=EN-US style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span lang=EN-US
style='font-size:10.0pt;font-family:Tahoma;font-weight:bold'>From:</span></font></b><font
size=2 face=Tahoma><span lang=EN-US style='font-size:10.0pt;font-family:Tahoma'>
sr-users-bounces@lists.sip-router.org
[mailto:sr-users-bounces@lists.sip-router.org] <b><span style='font-weight:
bold'>On Behalf Of </span></b>Reda Aouad<br>
<b><span style='font-weight:bold'>Sent:</span></b> 26 April 2012 14:34<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">SIP
 Router - Kamailio</st1:PersonName> (OpenSER) and SIP Express Router (SER) -
UsersMailing List<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [SR-Users] dispatcher
and call transfer</span></font><span lang=EN-US><o:p></o:p></span></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 color="#3366ff" face=Tahoma><span
style='font-size:12.0pt;font-family:Tahoma;color:#3366FF'>Hi,<br>
<br>
@Carsten<br>
Dispatcher algorithm 0 based on call-id should do it in your case of re-invite
within dialog with same call-id.<br>
<br>
@Charles<br>
In the case of attended transfers, shouldn't both media servers be relaying
media between them? I didn't understand why your are obliged to dispatch to the
same media server since they are 2 different calls with different call-ids.</span></font><o:p></o:p></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 color="#3366ff" face=Tahoma><span
style='font-size:12.0pt;font-family:Tahoma;color:#3366FF'>Reda</span></font><o:p></o:p></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Thu, Apr 26, 2012 at 14:30, Charles Chance &lt;<a
href="mailto:charles.chance@sipcentric.com" target="_blank">charles.chance@sipcentric.com</a>&gt;
wrote:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi,<br>
<br>
Actually, this won't help for attended transfers where another call is<br>
initiated first then the two are joined together by REFER. In this case, the<br>
second INVITE must be routed to the same media server as the existing call<br>
for the transfer to work.<br>
<br>
What we do is store the dialogs in DB, then when a new call comes in, prior<br>
to doing ds_select_dst we query DB for existing call involving same user. If<br>
we find one, we simply replace destination host with that from the contact<br>
(to/from depending on direction of call).<br>
<br>
It may not be the most elegant way but it works for us :)<br>
<br>
Charles<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
-----Original Message-----<br>
From: <a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a><br>
[mailto:<a href="mailto:sr-users-bounces@lists.sip-router.org">sr-users-bounces@lists.sip-router.org</a>]
On Behalf Of Carsten Bock<br>
Sent: 26 April 2012 13:25<br>
To: <st1:PersonName w:st="on">SIP Router - Kamailio</st1:PersonName> (OpenSER)
and SIP Express Router (SER) -<br>
UsersMailing List<br>
Subject: Re: [SR-Users] dispatcher and call transfer<br>
<br>
Hi,<br>
<br>
if you look at the docs of the dispatcher module, you'll find this:<br>
<br>
alg - the algorithm used to select the destination address. The<br>
parameter can be an integer or a variable holding an interger.<br>
- &#8220;0&#8221; - hash over callid<br>
(<a
href="http://kamailio.org/docs/modules/devel/modules_k/dispatcher.html#id2498492"
target="_blank">http://kamailio.org/docs/modules/devel/modules_k/dispatcher.html#id2498492</a>)<br>
<br>
But probably you should look into record/loose_route for your setup.<br>
Since REFER is normally an in-dialog request (belongs to another<br>
voice-session), it should take the same route as the initial INVITE.<br>
This is normally achieved by the record/loose-route mechanisms<br>
described in RFC3261.<br>
In the example config of Kamailio you find an configuration example (below).<br>
<br>
It is not a bug in the dispatcher module, it's how you use it.<br>
<br>
So long,<br>
Carsten<br>
<br>
&nbsp;455 &nbsp; &nbsp; &nbsp; &nbsp; # handle requests within SIP dialogs<br>
&nbsp;456 &nbsp; &nbsp; &nbsp; &nbsp; route(WITHINDLG);<br>
<br>
[...]<br>
<br>
&nbsp;473 &nbsp; &nbsp; &nbsp; &nbsp; # record routing for dialog forming
requests (in case<br>
they are routed)<br>
&nbsp;474 &nbsp; &nbsp; &nbsp; &nbsp; # - remove preloaded route headers<br>
&nbsp;475 &nbsp; &nbsp; &nbsp; &nbsp; remove_hf(&quot;Route&quot;);<br>
&nbsp;476 &nbsp; &nbsp; &nbsp; &nbsp; if
(is_method(&quot;INVITE|SUBSCRIBE&quot;))<br>
&nbsp;477 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
record_route();<br>
<br>
and the relevent parts in the &quot;WITHINDLG&quot; route:<br>
<br>
&nbsp;566 # Handle requests within SIP dialogs<br>
&nbsp;567 route[WITHINDLG] {<br>
&nbsp;568 &nbsp; &nbsp; &nbsp; &nbsp; if (has_totag()) {<br>
&nbsp;569 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # sequential
request withing a dialog should<br>
&nbsp;570 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # take the
path determined by record-routing<br>
&nbsp;571 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if
(loose_route()) {<br>
[...]<br>
&nbsp;580 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; route(RELAY);<br>
&nbsp;581 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>
[...]<br>
&nbsp;587 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; if ( is_method(&quot;ACK&quot;) ) {<br>
&nbsp;588 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if ( t_check_trans() ) {<br>
&nbsp;589 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # no
loose-route, but stateful<br>
ACK;<br>
&nbsp;590 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # must be
an ACK after a 487<br>
&nbsp;591 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # or e.g.
404 from upstream<br>
server<br>
&nbsp;592 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; t_relay();<br>
&nbsp;593 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
&nbsp;594 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; } else {<br>
&nbsp;595 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # ACK
without matching<br>
transaction ... ignore and discard<br>
&nbsp;596 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
&nbsp;597 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp;598 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; }<br>
&nbsp;599 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; sl_send_reply(&quot;404&quot;,&quot;Not here&quot;);<br>
&nbsp;600 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp;601 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br>
&nbsp;602 &nbsp; &nbsp; &nbsp; &nbsp; }<br>
&nbsp;603 }<br>
<br>
2012/4/26 Asgaroth &lt;<a href="mailto:00asgaroth00@gmail.com">00asgaroth00@gmail.com</a>&gt;:<br>
&gt; Hi All,<br>
&gt;<br>
&gt; Currently we are running kamailio in a loadbalanced fashion whereby calls<br>
&gt; come in via the loadbalancers and distribute calls accross 2 media<br>
servers.<br>
&gt; We have come accross and issue whereby call transfers may be distributed<br>
&gt; accross two media servers and when the REFER message comes along to<br>
transfer<br>
&gt; the call, in some cases (if we're lucky) the message arrives at the wrong<br>
&gt; media server (transaction leg doesnt exist).<br>
&gt;<br>
&gt; Some googling later and it appears that dispatcher doesnt play nice when<br>
it<br>
&gt; comes to this scenario. Some suggestions popped up in my previous searches<br>
&gt; saying that a potential work around is to use the dialog module to check<br>
if<br>
&gt; a call is eastablished and then to send all calls to the same media server<br>
&gt; based on the dialog already being established.<br>
&gt;<br>
&gt; I'd appreciate some input from the guru's out there that have come accross<br>
&gt; this same issue and, if possible, some suggestions on how to work around<br>
the<br>
&gt; problem, does the dispatcher module have a hashing algorithm that can be<br>
&gt; suited for this particular scenario?<br>
&gt;<br>
&gt; Thanks in advance for any tips or sugestions.<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
&gt; <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
&gt; <a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
&gt;<br>
<br>
<br>
<br>
--<br>
Carsten Bock<br>
CEO (Geschäftsführer)<br>
<br>
ng-voice GmbH<br>
Schomburgstr. 80<br>
D-22767 <st1:State w:st="on">Hamburg</st1:State> / <st1:country-region w:st="on"><st1:place
 w:st="on">Germany</st1:place></st1:country-region><br>
<br>
<a href="http://www.ng-voice.com" target="_blank">http://www.ng-voice.com</a><br>
mailto:<a href="mailto:carsten@ng-voice.com">carsten@ng-voice.com</a><br>
<br>
Mobile <a href="tel:%2B49%20179%202021244" value="+491792021244">+49 179
2021244</a><br>
Office <a href="tel:%2B49%2040%2034927219" value="+494034927219">+49 40
34927219</a><br>
Fax <a href="tel:%2B49%2040%2034927220" value="+494034927220">+49 40 34927220</a><br>
<br>
Sitz der Gesellschaft: <st1:State w:st="on"><st1:place w:st="on">Hamburg</st1:place></st1:State><br>
Registergericht: Amtsgericht <st1:State w:st="on"><st1:place w:st="on">Hamburg</st1:place></st1:State>,
HRB 120189<br>
Geschäftsführer: Carsten Bock<br>
Ust-ID: DE279344284<br>
<br>
Hier finden Sie unsere handelsrechtlichen Pflichtangaben:<br>
<a href="http://www.ng-voice.com/imprint/" target="_blank">http://www.ng-voice.com/imprint/</a><br>
<br>
--<br>
Meet ng-voice at LinuxTag 2012 in <st1:State w:st="on"><st1:place w:st="on">Berlin</st1:place></st1:State>
- May 23rd - 26th, 2012. Save the<br>
date!<br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>-----<br>
No virus found in this message.<br>
Checked by AVG - <a href="http://www.avg.com" target="_blank">www.avg.com</a><br>
Version: 2012.0.1913 / Virus Database: 2411/4959 - Release Date: 04/25/12<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users"
target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><o:p></o:p></span></font></p>

</div>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=1 width="100%" noshade color="#a0a0a0" align=center>

</span></font></div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'
color="#000000"><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>No virus found in this message.<br>
Checked by AVG - <a href="http://www.avg.com">www.avg.com</a><br>
Version: 2012.0.1913 / Virus Database: 2411/4959 - Release Date: 04/25/12<o:p></o:p></span></font></p>

</div>

</body>

</html>