<div dir="auto">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.</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 21 Sep 2020 at 01:34, Alex Balashov <<a href="mailto:abalashov@evaristesys.com">abalashov@evaristesys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)">Hi,<br><br><br><br>It is indeed possible, as a basic operation of the Kamailio config <br><br>script language:<br><br><br><br><a href="https://www.kamailio.org/wiki/cookbooks/5.4.x/core#if" rel="noreferrer" target="_blank">https://www.kamailio.org/wiki/cookbooks/5.4.x/core#if</a><br><br><br><br>This kind of thing is usually done using a database lookup rather than <br><br>something hard-coded--unless the amount of decision points is trivially <br><br>small, as in your example.<br><br><br><br>-- Alex<br><br><br><br>On 9/20/20 8:31 PM, <a href="mailto:conradcordeiro@gmail.com" target="_blank">conradcordeiro@gmail.com</a> wrote:<br><br>> Hello,<br><br>> <br><br>> Is it possible to set up Kamailio 5.4.1 to use IF to determine how calls <br><br>> are proxied depending on the source of the request?<br><br>> <br><br>> For example, *_if_* calls originate from /<a href="http://pstn.us1.twilio.com/" rel="noreferrer" target="_blank">pstn.us1.twilio.com/</a> then <br><br>> _/$du = "<a href="http://sip01.example.com:5060" rel="noreferrer" target="_blank">sip01.example.com:5060</a>"/_, wheres _*if*_ calls originate from <br><br>> /<a href="http://pstn.us2.twilio.com/" rel="noreferrer" target="_blank">pstn.us2.twilio.com/</a> then _/$du = "<a href="http://sip01.example.com:5060" rel="noreferrer" target="_blank">sip01.example.com:5060</a>"/_.<br><br>> <br><br>> Additionally, would this also be possible based on numbers? For example, <br><br>> _*if*_ calls are to number +1-800-777-8888 then /$du = <br><br>> "<a href="http://sip01.example.com:5060" rel="noreferrer" target="_blank">sip01.example.com:5060</a>"/, or if calls are to number +1-800-777-9999 <br><br>> then /$du = "<a href="http://sip02.example.com:5060" rel="noreferrer" target="_blank">sip02.example.com:5060</a>"/.<br><br>> <br><br>> To be clear, I don't expect both examples above to work in the same <br><br>> Kamailio instance but IF and AND clauses are possible, such as _*if*_ <br><br>> calls are to number +1-800-777-8888  AND from /<a href="http://pstn.us1.twilio.com/" rel="noreferrer" target="_blank">pstn.us1.twilio.com/</a> then <br><br>> _/$du = "<a href="http://sip01.example.com:5060" rel="noreferrer" target="_blank">sip01.example.com:5060</a>"/_, it'd be great to test this too.<br><br>> <br><br>> I'm not sure if I'm allowed to ask such specific questions on this <br><br>> mailing list and I hope I'm not asking too much.<br><br>> <br><br>> Many thanks,<br><br>> <br><br>> Conrad<br><br>> <br><br>> <br><br>> _______________________________________________<br><br>> Kamailio (SER) - Users Mailing List<br><br>> <a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br><br>> <a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br><br>> <br><br><br><br>-- <br><br>Alex Balashov | Principal | Evariste Systems LLC<br><br><br><br>Tel: +1-706-510-6800 / +1-800-250-5920 (toll-free)<br><br>Web: <a href="http://www.evaristesys.com/" rel="noreferrer" target="_blank">http://www.evaristesys.com/</a>, <a href="http://www.csrpswitch.com/" rel="noreferrer" target="_blank">http://www.csrpswitch.com/</a><br><br><br><br>_______________________________________________<br><br>Kamailio (SER) - Users Mailing List<br><br><a href="mailto:sr-users@lists.kamailio.org" target="_blank">sr-users@lists.kamailio.org</a><br><br><a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users</a><br><br></blockquote></div></div>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Regards,</div><div><br></div>David Villasmil<div>email: <a href="mailto:david.villasmil.work@gmail.com" target="_blank">david.villasmil.work@gmail.com</a></div><div>phone: +34669448337</div></div></div>