[OpenSIPS-Users] Permission Module Problem

M.Khaled W Chehab kchehab at icucall.com
Thu Mar 28 12:52:05 CET 2013


Hi,

 

I use to add

       if (!(is_method("REGISTER") || is_from_gw()) || is_method("INVITE"))
{    and it works as I try to set it as 

 

       if (!(is_method("REGISTER") )) {

              $avp(ip) = $si;

              $avp(port) = 5060;

              $avp(proto) = $proto;

              # this meens that the Group 1 is a Permission garanted and
others Permission denied.

              #check_address("1",  related to address table group value 1 

 

              if
(check_address("1","$avp(ip)","$avp(port)","$avp(proto)","$avp(10)", "") )
{

# request comes from trunks

                     xlog("L_INFO", "--Debug Customer
ID:$avp(Cusid)/IP:$si-----Permission OK For $si\n");

                     setflag(20);

 

              } else  {

 

                     xlog("L_WARN", "--Debug Customer IP:$si-----Permission
Denied for $rm from $fu to $tu \n");

                     send_reply("403","Forbidden");

                     exit;

              }

       }

 

 

Is that fine or I should writ in different way 

 

 

 

 

From: M.Khaled W Chehab [mailto:kchehab at icucall.com] 
Sent: Thursday, March 28, 2013 12:42 PM
To: users at lists.opensips.org
Cc: users-bounces at lists.opensips.org
Subject: Permission Module Problem

 

Hi,

 

I have a problem when I   include  the same IP address in dr_gateways
(do_routing ) and in  address table (permission module)

In other words I have a problem when the IP address exists  as provider and
as client 

The below function is not recognizing the IP address when it exists as
provider and as client 

       if (!(is_method("REGISTER") || is_from_gw()) ) {

 

if (check_address("1","$avp(ip)","$avp(port)","$avp(proto)","$avp(10)", "")
)     {

 

Please advice

 

Regards

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20130328/1576df6b/attachment.htm>


More information about the Users mailing list