[OpenSIPS-Devel] [ opensips-Bugs-3159427 ] Pattern matching on permissions modules

SourceForge.net noreply at sourceforge.net
Thu Jan 20 20:56:36 CET 2011


Bugs item #3159427, was opened at 2011-01-16 19:24
Message generated for change (Comment added) made by flaviogoncalves
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3159427&group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.6.x
Status: Open
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Flavio Goncalves (flaviogoncalves)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: Pattern matching on permissions modules

Initial Comment:
Hi Bogdan, 

It seems like a bug for me. 

I'm trying to implement a tech prefix for IP authentication. I was using the function check_src_addr() and tried also with check_addr. 

Problem #1: Pseudo variables are not parsed for patterns 

Jan 16 06:48:40 ip-208-109-122-193 /sbin/opensips[20900]: DBG:permissions:check_addr_6: Looking for : <0, 189.34.0.243, udp, 5062, $rU>

Problem #2: Even passing as a text param it does not match

Jan 16 07:14:35 ip-208-109-122-193 /sbin/opensips[22437]: DBG:permissions:check_addr_6: Looking for : <0, 189.34.0.243, udp, 5062, 85000>

Database entry

| 1827001 | 30000 | 189.34.0.243   |   32 | 5062 | any   | ^85000  | method=techprefix;username=600000;domain=sippulse.com;digits=5;techprefix=85000 | sippulse.com | techprefix |

Thanks

Flavio E. Goncalves

----------------------------------------------------------------------

>Comment By: Flavio Goncalves (flaviogoncalves)
Date: 2011-01-20 17:56

Message:
Bogdan, 

85000 matches the expression ^85000. I have used two Regex testers and it
matches. I don't get it. 

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2011-01-20 17:49

Message:
First command:
the "pattern" param is not supposed to accept variables (see the REAME :
    * pattern
       This argument is a string to be matched with the regular
       expression pattern field from the cached address table.
       This argument is optional.

YOu can open a feature request to have this if you want.

Second command:

the pattern you have in db for the rule does not match the pattern param.

Regards,
Bogdan


----------------------------------------------------------------------

Comment By: Flavio Goncalves (flaviogoncalves)
Date: 2011-01-20 16:57

Message:
The second way is:

check_address("0","$si","$sp","$proto","$avp(context)","85000")

----------------------------------------------------------------------

Comment By: Flavio Goncalves (flaviogoncalves)
Date: 2011-01-20 16:13

Message:
The command used was:

check_address("0","$si","$sp","$proto","$avp(context)","$rU")

----------------------------------------------------------------------

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2011-01-20 11:39

Message:
Hi Flavio,

For the 2 cases, could you exactly copy here how you call the function
from the script ?

Regards,
Bogdan

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=1086410&aid=3159427&group_id=232389



More information about the Devel mailing list