Thanks Marius,<div><br></div><div><br></div><div>that was it.</div><div><br></div><div>Regards</div><div><br></div><div>Javier<br><br><div class="gmail_quote">On Mon, Oct 25, 2010 at 10:08 PM,  <span dir="ltr">&lt;<a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Send sr-users mailing list submissions to<br>
        <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<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><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:sr-users-request@lists.sip-router.org">sr-users-request@lists.sip-router.org</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:sr-users-owner@lists.sip-router.org">sr-users-owner@lists.sip-router.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of sr-users digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. Drouting usage (Javier Gallart)<br>
   2. PSTN call (michel freiha)<br>
   3. Re: Drouting usage (marius zbihlei)<br>
   4. bflag under failure_route (kamailio 1.5) (I?aki Baz Castillo)<br>
   5. Re: bflag under failure_route (kamailio 1.5)<br>
      (Daniel-Constantin Mierla)<br>
   6. Re: bflag under failure_route (kamailio 1.5) (I?aki Baz Castillo)<br>
   7. Re: bflag under failure_route (kamailio 1.5)<br>
      (Daniel-Constantin Mierla)<br>
   8. Re: bflag under failure_route (kamailio 1.5) (I?aki Baz Castillo)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 25 Oct 2010 15:16:56 +0200<br>
From: Javier Gallart &lt;<a href="mailto:jgallartm@gmail.com">jgallartm@gmail.com</a>&gt;<br>
Subject: [SR-Users] Drouting usage<br>
To: <a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
Message-ID:<br>
        &lt;AANLkTik8pWtu9uT1=<a href="mailto:mPb_zSnztej5kHzPrEVPubgzeY7@mail.gmail.com">mPb_zSnztej5kHzPrEVPubgzeY7@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Hello<br>
<br>
sorry if this sounds too &quot;newbie&quot;. I&#39;m interested in the drouting module.<br>
The first INVITE is correctly forwarded to the gw foudn in the drouting<br>
table:<br>
if (is_method(&quot;INVITE&quot;) &amp;&amp; !has_totag()) {<br>
                do_routing(&quot;0&quot;);<br>
                record_route();<br>
        }<br>
However for subsequent messages (ACK, BYE) in the dialog I don&#39;t know how to<br>
keep track of the ip resolved by the drouting logic so the messages are<br>
correctly forwarded to the same gw. I&#39;ve made some tests using the dialog<br>
module with no success. Any hint?<br>
<br>
Thanks in advance<br>
<br>
Javier<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/8c5c5a6c/attachment-0001.htm" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/8c5c5a6c/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Mon, 25 Oct 2010 16:49:24 +0300<br>
From: michel freiha &lt;<a href="mailto:michofr@gmail.com">michofr@gmail.com</a>&gt;<br>
Subject: [SR-Users] PSTN call<br>
To: <a href="mailto:users@lists.kamailio.org">users@lists.kamailio.org</a><br>
Message-ID:<br>
        &lt;<a href="mailto:AANLkTimkdfnxTaaRb8gvKdb4hAen8EY03wO9MK6mNKPy@mail.gmail.com">AANLkTimkdfnxTaaRb8gvKdb4hAen8EY03wO9MK6mNKPy@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;<br>
<br>
Dear All,<br>
<br>
Can someone help me to connect my kamilio in order to make a PSTN call by<br>
rewriting host tp PSTN gateway? I changed my config in a manner to do<br>
that...The line is ringing but as soon as I open the line on other side the<br>
call will hangup...Please find the piece of code<br>
<br>
# RTPProxy control<br>
route[RTPPROXY] {<br>
#!ifdef WITH_NAT<br>
        if (is_method(&quot;BYE&quot;)) {<br>
                unforce_rtp_proxy();<br>
        } else if (is_method(&quot;INVITE&quot;)){<br>
rewritehost(&quot;XX.XX.XX.XX&quot;);<br>
                force_rtp_proxy();<br>
        }<br>
        if (!has_totag()) add_rr_param(&quot;;nat=yes&quot;);<br>
#!endif<br>
        return;<br>
}<br>
<br>
<br>
Regards<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/eeae5259/attachment-0001.htm" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/eeae5259/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 25 Oct 2010 16:51:32 +0300<br>
From: marius zbihlei &lt;<a href="mailto:marius.zbihlei@1and1.ro">marius.zbihlei@1and1.ro</a>&gt;<br>
Subject: Re: [SR-Users] Drouting usage<br>
To: &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4CC58B64.4040609@1and1.ro">4CC58B64.4040609@1and1.ro</a>&gt;<br>
Content-Type: text/plain; charset=&quot;iso-8859-1&quot;; Format=&quot;flowed&quot;<br>
<br>
On 10/25/2010 04:16 PM, Javier Gallart wrote:<br>
&gt; Hello<br>
&gt;<br>
&gt; sorry if this sounds too &quot;newbie&quot;. I&#39;m interested in the drouting<br>
&gt; module. The first INVITE is correctly forwarded to the gw foudn in the<br>
&gt; drouting table:<br>
&gt; if (is_method(&quot;INVITE&quot;) &amp;&amp; !has_totag()) {<br>
&gt;                 do_routing(&quot;0&quot;);<br>
&gt;                 record_route();<br>
&gt;         }<br>
&gt; However for subsequent messages (ACK, BYE) in the dialog I don&#39;t know<br>
&gt; how to keep track of the ip resolved by the drouting logic so the<br>
&gt; messages are correctly forwarded to the same gw. I&#39;ve made some tests<br>
&gt; using the dialog module with no success. Any hint?<br>
&gt;<br>
&gt; Thanks in advance<br>
&gt;<br>
&gt; Javier<br>
Hello<br>
<br>
You might want to use loose_route() to perform loose routing (defined in<br>
RFC 3261) of in-dialog requests. (Loose_route also performs strict routing)<br>
<br>
if (has_totag()){<br>
     loose_route();<br>
     t_relay();<br>
     exit;<br>
}<br>
<br>
Marius<br>
<br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/bc0d7d5d/attachment-0001.htm" target="_blank">http://lists.sip-router.org/pipermail/sr-users/attachments/20101025/bc0d7d5d/attachment-0001.htm</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Mon, 25 Oct 2010 18:25:17 +0200<br>
From: I?aki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
Subject: [SR-Users] bflag under failure_route (kamailio 1.5)<br>
To: SR-Users &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
Message-ID:<br>
        &lt;AANLkTim-GAn9=<a href="mailto:VkdsfaGgQfN1Eppx%2BGLA5Atc0ApZP-w@mail.gmail.com">VkdsfaGgQfN1Eppx+GLA5Atc0ApZP-w@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
