This post covers a common use case when deploying a phone system: Somebody in the business needs to be able to record voicemail greetings for other people.
This assumes that you are already running asterisk, and that there is already something like this in your Dialplan (extensions.conf
) for users to record a greeting:
|
|
To run this script as somebody else, in the phone sense, we just need to change the CallerID before we run it. Some things you’ll need to know to do this:
- An “X” in the extension matches any digit
EXTEN
is a variable holding the current extensionCALLERID(num)
is another variable, which holds the CallerID number${EXTEN:2}
is a “substring”, which cuts the first two letters off the extension
With that in mind, if *
records your own voicemail, then **4567
would record 4567
’s voicemail using this snippet:
|
|
Of course, you’re not likely to want to enable this for the whole business, which is why you can also check the CallerID before you change it. This alternative snippet allows you to record any voicemail greeting, but only if you are calling from 1234.
|
|