[asterisk-users] Block outbound calls based on IP address

SamyGo govoiper at gmail.com
Tue Aug 7 23:23:23 CDT 2012


Hi,

How many Public IPs connect to you ? If they are less than 15 or 10 , I
suggest you make sip.conf peers for them with host=Publicip and then decide
if you want that to be blocked or rerouted to some other direction !

If that isn't doable then try extracting/parsing some IP using the
SIP_HEADER function. Collect some header on incoming call and extract your
required IP field and then do some DB operation etc

Regards,
Sammy


On Tue, Aug 7, 2012 at 2:40 PM, CB <kjcsb at xnet.co.nz> wrote:

> Thanks.
>
> exten => s,n,Set(foo=${CHANNEL(peerip)}) ; Doesn't return anything
> exten => s,n,Set(foo=${CHANNEL(recvip)}) ; Doesn't return anything
> exten => s,n,Set(foo=${SIPCHANINFO(peerip)}) ; Returns public IP when
> calling from a SIP device
>
> Strange that CHANNEL doesn't return anything.
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20120808/0c0c623f/attachment.htm>


More information about the asterisk-users mailing list