Hi, I know that handling bflags outside of branch_route is not a good<br>
idea. Anyhow I have a doubt:<br>
<br>
1) In a normal route I set &quot;setbflag(i:1)&quot;, so the bflag will be set<br>
for all the branches that could be generated  for this incoming<br>
transaction. This also involves creating new branches manually under<br>
failure_route, am I right?<br>
Note: I do know that it would be much better just to use flag instead of bflags.<br>
<br>
2) The outgoing transaction(s) fail so I enter into failure_route. If<br>
I inspect here bflag(i:1) will it be set or not? I remember that it<br>
will be set.<br>
<br>
3) Then I call append_branch in failure_route, or perhaps call<br>
loockup(&quot;location&quot;) and I expect that all the generated branches will<br>
have the bflag set, am I right?<br>
<br>
Thanks a lot.<br>
<br>
--<br>
I?aki Baz Castillo<br>
&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 5<br>
Date: Mon, 25 Oct 2010 18:31:41 +0200<br>
From: Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;<br>
Subject: Re: [SR-Users] bflag under failure_route (kamailio 1.5)<br>
To: I?aki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
Cc: SR-Users &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4CC5B0ED.5080309@gmail.com">4CC5B0ED.5080309@gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8; format=flowed<br>
<br>
Hello,<br>
<br>
On 10/25/10 6:25 PM, I?aki Baz Castillo wrote:<br>
&gt; Hi, I know that handling bflags outside of branch_route is not a good<br>
&gt; idea. Anyhow I have a doubt:<br>
&gt;<br>
&gt; 1) In a normal route I set &quot;setbflag(i:1)&quot;<br>
<br>
why are you using &quot;i:1&quot;? The parameter must be just 1.<br>
<br>
&gt; , so the bflag will be set<br>
&gt; for all the branches that could be generated  for this incoming<br>
&gt; transaction. This also involves creating new branches manually under<br>
&gt; failure_route, am I right?<br>
&gt; Note: I do know that it would be much better just to use flag instead of bflags.<br>
&gt;<br>
&gt; 2) The outgoing transaction(s) fail so I enter into failure_route. If<br>
&gt; I inspect here bflag(i:1) will it be set or not? I remember that it<br>
&gt; will be set.<br>
&gt;<br>
&gt; 3) Then I call append_branch in failure_route, or perhaps call<br>
&gt; loockup(&quot;location&quot;) and I expect that all the generated branches will<br>
&gt; have the bflag set, am I right?<br>
never used in this way, but the normal usage is per branch and when you<br>
do it in the main route then it is just for first branch.<br>
<br>
Cheers,<br>
Daniel<br>
&gt; Thanks a lot.<br>
&gt;<br>
<br>
--<br>
Daniel-Constantin Mierla<br>
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 6<br>
Date: Mon, 25 Oct 2010 18:35:46 +0200<br>
From: I?aki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
Subject: Re: [SR-Users] bflag under failure_route (kamailio 1.5)<br>
To: <a href="mailto:miconda@gmail.com">miconda@gmail.com</a><br>
Cc: SR-Users &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
Message-ID:<br>
        &lt;AANLkTikYQv+bY1jTQiktgeKORB+AC6TrxJbo=<a href="mailto:jEAhJcn@mail.gmail.com">jEAhJcn@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
