Re: Using keyword-regex

2008-05-15 Thread seik
use POSIX regexp

^[[:digit:]]{7}$

-Original Message-
From: Kevin Reed [EMAIL PROTECTED]
Sent: 15 ??? 2008 ?.
To: seik
Subject:Using keyword-regex 

 I am attempting to trap messages sent consisting of only 7 digit numbers. 
 The number is not valid unless they are exactly 7 digits so I wrote an
 sms-service like:

 group = sms-service
 keyword = tr
 keyword-regex = ^(\d{7})$
 name = TankReading
 aliases = store
 exec = /usr/local/smsgateway/sms-command.pl store '%k'
 max-messages = 2
 concatenation = false

 I even tried changing the rejex to:

 keyword-regex = ^\d{7}$

 Neither appears to work.  It just falls through to the default sms-service
 which sends back an invalid command.

 Any ideas what is wrong?

 If I use the service setup as:

 group = sms-service
 keyword = tr
 name = TankReading
 aliases = store
 exec = /usr/local/smsgateway/sms-command.pl store '%s'
 max-messages = 2
 concatenation = false

 It works fine if the sender includes TR space then the 7 digit number. 
 I'm trying to make it so that they don't need to add the TR, just send the
 store number.





Using keyword-regex

2008-05-14 Thread Kevin Reed
I am attempting to trap messages sent consisting of only 7 digit numbers. 
The number is not valid unless they are exactly 7 digits so I wrote an
sms-service like:

group = sms-service
keyword = tr
keyword-regex = ^(\d{7})$
name = TankReading
aliases = store
exec = /usr/local/smsgateway/sms-command.pl store '%k'
max-messages = 2
concatenation = false

I even tried changing the rejex to:

keyword-regex = ^\d{7}$

Neither appears to work.  It just falls through to the default sms-service
which sends back an invalid command.

Any ideas what is wrong?

If I use the service setup as:

group = sms-service
keyword = tr
name = TankReading
aliases = store
exec = /usr/local/smsgateway/sms-command.pl store '%s'
max-messages = 2
concatenation = false

It works fine if the sender includes TR space then the 7 digit number. 
I'm trying to make it so that they don't need to add the TR, just send the
store number.

-- 
Kevin Reed - TNET Services, Inc.
For Mesa, AZ Weather http://www.TNETWeather.com