[SR-Users] Incoming DID calls routing to subscriber
Jose N Figueroa
jn at figueroa.blue
Wed Oct 21 09:13:47 CEST 2020
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 at voip.x.net:5060");
# $ru = $var(duri);
$ru=$xavp(ra=>contact);
$ru="sip:1212 at 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
More information about the sr-users
mailing list