No subject


Wed Jun 27 05:48:46 CEST 2012


dispatches it to one of the two IVR in round-robin.
I'm testing this way and not calling directly to Kamailio because in the
production enviroment, calls will be coming from outside.


Attached you will find the Kamailio configuration.
Packet capture made at the Kamailio host, where you can see the BYE
package from the
PBX (first one on line 24) but no BYE package sent to the IVRs is here:
http://cringer.3kh.net/web/misc/sip.cap <http://cringer.3kh.net/web/misc/=
sip.cap>


Please let me know if I ommited any important detail of my setup and
thanks in advance.


Best regards.

--=20
Ariel Wainer





----------

_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users at lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users <http://lis=
ts.sip-router.org/cgi-bin/mailman/listinfo/sr-users>


--_d32c_-------cf73e2a262275a00734bdefcdcebccfb
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">Hi Ariel.</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">The problem with Your routi=
ng logic is that You don't route in-dialog messages.</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span style=3D"font-size: 1=
0pt;">Basically, Your request_route should look something like this:</spa=
n></p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">request_route {</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span># per request initial checks</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>route(REQINIT);</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span># CANCEL processing</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>if (is_method("CANCEL"))</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>{</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>if (t_check_trans())</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>t_relay();</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>exit;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>}</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span># handle requests within SIP dial=
ogs</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>route(WITHINDLG);</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span># record routing for dialog formi=
ng requests (in case they are routed)</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span># - remove preloaded route header=
s</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>remove_hf("Route");</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>if (is_method("INVITE|SUBSCRIBE")=
)</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>record_route();</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>if ($rU=3D=3D$null)</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>{</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span># request with no Username in RUR=
I</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>sl_send_reply("484","Address Inco=
mplete");</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>exit;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>}</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>if (is_method("INVITE"))</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>route(LOADBALANCE);</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>route(RELAY);</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">}</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">There is a lot of things (l=
ike initial messages checks) that should be done before routing the messa=
ge to Media server.</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">As You can see, route(WITHI=
NDLG) is called even before route(LOADBALANCE). This ensures that message=
s following the INVITE (BYE included) will be routed</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">to Media server (which will=
 solve your problem).</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">However, when calling route=
(WITHINDLG) You should take care when recieving INVITE with preloaded set=
 of Route headers. They might cause Kamailio to consider the INVITE</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">within other dialog and rou=
te it incorectly (completely bypassing the Media server).</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">It is also a good practice =
to use the DIALOG module to keep track about ongoing calls and log them i=
n the database (for example).</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><br />
The request_route I wrote above might require some customization from You=
, in order to take care about requests You don't wish to forward to</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">Media servers (such as Pres=
ence related requests and so on..).</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">In route(LOADBALANCE) you s=
hould have something like this:</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">route[LOADBALANCE] {</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>if(!ds_select_dst("0", "4"))</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>{</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>xlog("L_NOTICE", "---- No Media s=
erver available! sending 404 and exiting.");</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>send_reply("404", "No destination=
");</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>exit;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>}</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>xlog("L_DBG", "--- Media server s=
elected! Going to &lt;$ru&gt; via &lt;$du&gt;\n");</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>#for failure speed:</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>t_set_fr(0,2000);</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><span class=3D"Apple-tab-sp=
an" style=3D"white-space: pre;"> </span>return;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">}</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">Your failure_route looks ok=
, no changes there I would say.</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">&nbsp;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">Cheers,</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">Martin</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">___________________________=
___________________________________<br />
&gt; Od: "Ariel Wainer" &lt;awainer at contentamobile.com&gt;<br />
&gt; Komu: &lt;sr-users at lists.sip-router.org&gt;<br />
&gt; D&aacute;tum: 19.04.2013 17:43<br />
&gt; Predmet: [SR-Users] Load balancer using dispatcher / BYE relaying<br=
 />
&gt;</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">StartFragmentHi, I'm new to=
 Kamailio and I'm trying to setup a load<br />
balancer using Kamailio 4.0 and rtpproxy, to balance between 2 asterisk<b=
r />
servers that provide an IVR service.<br />
<br />
I've followed several guides, and so far it seems to work along with<br /=
>
rtpproxy, except it is not sending the BYE message back to asterisk, and<=
br />
the call never finishes from the asterisk POV.<br />
Let me describe the test scenario: I have the following:<br />
IP phone: 192.168.200.183<br />
PBX: 192.168.200.3<br />
Kamailio: 192.168.200.132<br />
IVR1: 192.168.200.160<br />
<br />
IVR2: 192.168.200.161<br />
<br />
<br />


More information about the sr-users mailing list