Hello,
Is it possible to set up Kamailio 5.4.1 to use IF to determine how calls are proxied depending on the source of the request?
For example, *_if_* calls originate from /pstn.us1.twilio.com/ then _/$du = "sip01.example.com:5060"/_, wheres _*if*_ calls originate from /pstn.us2.twilio.com/ then _/$du = "sip01.example.com:5060"/_.
Additionally, would this also be possible based on numbers? For example, _*if*_ calls are to number +1-800-777-8888 then /$du = "sip01.example.com:5060"/, or if calls are to number +1-800-777-9999 then /$du = "sip02.example.com:5060"/.
To be clear, I don't expect both examples above to work in the same Kamailio instance but IF and AND clauses are possible, such as _*if*_ calls are to number +1-800-777-8888 AND from /pstn.us1.twilio.com/ then _/$du = "sip01.example.com:5060"/_, it'd be great to test this too.
I'm not sure if I'm allowed to ask such specific questions on this mailing list and I hope I'm not asking too much.
Many thanks,
Conrad
Hi,
It is indeed possible, as a basic operation of the Kamailio config script language:
https://www.kamailio.org/wiki/cookbooks/5.4.x/core#if
This kind of thing is usually done using a database lookup rather than something hard-coded--unless the amount of decision points is trivially small, as in your example.
-- Alex
On 9/20/20 8:31 PM, conradcordeiro@gmail.com wrote:
Hello,
Is it possible to set up Kamailio 5.4.1 to use IF to determine how calls are proxied depending on the source of the request?
For example, *_if_* calls originate from /pstn.us1.twilio.com/ then _/$du = "sip01.example.com:5060"/_, wheres _*if*_ calls originate from /pstn.us2.twilio.com/ then _/$du = "sip01.example.com:5060"/_.
Additionally, would this also be possible based on numbers? For example, _*if*_ calls are to number +1-800-777-8888 then /$du = "sip01.example.com:5060"/, or if calls are to number +1-800-777-9999 then /$du = "sip02.example.com:5060"/.
To be clear, I don't expect both examples above to work in the same Kamailio instance but IF and AND clauses are possible, such as _*if*_ calls are to number +1-800-777-8888 AND from /pstn.us1.twilio.com/ then _/$du = "sip01.example.com:5060"/_, it'd be great to test this too.
I'm not sure if I'm allowed to ask such specific questions on this mailing list and I hope I'm not asking too much.
Many thanks,
Conrad
Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
If suggest look into the dialplan and dispatcher modules. You can set an attr based on the source which then translates to a dispatcher group.
On Mon, 21 Sep 2020 at 01:34, Alex Balashov abalashov@evaristesys.com wrote:
Hi,
It is indeed possible, as a basic operation of the Kamailio config
script language:
https://www.kamailio.org/wiki/cookbooks/5.4.x/core#if
This kind of thing is usually done using a database lookup rather than
something hard-coded--unless the amount of decision points is trivially
small, as in your example.
-- Alex
On 9/20/20 8:31 PM, conradcordeiro@gmail.com wrote:
Hello,
Is it possible to set up Kamailio 5.4.1 to use IF to determine how calls
are proxied depending on the source of the request?
For example, *_if_* calls originate from /pstn.us1.twilio.com/ then
_/$du = "sip01.example.com:5060"/_, wheres _*if*_ calls originate from
/pstn.us2.twilio.com/ then _/$du = "sip01.example.com:5060"/_.
Additionally, would this also be possible based on numbers? For example,
_*if*_ calls are to number +1-800-777-8888 then /$du =
"sip01.example.com:5060"/, or if calls are to number +1-800-777-9999
then /$du = "sip02.example.com:5060"/.
To be clear, I don't expect both examples above to work in the same
Kamailio instance but IF and AND clauses are possible, such as _*if*_
calls are to number +1-800-777-8888 AND from /pstn.us1.twilio.com/
then
_/$du = "sip01.example.com:5060"/_, it'd be great to test this too.
I'm not sure if I'm allowed to ask such specific questions on this
mailing list and I hope I'm not asking too much.
Many thanks,
Conrad
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
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
On 9/20/20 10:32 PM, David Villasmil wrote:
If suggest look into the dialplan and dispatcher modules. You can set an attr based on the source which then translates to a dispatcher group
Yeah, but if he really does have just a handful of origins and they never change, he doesn't need to do that.
Well, true if nothing changes. But things change and he probably will add either more sources or not destinations and he probably can also use failover, etc.
On Mon, 21 Sep 2020 at 03:37, Alex Balashov abalashov@evaristesys.com wrote:
On 9/20/20 10:32 PM, David Villasmil wrote:
If suggest look into the dialplan and dispatcher modules. You can set an
attr based on the source which then translates to a dispatcher group
Yeah, but if he really does have just a handful of origins and they
never change, he doesn't need to do that.
--
Alex Balashov | Principal | Evariste Systems LLC
Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)
Web: http://www.evaristesys.com/, http://www.csrpswitch.com/
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