Hello Daniel,<br><br>sorry to not reply faster, even works to do.<br><br>so, I tried other ways to forward : call forward unconditional, backup, busy, and non answer + time pre-defined.<br>I created a route with t_check_status(&quot;&quot;) for 4xx replies, and use an AVP to rewrite correctly the stuff.<br>

<br>here&#39;s a sample :<br><br> if (t_check_status(&quot;408&quot;))<br> {<br>  if (is_avp_set(&quot;$avp(s:callee_cfbk)/s&quot;))<br>  {<br>   xlog(&quot;L_INFO&quot;, &quot;callee can&#39;t be reached, forward to $avp(s:callee_cfbk)&quot;);<br>

   avp_copy(&quot;$avp(s:callee_cli)/s&quot;, &quot;$avp(s:callee_fwd)/s&quot;);<br>   avp_delete(&quot;$avp(s:callee_cli)/g&quot;);<br>   avp_copy(&quot;$avp(s:callee_cfbk)/s&quot;, &quot;$avp(s:callee_cli)/s&quot;);<br>

   avp_pushto(&quot;$ru/username&quot;, &quot;$avp(s:callee_cfbk)&quot;);<br>   avp_copy(&quot;$avp(s:callee_realm)/s&quot;, &quot;$avp(s:callee_fwd_realm)/s&quot;);<br>   route(27); # proper accounting for forward<br>   setflag(9); # flag to stamp &quot;forwarded&quot;<br>

<br>   # diversion header:<br>   if (!search(&quot;Diversion:.*&quot;))<br>   {<br>    xlog(&quot;L_INFO&quot;, &quot;append the diversion header&quot;);<br>    add_diversion(&quot;backup;privacy=none;counter=1&quot;);<br>

   }<br>   else<br>   {<br>    xlog(&quot;L_INFO&quot;, &quot;-&gt; 403: diversion header already found, forbidden to forward one more time&quot;);<br>    sl_send_reply(&quot;403&quot;, &quot;Forbidden&quot;);<br>    exit;<br>

   }<br>   route(11); # new callee infos searching<br>   exit;<br>  }<br>  else<br>  {<br>   xlog(&quot;L_INFO&quot;, &quot;-&gt; 408: request timeout&quot;);<br>   sl_send_reply(&quot;408&quot;,&quot;Request Timeout&quot;);<br>

   exit;<br>  }<br> } <br><br><br>I think I can&#39;t take in charge all the ways the constructors use forward systems (diversion, rewrite, redirect, forward, ...).<br>I centralized that in my IS directly and told my customers to use a control panel instead of directly in their ip phone - they&#39;re not really happy but ... they&#39;re a few people in the case where the phones are directly connected to my sip proxies. Others wants a small ipbx, who does the entreprise stuff.<br>

<br><br>Do you think that for that kind of end-user (no ipbx), a SBC in my voice edge architecture could do the job better ?<br><br>thanks a lot,<br><br>.Sam.<br><br><div class="gmail_quote">On Thu, Jan 14, 2010 at 11:31 AM, Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com">miconda@gmail.com</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;">


  

<div bgcolor="#ffffff" text="#000000">
Hello,<div class="im"><br>
<br>
On 1/13/10 10:59 PM, Samuel Muller wrote:
<blockquote type="cite">Hello Daniel,<br>
  <br>
thanks for your answer.<br>
  <br>
I&#39;m using route(3) to find the new callee, using a radius request (no
DB for this kind of request).<br>
Using t_relay(), I just forward the request without try to know if the
new callee is one of my own user, isn&#39;t it ?<br clear="all">
In an operator way, I&#39;ve to control the &quot;who&#39;s who&quot; ...<br>
  <br>
I took this part of config in the sipwise tool :<br>
  <br>
after the get_redirect in the failure_route() :<br>
  <br>
$avp(s:fwdtmpds) = $ds;<br>
avp_subst(&quot;$avp(s:fwdtmpds)&quot;, &quot;/.*(<a>sip:.+@</a>[^:;&gt;]+).*$/\1/&quot;);<br>
avp_pushto(&quot;$ru&quot;, &quot;$avp(s:fwdtmpds)&quot;);<br>
# flag call fwd (for acc, permissions, rtp proxying, ...)<br>
setflag(17);<br>
append_branch();<br>
t_on_branch(&quot;1&quot;);<br>
# route to find the new callee<br>
route(3);<br>
exit;<br>
}<br>
  <br>
It works, but it&#39;s not a clean way, and really difficult to replace
good avps, determinates rtp proxying (one way audio only when the UAC
who forwarded the call is behind nat), delete few double insertion of
P-Hints. Accouting is really hard to clean too (who pays the first call
pstn -&gt; phone, and who&#39;s paying call to redirected number, then
consider all of them as only one call for billing system).<br>
</blockquote>
<br></div>
Can you grab a sip trace and send it of an entire scenario (from
initial invite). Would help to understand what is happening and what is
not a clean way.<br>
<br>
Cheers,<br><font color="#888888">
Daniel</font><div><div></div><div class="h5"><br>
<br>
<blockquote type="cite"><br>
With SIP over TCP, it doesn&#39;t work (it creates two pinholes, and I&#39;ve
errors on the debug logs). I&#39;m afraid to test all of this stuff with
TLS ... <br>
  <br>
Do you think that a dedicated redirect server is a better way to take
in charge call forwards ? so I could use the t_relay() function.<br>
Sure the best practice is to use SBC, IPBX, media servers and/or real
class5 softswitch to do all the advanced voice services, but in some
case ...<br>
  <br>
