[Freeswitch-users] Detect source IP of a call

Steven Ayre steveayre at gmail.com
Fri Oct 2 01:55:22 MSD 2015


You can set a cidr="" attribute on a user in the user directory, the calls
from IPs matching that cidr will then authenticate as that user (by IP
instead of by password). You then have the ability in the user directory to
set variables which will be set when the call comes in from that address.

You can use mod_xml_curl to generate the user directory dynamically, which
allows you to integrate it with a database if you wished.

On 1 October 2015 at 18:09, Dominique Jeannerod <
dominique.jeannerod at interact-iv.com> wrote:

> Hello,
> I think it's a kind of newbie question, but i'm trying to find the
> simplest way of detecting the source of a call (public trunks), which of
> course rely on the source IP of the call.
>
> I already defined one ACL per trunk, to authorize only allowed IP
> adresses, and test the different acls in the dialplan to identify the
> source trunk of a call, and set the associated accountcode.
> Example :
>         <condition field="${acl(${network_addr} T_CNX_VPN)}"
> expression="true" break="on-true">
>             <action inline="true" application="set"
> data="accountcode=T_CNX"/>
>         </condition>
> It works but the dialplan needs to be modified for each new trunk.
>
> I am wondering if there is a best way to do that, using for example a
> channel variable, containing the ACL which matched for the call.
> I tested sip_acl_authed_by, but this seems to be available only when the
> call is authenticated (?)
>
> I'm sure a lot of people had the same question
> What would be your advice ?
>
> D. Jeannerod
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20151001/874cc305/attachment.html 


Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users mailing list