Hello, serusers!
I am trying to add support to our SER routing to do the right thing when users add extra digits to phone numbers. We have silly users trying to dial 1-800-JABBER-WOCK type numbers, and they don't know to stop dialing after the "W", since you don't need to on a standard analog line.
It seems like this would either require a reg-exp back reference (ie, \1), or a while loop and a function like strip() that works on the other side of the user portion of the SIP address:
while (uri =~ ^sip:[1-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]) { endstrip(1); }
Are any of these functions available, but not documented? I've found the language reference/Admin's guide to be a bit obscure at times for discovering these sorts of things. Or can anyone suggest another way to truncate the number down?
Also, as long as I'm writing in: are there any minimum and maximum quantifiers (ie, [0-9]{3,5}) available in SER? It's hard to read code that's 90% repeated character classes!
^Jeremy$