Does someone developped a sip-i module eventually ?<br>
it could be a nice feature for operators who are blocked by the call
forwards systems, few parts of ISUP must be taken in charge sometimes,
like when you have to forward a call to a PSTN gateway interconnected
in SS7 with a tier1-operator.<br>
  <br>
Cheers,<br>
  <br>
.Sam.<br>
  <br>
  <br>
  <div class="gmail_quote">On Wed, Jan 13, 2010 at 12:44 PM,
Daniel-Constantin Mierla <span dir="ltr">&lt;<a href="mailto:miconda@gmail.com" target="_blank">miconda@gmail.com</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;">Hello,
    <div>
    <div><br>
    <br>
On 1/11/10 1:56 PM, Samuel Muller wrote:<br>
    <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello all,<br>
      <br>
I&#39;ve questions &#39;bout the redirect/forward with 30x requests.<br>
      <br>
Actually, it does not work, it seems the uac redirect module doesn&#39; t
use the new contact for the new invite.<br>
      <br>
simple schema : pstn gw -&gt; kamailio -&gt; linksys -&gt; call forward
unconditionnal to another pstn number -&gt; kamailio -&gt; gw pstn<br>
      <br>
the 302 as seen with ngrep tool :<br>
      <br>
#SIP/2.0 302 Moved Temporarily.<br>
#To: <a>&lt;sip:B@sip_proxy;user=phone&gt;</a>;tag=91515579fff6b8d1i0.<br>
#From:
<a>&lt;sip:A@pstn_gw1;user=phone&gt;</a>;tag=16627-UI-00020cf3-54eea92c4.<br>
#Call-ID: 16627-RO-00020cf2-4186e9762@pstn_gw1.<br>
#CSeq: 81990 INVITE.<br>
#Via: SIP/2.0/UDP sip_proxy;branch=z9hG4bK0f0c.22989b87.1.<br>
#Via: SIP/2.0/UDP
pstn_gw1:5060;rport=5060;received=ip_pstn_gw1;branch=z9hG4bK-25EA-243F3.<br>
#Record-Route:
<a>&lt;sip:sip_proxy;lr=on;ftag=16627-UI-00020cf3-54eea92c4;did=f65.bcc44f06&gt;</a>.<br>
#Contact: <a>&lt;sip:C@sip_proxy&gt;</a>.<br>
#Diversion: &quot;B&quot; <a>&lt;sip:B@sip_proxy&gt;</a>;reason=unconditional.<br>
#Server: Linksys/SPA942-6.1.3(a).<br>
      <br>
DBG:uac_redirect:shmcontact2dset: adding contact <a>&lt;sip:C@sip_proxy&gt;</a><br>
dest set : Contact: <a>sip:B@ip_B</a>, <a>&lt;sip:C@sip_proxy&gt;</a>;q=0.01<br>
contact $ct: <a>&lt;sip:pstn_gw1:5060&gt;</a><br>
      <br>
the second pstn gateway received a request to B, and not C (so it
creates a loop through pstn ...).<br>
      <br>
in my config :<br>
      <br>
loadmodule &quot;uac.so&quot;<br>
modparam(&quot;uac&quot;, &quot;rr_store_param&quot;, &quot;vsf&quot;)<br>
modparam(&quot;uac&quot;, &quot;from_restore_mode&quot;, &quot;auto&quot;)<br>
      <br>
loadmodule &quot;uac_redirect.so&quot;<br>
modparam(&quot;uac_redirect&quot;, &quot;default_filter&quot;, &quot;accept&quot;)<br>
modparam(&quot;uac_redirect&quot;,&quot;bflags&quot;, 1)<br>
      <br>
loadmodule &quot;diversion.so&quot;<br>
      <br>
failure_route[2]<br>
{<br>
       setdebug(4);<br>
      <br>
       if (t_check_status(&quot;301|302&quot;))<br>
       {<br>
               route(26)     # acc fwd<br>
               $avp(s:acc_status) = &quot;cfu&quot;;<br>
      <br>
               if (!get_redirects(&quot;2:1&quot;))<br>
               {<br>
                       xlog(&quot;L_NOTICE&quot;, &quot;failed to extract contact info
from 30x header&quot;);<br>
                       route(10);      # stop rtp<br>
                       t_reply(&quot;480&quot;, &quot;Temporarily Unavailable&quot;);<br>
                       exit;<br>
               }<br>
      <br>
               # flag 3xx status, open a new branch and back to find
the new callee<br>
               setflag(28);<br>
               append_branch();<br>
               t_on_branch(&quot;1&quot;);<br>
               route(3);     # search the new callee<br>
               setdebug();<br>
               exit;<br>
       }<br>
      <br>
       t_on_branch(&quot;1&quot;);<br>
       setdebug();<br>
       route(3);       # find callee<br>
       route(12);      # local outbound<br>
       route(10);      # stop rtp<br>
}<br>
      <br>
I&#39;m using lcr module to route calls, kamailio v. 1.5.3.<br>
      <br>
I&#39;ve another question, is the 30x always considered as a failure_route ?<br>
      <br>
Any help and/or explanations about the tricks would be really
appreciated ... thanks,<br>
    </blockquote>
    </div>
    </div>
as I can see from you comments, in failure_route you get the contacts
from 30x and append branch then call route(3) which is find callee --
what is that, is it appending another branch? Practically after append
branch you should just do relay.<br>
    <br>
Cheers,<br>
Daniel<br>
    <font color="#888888"><br>
-- <br>
Daniel-Constantin Mierla<br>
* <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a><br>
    <br>
    </font></blockquote>
  </div>
  <br>
</blockquote>
<br>
<pre cols="72">-- 
Daniel-Constantin Mierla
* <a href="http://www.asipto.com/" target="_blank">http://www.asipto.com/</a>
</pre>
</div></div></div>

</blockquote></div><br>