Hello,
there are different ways, but it case you want to do it dynamically in the cfg:
https://www.kamailio.org/docs/modules/5.2.x/modules/ipops.html#ipops.f.dns_int_match_ip
Cheers,
Henning
--
Henning Westerholt –
https://skalatan.de/blog/
Kamailio services –
https://gilawa.com
From: sr-users <sr-users-bounces@lists.kamailio.org>
On Behalf Of Abdirahman A. Osman
Sent: Friday, May 29, 2020 4:33 PM
To: sr-users@lists.kamailio.org
Subject: [SR-Users] ds_is_from_list with domain
Hello,
I am using freeswitch in kubernetes and IPaddresses are not fixed instead I am using domain names in the dispatcher.list. Also I am using ds_is_from_list to set the destination to either upstream or downstream.
The issue I have is that when freeswitch sends an invite message to Kamailio it is sending IP address and dispatcher.list is in domain format. What will be the best way to match these two? Currently calls are failing with 404 No destination
Here
# Dispatch requests
route[DISPATCH] {
if(ds_is_from_list("9")) {
ds_select_dst("1","4");
t_on_failure("RTF_DISPATCH");
route(RELAY);
exit;
}
if(ds_is_from_list("1")) {
ds_select_dst("9","4");
t_on_failure("RTF_DISPATCH");
route(RELAY);
exit;
}
}
dispatcher.list
# setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attributes(str,opt)
1 sip:a.freeswitch-0.freeswitch-svc.voip.svc.cluster.local:5060 16 0 Freeswitch0
1 sip:a.freeswitch-1.freeswitch-svc.voip.svc.cluster.local:5060 16 0 Freeswitch1
9 sip:172.28.250.189:5060 2 0 mediagw
Thanks!