How to play a recording when a valid extension is dialed.

antinkunti
Posts: 11
Member Since:
2006-11-27

I try to do the foolowing configuration:

1) Someone calls from PSTN. Trixbox answers and tells the caller he/she may dial the extension or wait for the operator. This is configured via IVR + Inbound routing. No problem with that.

2) When the caller dial a valid extension Trixbox should play a recording saying : "Thank you, please wait while you are beeing transferred". And play music until someone answers. How can I configure Trixbox for this operation ?



antinkunti
Posts: 11
Member Since:
2006-11-27
Re: How to play a recording when a valid extension is dialed.

I resolved the issue by adding some code info the macro-exten-vm macro in the extensions.conf. Unfortunately, it didn't work from extensions_custom.conf.

The code checks if the call is "inside" and if not it plays a recording "connecting" before calling the other party. If someone is interested I can provide the code.



mmorenor
Posts: 30
Member Since:
2007-01-07
Re: How to play a recording when a valid extension is dialed.

Yap, I am interested



antinkunti
Posts: 11
Member Since:
2006-11-27
Re: How to play a recording when a valid extension is dialed.

Here are the steps:

1. Record the message, which will be played after the ext is dialed on the ivr menu. Lets say the name of the file is messageb4conn.wav
2. Open the file /etc/asteris/extension.conf by "Config Edit" under "Asterisk"
3. locate [macro-exten-vm] (You can use the left column)
4. Add the following right after exten => s,1,Macro(user-callerid) : exten => s,n,GosubIf($["${MACRO_CONTEXT}"="from-internal"]?plyb,2:plyb,1)
5. go to the last line (be sure that you are still in [macro-exten-vm] context) and add the following:

; Played just before connection an extension.
exten => plyb,1,Playback(custom/messageb4conn)
exten => plyb,n,Return

Please note that direct internal calls will not be affected.

Let me know if you get in trouble.



jades
Posts: 2340
Member Since:
2006-11-26
Re: How to play a recording when a valid extension is dialed.

thank you
it worked but internal calls are affected
do you know what to do so that it wont affect internal calls?

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



antinkunti
Posts: 11
Member Since:
2006-11-27
Re: How to play a recording when a valid extension is dialed.

The line containing "from-internal" should avoid this. Could you set debug at a higher level and connect to asterisk with asterisk -rvvvvvvvvvvvvvvvvv (You should ssh to trixbox) and capture what happens when you make an internal call ? Maybe the name of the context for internal callas are different on your system.



jades
Posts: 2340
Member Since:
2006-11-26
i got this working for

i got this working for everyone in the from-internal context
for those extensions in a different context, it would play the "please hold while i try that extension" recording

i added this under the one that says from-internal: exten => s,n,GosubIf($["${MACRO_CONTEXT}"="from-restricted"]?plyb,2:plyb,1)

notice i changed this one to from-restricted

does this script work with multiple contexts?
as well, is there a way to have it play music on hold instead of ringing?

Thanks a lot

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



jades
Posts: 2340
Member Since:
2006-11-26
bump

bump

--

Joseph Ades
josephades1_at_gmail_dot_com
(212) 937-4299



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.