<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
Hi<br>
<br>
How can I move force_send_socket() call into branch_route? Could
someone give me an example, please.<br>
<br>
Thank you<br>
<br>
<br>
Ernest<br>
<br>
I have this script:<br>
<br>
########################################################################<br>
# Failure route 'pstn-failover'<br>
########################################################################<br>
failure_route[1]<br>
{&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; xlog("L_INFO", "Failure route for PSTN entered - M=$rm RURI=$ru
F=$fu T=$tu IP=$si ID=$ci\n");<br>
&nbsp;&nbsp;&nbsp; route(16);<br>
<br>
&nbsp;&nbsp;&nbsp; if(!next_gw())<br>
&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xlog("L_ERR", "Failed to select next PSTN gateway - M=$rm
RURI=$ru F=$fu T=$tu IP=$si ID=$ci\n");<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; route(5);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; exit;<br>
&nbsp;&nbsp;&nbsp; }<br>
&nbsp;&nbsp;&nbsp; t_on_failure("1");<br>
<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; switch($rd) <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case "10.10.10.2":<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; force_send_socket(udp:10.10.10.1:5060);<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp; case "10.10.10.4":<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; force_send_socket(udp:10.10.10.3:5060);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case "10.10.10.6":<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; force_send_socket(udp:10.10.10.5:5060);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; case "10.10.10.8":<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; force_send_socket(udp:10.10.10.7:5060);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; break;<br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>
<br>
&nbsp;&nbsp;&nbsp; route(7);<br>
}<br>
<br>
<br>
On 29. 06. 2010 13:44, Geoffrey Mina wrote:
<blockquote
 cite="mid:AANLkTilHjnaEsquo0CFg3bj_OqjhDsSMw4LtGA-3aChy@mail.gmail.com"
 type="cite">Yeah, Juha's suggestion worked perfectly.&nbsp; As soon as I
moved the force_send_socket() call into branch_route everything started
working.<br>
  <br>
Thanks.<br>
  <br>
  <div class="gmail_quote">On Tue, Jun 29, 2010 at 5:20 AM, Klaus
Darilion <span dir="ltr">&lt;<a moz-do-not-send="true"
 href="mailto:klaus.mailinglists@pernau.at">klaus.mailinglists@pernau.at</a>&gt;</span>
wrote:<br>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">IIRC
force_send_socket operates on "branch[0]". Now it depends how the the
new branch is added, e.g. if send--socket properties are copied into
new branch or not. IRRC there were some changes either in 1.5 or 3.0.<br>
    <br>
You can also access a branch's aprameter directly:<br>
    <a moz-do-not-send="true"
 href="http://sip-router.org/wiki/cookbooks/pseudo-variables/devel#branch_attributes"
 target="_blank">http://sip-router.org/wiki/cookbooks/pseudo-variables/devel#branch_attributes</a><br>
    <br>
or try Juha's suggestion with branch_route<br>
    <br>
regards<br>
klaus<br>
    <br>
Am 28.06.2010 19:08, schrieb Geoffrey Mina:<br>
    <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
      <div>
      <div class="h5">I am having an issue with 1.5.4 where
force_send_socket() isn't behaving<br>
as I would expect.<br>
      <br>
I have an LCR scenario where depending on which gateway I am sending to,<br>
I send from a different socket.<br>
      <br>
It appears that calling force_send_socket from failure_route has no<br>
affect on the routing. &nbsp;In my initial route block I call<br>
force_send_socket(X.X.X.180:5060). &nbsp;In my failure_route I am calling<br>
force_send_socket(X.X.X.179:5060), yet after calling the subsequent<br>
time, my sip trace and tcpdump are clearly showing kamailio is still<br>
sending from X.X.X.180:5060.<br>
      <br>
I have added a lot of debug lines, so I am 100% sure the second call to<br>
force_send_socket is happening.<br>
      <br>
Am I misusing this module in some way?<br>
      <br>
      <br>
      <br>
      </div>
      </div>
      <div class="im">_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
      <a moz-do-not-send="true"
 href="mailto:sr-users@lists.sip-router.org" target="_blank">sr-users@lists.sip-router.org</a><br>
      <a moz-do-not-send="true"
 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>
      </div>
    </blockquote>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
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>
<br>
<div class="moz-signature">-- <br>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<style type="text/css">
<!--
.style1 {font-family: "Trebuchet MS"}
.style2 {
        font-size: 18px;
        font-weight: bold;
}
.style5 {
        font-size: 16px;
        font-weight: bold;
}
.style6 {
        font-size: 12px;
        font-weight: bold;
}
-->
</style>
<pre class="style1"><span class="style6"><a href="http://novatel.si/"><img
 src="cid:part1.01000705.03040408@novatel.si" height="38" width="125"
 border="0"></a>

</span><span class="style2">Ernest Mavrel
</span>technical support

<span class="style5">Novatel d.o.o.</span>
informacijske tehnologije
Mariborska 88, SI - 3000 Celje

tel: <strong class="style6">+386 (0)82 800 823
</strong>fax: <strong class="style6">+386 (0)82 800 821
</strong>mobile: <span class="style6">+386 (0)51 436 453
</span>e-mail: <a href="mailto:ernest.mavrel@novatel.si" target="_blank"
 title="Ernest Mavrel - Novatel d.o.o.">ernest.mavrel@novatel.si</a> </pre>
</div>
</body>
</html>