[Serusers] URI Pattern Matching

Kristian Larsson kristian at netatonce.se
Thu Feb 22 08:58:51 CET 2007


On Thu, Feb 22, 2007 at 12:45:53AM +0000, Jon Farmer wrote:
> Hi
> 
> I am trying to find a way to detect if the Invite URI starts with a *.
Perhaps I'm not really enlightened in the realms
of URIs, but can a URI really contain a * ?
I was under the impression that the only allowed
characters were [A-z0-9-.] plus @ as a separator
of username and domain.

> How do I match this as ser normally sees * as a wildcard.
I believe SER uses regular expression type of
matching and thus * is not really a wildcard, but
rather "0 or more instances of the previous
character". Anyway to match a request-URI starting
with '*' you simply do
if (uri =~ /^\*/) { #blaha }

I'm from the OpenSER world so request-URI might
not be called 'uri'.

  Kristian

-- 
Kristian Larsson                                         KLL-RIPE
Network Engineer & Peering Coordinator      Net At Once [AS35706]
email: kristian at netatonce.se                      irc: kll at ircnet
phone: +46 470 592717                        cell: +46 704 910401                       



More information about the sr-users mailing list