Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-27 Thread Bogdan-Andrei Iancu
Hi Paul, fnmatch is a C function, not a shell one :)...no need to install anything http://www.manpagez.com/man/3/fnmatch/ Regards, Bogdan Paul Smith wrote: > Hi Bogdan, > Thanks for the help ... I am running on a debian lenny system and do > not have fnmatch() > > # man fnmatch > No manual ent

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-27 Thread Paul Smith
Hi Bogdan, Thanks for the help ... I am running on a debian lenny system and do not have fnmatch() # man fnmatch No manual entry for fnmatch # apt-get install fnmatch Reading package lists... Done Building dependency tree Reading state information... Done E: Couldn't find package fnmatch

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-27 Thread Bogdan-Andrei Iancu
Hi Paul, yes, one approach will be to get rid of the regexp matching and to try something different (like substring matching). Runtime regexps are not implemented in script as they are very time consuming - actually you need first to compile the regexp and than to check it - and this for each

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-25 Thread Paul Smith
OK I have a working solution now... code still needs tidying up and optimizing but I'll post it here in case anyone comes looking for this in the future. The significant bit is that avp_db_query() can run any MYSQL SELECT query, and there is a REGEXP() funtion in mysql allowing you to test reg

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-23 Thread Paul Smith
Hi Bodgan, Mainly matching, to allow me to verify that a customer owns the CLI he is presenting. Ideally I was thinking substitution as I can then add as well in one operation.. but I can do that as 2 separate operations. So... how can I do a dynamic match using an account specific pattern?

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-23 Thread Bogdan-Andrei Iancu
Hi Paul, you need a substitution, replacement or simply matching ? Regards, Bogdan Paul Smith wrote: > Hi Bogdan, > Thanks for the reply. I am using dialplan module for mangling the > dialled number to local valid service codes and e164 destinations. > > I was hoping to use a simple field in t

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-22 Thread Paul Smith
Hi Bogdan, Thanks for the reply. I am using dialplan module for mangling the dialled number to local valid service codes and e164 destinations. I was hoping to use a simple field in the usr_preferences or substitution table to hold a substitution pattern for each user's verified callerid (P-

Re: [OpenSIPS-Users] Runtime avp substitution

2010-09-22 Thread Bogdan-Andrei Iancu
Hi Paul, have you looked at dialplan module ? http://www.opensips.org/html/docs/modules/1.6.x/dialplan.html The subst-like funcs in script do not support dynamic patterns.. Regards, Bogdan Paul Smith wrote: > How can I do a regular expression substitution on an avp where the > pattern

[OpenSIPS-Users] Runtime avp substitution

2010-09-22 Thread Paul Smith
How can I do a regular expression substitution on an avp where the pattern is loaded from the user subsrciption or usr_preference table? For example I need to limit callerid presented to a pre-determined range owned by my customer, and perform substitution eg add a prefix. If a UAC sets P-Pref