https://stackoverflow.com/questions/34382070/kamailio-routing-from-did-to-user#34418343


On Wed, 21 Oct 2020 at 08:15, Jose N Figueroa <jn@figueroa.blue> wrote:
Hello everybody,

I'm trying to route incoming calls to kamailio with specific subscriber
but I can't make it working.

The complete scenario is:

SoftSwith -> kamailio 5.3 -> zoiper

What i'm trying to do is to receive a call into the zoiper when I dial
specific DID which is already coming into the kamailio. It goes until
the routing from kamilio to the subscriber account but it keeps in
INVITE command, no response from the subscriber. Any help would be great!

This is what I've been trying but no luck yet:

if($rdir(name)=="downstream") {
                  xlog("DID request was incoming call, called number:
$rU  caller_id: $fU and source_ip $si \n");
                 $sht(rtpProxy=>mip_$ci)=1;
                 # We should take the called_number as username in table

                 # Also validate if the number has active that DID,
balance if needed, etc.
                 # route(validate_customer);

                 # I know, hardcoded for testing

                 sql_xquery("ca", "select * from location where username
= 1212 ", "ra");
                 $avp(location_addr) = $xavp(ra=>received);
                 xlog("DID did_incoming location is $xavp(ra=>received)
\n");

                 # Validate SIP OK
                 #setflag(SIP_IP_OK);
                 #$rU=$avp(dnis);
                 #$rd=$avp(identity);
                 #$rp=$avp(port);
#               uac_replace_to($xavp(ra=>contact));
                 uac_replace_to("sip:1212@voip.x.net:5060");
#               $ru = $var(duri);
                 $ru=$xavp(ra=>contact);
                 $ru="sip:1212@voip.x.net:5060";

                 route(RELAY);

         #       t_on_failure("dst_failure");
         #       t_on_reply("dst_reply");
                 if(!t_relay()) {
                         sl_reply_error();
                         exit;
                 }
                 exit;

         }



--
Regards,
Jose N Figueroa


_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Regards,

David Villasmil
email: david.villasmil.work@gmail.com
phone: +34669448337