[asterisk-users] Conditional IF based on IP address?

Rushowr rushowr at phreaker.net
Wed Sep 6 12:20:11 MST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Steve Hsieh wrote:
> Greetings,
>  
> Is it possible to create a conditional IF inside extensions.conf based
> on the source IP address of a SIP phone (as opposed to extension)?  What
> I would like to do is the following:
>  
>  
> 1. If SIP phone IP belongs to 192.168.0.0/24 <http://192.168.0.0/24>
> subnet, set CALLERID=xxxx
> 2. Else, set CALLERID=yyyy
>  
> Thanks in advance for any examples or help.
>  
> Steve
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
Steve, yes you can do it.

You'll need to use the SIPPEER function (available in trunk only I
believe) to get ${SIPPEER(ipaddr)}. You can then use Set and If() to do
what you want.

SKM
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (MingW32)
Comment: ENCRYPTED WITH GPG

iD8DBQFE/x9rlfQsv7FBhp8RAgX1AKCg3x2i5MYqqQVRwE1zHkfzI3pTPgCdESoP
/ZJRPzbHXY28lJlNzd8Gr1k=
=rf4C
-----END PGP SIGNATURE-----



More information about the asterisk-users mailing list