Long Extensions That Contain Dashes

Home » Asterisk Users » Long Extensions That Contain Dashes
Asterisk Users 1 Comment

We would like to use 20-char extension values that use dashes and alphanums after the first four digits. In order to handle these via pattern-matching, how can I define a pattern that allows dashes? There seems to be no option at http://the-asterisk-book.com/1.6/einleitung-regex.html#re gular-expression-syntax However, when I try a period, it seems to match the long suffix including the dashes. I want to know whether to depend on this continuing to work.

Also, we’re not sure whether our automated members can handle extensions longer than 4 digits. I’d like to pass a substring of our extension/destination_number in the call to Queue(). I couldn’t find documention of any Queue() option like this. Is it possible to control the extension that the member receives?

Cheers, David

One thought on - Long Extensions That Contain Dashes

  • You should read some more up to date documentation I guess. https://wiki.asterisk.org/wiki/display/AST/Pattern+Matching mentions the significance of – in a character class and the way to escape. I’m to lazy to try this myself, but in any regexp parser I ever used a litteral – in a charclass is defined by simply putting it as the last character in the class (but above url leads me to think this doesn’t work in asterisk):

    [0-9] matches 0,1,2,3,4,5,6,7,8 and 9
    [09-] matchers 0,9 and –

    You are looking to modify the callerid? e.g.:
    Set(CALLERID(num)=${CALLERID(num):4})