asterisk@stephenamadei.com wrote:
>I need to deploy some quasi-virtual-PBXes, and I'd like to avoid having
to
>be hands on for each new phone number deployed... so I would like to set
>up some administrative extensions that can record greetings... lets say:
>
>[admin]
>exten => 8(NXXNXXXXXX),1,Record($1|-greeting.gsm)
>
>[incoming]
>exten => _(NXXNXXXXXX),1,Playback($1|-greeting)
>exten => _(NXXNXXXXXX),2,Goto($1,1000)
>exten => _(NXXNXXXXXX),102,Playback(generic-greeting)
>
>[2122222222]
>exten => 1000,VoiceMail(22222)
>
>[3103333333]
>exten => 1000,VoiceMail(33333)
>
>The concept here is like the capture buffer in a Perl regex.
>
>So that if "admin" dialed 82122222222, it would give them the
chance to
>record the greeting, which would be put in the 212222222-greeting.gsm
>file.
>
>If someone called 2122222222, it would play the 2122222222-greeting.gsm
>file, if it existed, otherwise if it failed, it would play
>generic-greeting.gsm. Then it would change context based in the called
>number.
>
>Granted, I'm asking for alot here, but is there any way to approximate
>this kind of an advanced configuration with Asterisk?
>
>
> ----Steve
>
>
Not that difficult. A few things you will need:
${EXTEN} is the current extension dialed
goto statement
You can trim crap off your vars using the ${EXTEN:1} notations. In my
example, I am trimming the front digit off the exten var. If I wanted
to be fancy, I could trim x off the front, and only read for n digits
like this: ${EXTEN:x:n}.
At least, I think I could. Perhaps someone with more recent working
knowledge could confirm that?
It's all the in the wiki. When it's up that is. :)
Sean