I saw the wildcard there, and figured that's what it does... flipping it is a 
neat trick.. I'll use that.. I was going to use mod_py to do that little 
comparason.

________________________________________
From: Stefan Sayer [[email protected]]
Sent: Thursday, January 05, 2012 9:34 AM
To: Derrick Bradbury
Cc: [email protected]
Subject: Re: [Sems] DSM: Compare a "*"

Hello,

o Derrick Bradbury on 01/05/2012 04:26 AM:
> Hi all,
>
> I'm working on converting an Asterisk App over to SEMS using DSM...
>
> I need to see if the USER of @local_uri is a "*" at the beginning...
>
> Here's the code ($lparty is already split out):
> set($lus = $lparty.user);
> substr($lus,0,1);
> if test($lus == "*") {set(type=FUNCTION);}
>
>
> Problem is, it matches everything!
there's an (undocumented?) feature of the comparision: it matches
substring with wildcard on the right side, e.g. "Stefan",
"StefanSayer", and "StefanS" match on "Stefan*", so these return true:
  test("StefanSayer"=="Stefan*")
  test("Stefan"=="Stefan*")
  test("StefanS"=="Stefan*")


That's only on the right side, though, so you can do:
  if test("*" == $lus) {set(type=FUNCTION);}

>
> It matches "*97" and "222"... I need it to ONLY match "*"
>
> I'll probably have a bunch more questions... patience is greatly
> appreciated...

No worries, keep them coming, please. People on this list will be
happy to help.

Stefan

>
>
>
> _______________________________________________
> Sems mailing list
> [email protected]
> http://lists.iptel.org/mailman/listinfo/sems
_______________________________________________
Sems mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/sems

Reply via email to