Peder @ NetworkOblivion
2007-Aug-10 15:49 UTC
[asterisk-users] Asterisk Manager to Record Greetings
I am trying to use Asterisk Manager via php to record auto attendant greetings and I just can't figure out how to do it. I've got the php page working and I can click to call between two phones. However if I click to call just a single phone and then try to enable "monitor", when I pick up the ringing phone, it just hangs up and doesn't record anything. I'm sure I just don't know the appropriate syntax. Has anybody done something like this? I can do the php stuff, I just need the Asterisk Manager syntax. I want to call a phone, when they pick up, it starts recording to a file and when they hang up, it closes the file. Any help would be appreciated. Peder
On 8/10/07, Peder @ NetworkOblivion <peder at networkoblivion.com> wrote:> I am trying to use Asterisk Manager via php to record auto attendant > greetings and I just can't figure out how to do it. I've got the php > page working and I can click to call between two phones. However if I > click to call just a single phone and then try to enable "monitor", when > I pick up the ringing phone, it just hangs up and doesn't record > anything. I'm sure I just don't know the appropriate syntax. Has > anybody done something like this? I can do the php stuff, I just need > the Asterisk Manager syntax. > > I want to call a phone, when they pick up, it starts recording to a file > and when they hang up, it closes the file. > > Any help would be appreciated. >Peder, Don't know how to do this from php and the asterisk manager, but the following will do what you want: [record] exten=_9003.,1,answer() exten=_9003.,n,Record(${EXTEN:4}:ulaw||60|t) exten=_9003.,n,Playback(${EXTEN:4}) exten=_9003.,n,Hangup() just include the above context into the appropriate context for a phone you want to record from. Dial 90031234 (for example). You will hear a "beep" and can record whatever you want. "For accounting" for example, then press the * key. You will hear a playback. The recording will be found in /var/lib/asterisk/sounds and called 1234 (if you dialed 90031234 and your language is en). If you don't like it, hit redial and do it over. If you like it, just move the file to another name or use a different last 4 digits. Ciao, David A. Bandel -- Focus on the dream, not the competition. - Nemesis Air Racing Team motto
Gordon Henderson
2007-Aug-10 16:19 UTC
[asterisk-users] Asterisk Manager to Record Greetings
On Fri, 10 Aug 2007, Peder @ NetworkOblivion wrote:> I am trying to use Asterisk Manager via php to record auto attendant > greetings and I just can't figure out how to do it. I've got the php > page working and I can click to call between two phones. However if I > click to call just a single phone and then try to enable "monitor", when > I pick up the ringing phone, it just hangs up and doesn't record > anything. I'm sure I just don't know the appropriate syntax. Has > anybody done something like this? I can do the php stuff, I just need > the Asterisk Manager syntax. > > I want to call a phone, when they pick up, it starts recording to a file > and when they hang up, it closes the file. > > Any help would be appreciated.I can't help but think you're making life hard for yourself. Why not do it by dialling a code on the telephone and having the dialplan Record() what's being spoken rather than go to the bother of writing PHP to call asterisk via the monitor interface... But I don't know the whole story of your implementation! I record prompts like this: ; Record Intro message. exten => 771,1,Answer() exten => 771,2,Wait(1) exten => 771,3,Playback(beep) exten => 771,4,Record(/var/spool/app/introMessage:wav) exten => 771,5,Playback(/var/spool/app/introMessage) exten => 771,6,Hangup() Gordon