2010/10/25 Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;:<br>
&gt; why are you using &quot;i:1&quot;? The parameter must be just 1.<br>
<br>
Sorry, just a typo in the mail :)<br>
<br>
<br>
&gt;&gt; , so the bflag will be set<br>
&gt;&gt; for all the branches that could be generated ?for this incoming<br>
&gt;&gt; transaction. This also involves creating new branches manually under<br>
&gt;&gt; failure_route, am I right?<br>
&gt;&gt; Note: I do know that it would be much better just to use flag instead of<br>
&gt;&gt; bflags.<br>
&gt;&gt;<br>
&gt;&gt; 2) The outgoing transaction(s) fail so I enter into failure_route. If<br>
&gt;&gt; I inspect here bflag(i:1) will it be set or not? I remember that it<br>
&gt;&gt; will be set.<br>
&gt;&gt;<br>
&gt;&gt; 3) Then I call append_branch in failure_route, or perhaps call<br>
&gt;&gt; loockup(&quot;location&quot;) and I expect that all the generated branches will<br>
&gt;&gt; have the bflag set, am I right?<br>
&gt;<br>
&gt; never used in this way, but the normal usage is per branch and when you do<br>
&gt; it in the main route then it is just for first branch.<br>
<br>
It&#39;s more curiosity than need. But anyhow I&#39;m 90% sure that if you set<br>
a bflag in route then it will be set for all the branches generated<br>
during loockup(location). Not sure what happens in case of serial<br>
forking using append_branch() in failure_route...<br>
<br>
--<br>
I?aki Baz Castillo<br>
&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 7<br>
Date: Mon, 25 Oct 2010 21:38:52 +0200<br>
From: Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;<br>
Subject: Re: [SR-Users] bflag under failure_route (kamailio 1.5)<br>
To: I?aki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
Cc: SR-Users &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
Message-ID: &lt;<a href="mailto:4CC5DCCC.5010909@gmail.com">4CC5DCCC.5010909@gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8; format=flowed<br>
<br>
<br>
<br>
On 10/25/10 6:35 PM, I?aki Baz Castillo wrote:<br>
&gt; 2010/10/25 Daniel-Constantin Mierla&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;:<br>
&gt;&gt; why are you using &quot;i:1&quot;? The parameter must be just 1.<br>
&gt; Sorry, just a typo in the mail :)<br>
&gt;<br>
&gt;<br>
&gt;&gt;&gt; , so the bflag will be set<br>
&gt;&gt;&gt; for all the branches that could be generated  for this incoming<br>
&gt;&gt;&gt; transaction. This also involves creating new branches manually under<br>
&gt;&gt;&gt; failure_route, am I right?<br>
&gt;&gt;&gt; Note: I do know that it would be much better just to use flag instead of<br>
&gt;&gt;&gt; bflags.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2) The outgoing transaction(s) fail so I enter into failure_route. If<br>
&gt;&gt;&gt; I inspect here bflag(i:1) will it be set or not? I remember that it<br>
&gt;&gt;&gt; will be set.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; 3) Then I call append_branch in failure_route, or perhaps call<br>
&gt;&gt;&gt; loockup(&quot;location&quot;) and I expect that all the generated branches will<br>
&gt;&gt;&gt; have the bflag set, am I right?<br>
&gt;&gt; never used in this way, but the normal usage is per branch and when you do<br>
&gt;&gt; it in the main route then it is just for first branch.<br>
&gt; It&#39;s more curiosity than need. But anyhow I&#39;m 90% sure that if you set<br>
&gt; a bflag in route then it will be set for all the branches generated<br>
&gt; during loockup(location).<br>
<br>
Looked in the code and I saw that only first branch inherits the branch<br>
flags from main route, the other takes only the value from location records.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
&gt;   Not sure what happens in case of serial<br>
&gt; forking using append_branch() in failure_route...<br>
&gt;<br>
<br>
--<br>
Daniel-Constantin Mierla<br>
<a href="http://www.asipto.com" target="_blank">http://www.asipto.com</a><br>
<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 8<br>
Date: Mon, 25 Oct 2010 22:08:27 +0200<br>
From: I?aki Baz Castillo &lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
Subject: Re: [SR-Users] bflag under failure_route (kamailio 1.5)<br>
To: Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;<br>
Cc: SR-Users &lt;<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a>&gt;<br>
Message-ID:<br>
        &lt;AANLkTi=<a href="mailto:iuYLwaignfOcKGsgFnE57gnn45DgRrzSZogUW@mail.gmail.com">iuYLwaignfOcKGsgFnE57gnn45DgRrzSZogUW@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=UTF-8<br>
<br>
2010/10/25 Daniel-Constantin Mierla &lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</a>&gt;:<br>
&gt; Looked in the code and I saw that only first branch inherits the branch<br>
&gt; flags from main route, the other takes only the value from location records.<br>
<br>
Ok, so better to be careful with this and use blfag just under branch_route :)<br>
<br>
PS: Perhaps would it make sense a constrain so setbflag(),<br>
isbflagset() and resetbflag() cannot be used in route and<br>
failure_route anymore?<br>
<br>
--<br>
I?aki Baz Castillo<br>
&lt;<a href="mailto:ibc@aliax.net">ibc@aliax.net</a>&gt;<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
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><br>
<br>
<br>
End of sr-users Digest, Vol 65, Issue 99<br>
****************************************<br>
</blockquote></div><br></div>