<div dir="ltr">Glad to be of help! enjoy!<div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 22, 2020 at 6:53 AM Jose Figueroa <jn@figueroa.blue> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey David,<br>
<br>
In fact I was doing it wrong, it seems I needed a validation before. But the<br>
$ru was okay.<br>
<br>
Now it works fine! Thanks!<br>
<br>
On Wed, Oct 21, 2020 at 12:42:09PM +0100, David Villasmil wrote:<br>
> <a href="https://stackoverflow.com/questions/34382070/kamailio-routing-from-did-to-user#34418343" rel="noreferrer" target="_blank">https://stackoverflow.com/questions/34382070/kamailio-routing-from-did-to-user#34418343</a><br>
> <br>
> <br>
> On Wed, 21 Oct 2020 at 08:15, Jose N Figueroa <jn@figueroa.blue> wrote:<br>
> <br>
> > Hello everybody,<br>
> ><br>
> > I'm trying to route incoming calls to kamailio with specific subscriber<br>
> > but I can't make it working.<br>
> ><br>
> > The complete scenario is:<br>
> ><br>
> > SoftSwith -> kamailio 5.3 -> zoiper<br>
> ><br>
> > What i'm trying to do is to receive a call into the zoiper when I dial<br>
> > specific DID which is already coming into the kamailio. It goes until<br>
> > the routing from kamilio to the subscriber account but it keeps in<br>
> > INVITE command, no response from the subscriber. Any help would be great!<br>
> ><br>
> > This is what I've been trying but no luck yet:<br>
> ><br>
> > if($rdir(name)=="downstream") {<br>
> >                   xlog("DID request was incoming call, called number:<br>
> > $rU  caller_id: $fU and source_ip $si \n");<br>
> >                  $sht(rtpProxy=>mip_$ci)=1;<br>
> >                  # We should take the called_number as username in table<br>
> ><br>
> >                  # Also validate if the number has active that DID,<br>
> > balance if needed, etc.<br>
> >                  # route(validate_customer);<br>
> ><br>
> >                  # I know, hardcoded for testing<br>
> ><br>
> >                  sql_xquery("ca", "select * from location where username<br>
> > = 1212 ", "ra");<br>
> >                  $avp(location_addr) = $xavp(ra=>received);<br>
> >                  xlog("DID did_incoming location is $xavp(ra=>received)<br>
> > \n");<br>
> ><br>
> >                  # Validate SIP OK<br>
> >                  #setflag(SIP_IP_OK);<br>
> >                  #$rU=$avp(dnis);<br>
> >                  #$rd=$avp(identity);<br>
> >                  #$rp=$avp(port);<br>
> > #               uac_replace_to($xavp(ra=>contact));<br>
> >                  uac_replace_to("<a href="http://sip:1212@voip.x.net:5060" rel="noreferrer" target="_blank">sip:1212@voip.x.net:5060</a>");<br>
> > #               $ru = $var(duri);<br>
> >                  $ru=$xavp(ra=>contact);<br>
> >                  $ru="<a href="http://sip:1212@voip.x.net:5060" rel="noreferrer" target="_blank">sip:1212@voip.x.net:5060</a>";<br>
> ><br>
> >                  route(RELAY);<br>
> ><br>
> >          #       t_on_failure("dst_failure");<br>
> >          #       t_on_reply("dst_reply");<br>
> >                  if(!t_relay()) {<br>
> >                          sl_reply_error();<br>
> >                          exit;<br>
> >                  }<br>
> >                  exit;<br>
> ><br>
> >          }<br>
> ><br>
> ><br>
> ><br>
> > --<br>
> > Regards,<br>
> > Jose N Figueroa<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > Kamailio (SER) - Users Mailing List<br>
> > <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br>
> > <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br>
> ><br>
> -- <br>
> Regards,<br>
> <br>
> David Villasmil<br>
> email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a><br>
> phone: +34669448337<br>
<br>
-- <br>
Jose Figueroa<br>
</blockquote></div>