3 posts / 0 new
Last post
Lansalot
Lansalot's picture
Joined: 2016/07/25
Points: 0

Hi all
My first script contribution - I would appreciate some feedback?

This is to try to replicate similar functionality to FreePBX's Announcements module, which we use to choose different greetings depending on various conditions, then drop the caller to a chosen voicemail box without the voicemail greeting. We might use this for e.g. different branches of the same company who have different opening times. It has been copied from the TL goto voicemail script, with an additional argument and line of code. I know it's very simple, but it took me some time to work out the correct code and will be very useful to us. I think / hope it will work in the way that I want?

Comments good or bad welcome.

Thanks

Name: Announcement-gotoVoicemail
Used for: Inbound, Feature Codes
Descriptive Name: Play Announcement, Go to Voicemail
Description:
Play an announcement, then sends caller to Voice Mail to leave a message. Typically used with option s so you don't have 2 voicemail greetings.
Options control the initial propmt as follows:u - "User is unavailable", b - "User is on the phone", s - Skip playing the initial prompt or "Please leave a message" when no option is entered.
Optional operator's extension allows to transfer to operator by pressing 0
Pressing * during prompt enters Voicemail Menu (for message retrieval and other options)

PBX Commands:
exten => s,1,Playback(ogm/${tenant}/${ARG4})
exten => s,n,VoiceMail(${ARG1},${ARG2})
exten => o,1,GotoIf($["${ARG3}" = ""]?check)
exten => o,n,Set(OPERATOR=${ARG3})
exten => o,n(check),GotoIf($["${OPERATOR}" != ""]?dial)
exten => o,n,Set(OPERATOR=0)
exten => o,n(dial),Dial(Local/${OPERATOR}@from-inside${TL_DASH}${tenant})
exten => a,1,VoiceMailMain(${ARG1})
exten => a,n,Hangup

Arguments:
1 = Mailbox, Mailboxes, Required
2 = Options, Text
3 = Operator's Extension, Extension
4 = Announcement, Recorded Message

Lansalot
Lansalot's picture
Joined: 2016/07/25
Points: 0

I just worked out I could probably have achieved the same by simply creating a hunt group which contains a queue, set the timeout to 0 and the announcement to what I want :(

Anyone any comments on either method?

eeman
eeman's picture
Joined: 2007/11/06
Points: 170

another option would be a menu with the playback and the only menu option being timeout to go to that VM box. IT depends on the mailbox if you need a custom recording because you can technically specify either busy ('b') or unavail ('u') recordings to play (as long as temp greeting is not set)

Erik Smith
dCAP
Thirdlane/Asterisk Support available
esmith.bgnv@gmail.com