<div dir="ltr"><div dir="ltr">Thanks Valli ;) and thanks all too !<br>it works like a charm !</div><div dir="ltr"><br></div><div>I can easily mix filter by gateway and by IP ;)</div><div><br></div><div>++<br></div><br><div class="gmail_quote"><div dir="ltr">Le dim. 14 oct. 2018 à 23:34, Vallimamod Abdullah <<a href="mailto:vma@vallimamod.org">vma@vallimamod.org</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
For ip addr matching: <condition field="network_addr" expression="^192\.168\.1\.1$"/><br>
<br>
Alternatively, If you want some variables populated on incoming call from a given IP the same way as with registered gateways, you can define a directory user entry (with "cidr" param to allow ip-auth) and define the your variables there. For example:<br>
<br>
<user id="GW2" cidr="<a href="http://2.2.2.2/32" rel="noreferrer" target="_blank">2.2.2.2/32</a>"><br>
<variables><br>
<variable name="accountcode" value="GW2"/><br>
<variable name="call_limit" value="10"/><br>
<variable name="max_ringtime" value="45"/><br>
</variables><br>
</user><br>
<br>
Hope this helps!<br>
<br>
<br>
Best Regards,<br>
-- <br>
Vallimamod Abdullah<br>
SIP Solutions<br>
vma@sip.solutions<br>
<a href="http://linkedin.com/in/vallimamod" rel="noreferrer" target="_blank">linkedin.com/in/vallimamod</a><br>
.<br>
<br>
> On 13 Oct 2018, at 22:11, Mickael Hubert <<a href="mailto:mickael@winlux.fr" target="_blank">mickael@winlux.fr</a>> wrote:<br>
> <br>
> Hi<br>
> Thanks a lot !<br>
> <br>
> I think the best way (maybe only way) it's to match with from IP.<br>
> It's sure when inbound call arrives from GW2, any variables in gateway configuration aren't populate.<br>
> <br>
> But how Can I do math with IP please ?<br>
> <br>
> ++<br>
> <br>
> <br>
> Le sam. 13 oct. 2018 18:26, Srigo Kanapathipillai <<a href="mailto:ksrigo@gmail.com" target="_blank">ksrigo@gmail.com</a>> a écrit :<br>
> Hi Mickael,<br>
> <br>
> <gateway> <br>
> ..params...<br>
> <variables> <br>
> <variable name="inbound_var_name" value="this is inbound" direction="inbound"/><br>
> <variable name="outbound_var_name" value="this is outbound" direction="outbound"/> <br>
> <variable name="both_var_name" value="this on any direction"/> <br>
> </variables> <br>
> </gateway><br>
> <br>
> Did you try to set variables on your gateway and use it in your dialplan?<br>
> <br>
> Srigo Kana<br>
> On 13 Oct 2018, at 00:31, Mickael Hubert <<a href="mailto:mickael@winlux.fr" target="_blank">mickael@winlux.fr</a>> wrote:<br>
> Hi guys,<br>
> I want to identify source of inbounds calls. <br>
> In my external profile I have two gateways:<br>
> <br>
> - One with REGISTER method<br>
> - One without REGISTER method (IP to IP), only iptables filtering<br>
> <br>
> <gateways><br>
> <gateway name="GW1"><br>
> <param name="from-domain" value="**********"/><br>
> <param name="caller-id-in-from" value="true"/><br>
> <param name="proxy" value="1.1.1.1"/><br>
> <param name="register" value="true"/><br>
> <param name="username" value="**************"/><br>
> <param name="password" value="****************"/><br>
> <param name="expire-seconds" value="3600"/><br>
> <param name="retry-seconds" value="30"/><br>
> <param name="ping" value="25"/><br>
> </gateway><br>
> <gateway name="GW2"><br>
> <param name="from-domain" value="*********"/><br>
> <param name="caller-id-in-from" value="true"/><br>
> <param name="proxy" value="2.2.2.2"/><br>
> <param name="register" value="false"/><br>
> <param name="retry-seconds" value="30"/><br>
> <param name="ping" value="25"/><br>
> </gateway><br>
> </gateways><br>
> <br>
> In my dialplan I have this conf:<br>
> <br>
> <condition field="${sip_gateway}" expression="GW1" break="never"><br>
> <action application="set" data="number_dest=${destination_number}" /><br>
> <action application="execute_extension" data="to-private XML from-gw1"/><br>
> </condition><br>
> <condition field="${sip_gateway}" expression="GW2" break="never"><br>
> <action application="set" data="number_dest=${destination_number}" /><br>
> <action application="execute_extension" data="to-private XML from-gw2"/><br>
> </condition><br>
> <br>
> When a call arrives throught GW1 (REGISTERED), ${sip_gateway} is populate with "GW1" perfect !. But when another call arrives throught GW2 (not REGISTERED), ${sip_gateway} is empty.<br>
> <br>
> Please, how can I identify the source gateway where calls arrive ? maybe it's not a good way to do that ?<br>
> <br>
> thanks in advance<br>
> <br>
> Professional FreeSWITCH Services<br>
> <a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
> <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
> <br>
> Official FreeSWITCH Sites<br>
> <a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
> <a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
> <a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
> <br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
> _________________________________________________________________________<br>
> Professional FreeSWITCH Services<br>
> <a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
> <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
> <br>
> Official FreeSWITCH Sites<br>
> <a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
> <a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
> <a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
> <br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
> _________________________________________________________________________<br>
> Professional FreeSWITCH Services<br>
> <a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
> <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
> <br>
> Official FreeSWITCH Sites<br>
> <a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
> <a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
> <a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
> <br>
> FreeSWITCH-users mailing list<br>
> <a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
> <a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
> UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
> <a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
<br>
_________________________________________________________________________<br>
Professional FreeSWITCH Services<br>
<a href="mailto:sales@freeswitch.com" target="_blank">sales@freeswitch.com</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="https://freeswitch.com/oss" rel="noreferrer" target="_blank">https://freeswitch.com/oss</a><br>
<a href="https://freeswitch.org/confluence" rel="noreferrer" target="_blank">https://freeswitch.org/confluence</a><br>
<a href="https://cluecon.com" rel="noreferrer" target="_blank">https://cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" rel="noreferrer" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="https://freeswitch.com" rel="noreferrer" target="_blank">https://freeswitch.com</a></blockquote></div></div>