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;
}
https://stackoverflow.com/questions/34382070/kamailio-routing-from-did-to-us...
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
Hey David,
In fact I was doing it wrong, it seems I needed a validation before. But the $ru was okay.
Now it works fine! Thanks!
On Wed, Oct 21, 2020 at 12:42:09PM +0100, David Villasmil wrote:
https://stackoverflow.com/questions/34382070/kamailio-routing-from-did-to-us...
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
Glad to be of help! enjoy!
Regards,
David Villasmil email: david.villasmil.work@gmail.com phone: +34669448337
On Thu, Oct 22, 2020 at 6:53 AM Jose Figueroa jn@figueroa.blue wrote:
Hey David,
In fact I was doing it wrong, it seems I needed a validation before. But the $ru was okay.
Now it works fine! Thanks!
On Wed, Oct 21, 2020 at 12:42:09PM +0100, David Villasmil wrote:
https://stackoverflow.com/questions/34382070/kamailio-routing-from-did-to-us...
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
-- Jose Figueroa