Action to playback on a channel

Aug 7, 2014 at 9:33 PM
Hi,

I'm using AstetNet for FastAGI & AMI.
I handle calls with AGI and I use AMI to get data of current calls, like CDR data... and it allow me to hangup calls.
So far everything works.
But I'm facing a problem, I want to play a file on activated channel, like the voice that warn you when the call is about to terminate when "Dial(...L(XX,YY,ZZ))" is used.
Is it possible to do that with AsterNet Action ?

Thx for you help :)
Aug 8, 2014 at 9:45 AM
Simple answer is no. It would be great if you could, but AMI doesn't support this and AGI is blocking so you can execute a command on a channel that's current in dial.

That being said, there might be another way. Have a look at the AsterNET.ARI project. It requires Asterisk12, but might allow you to play a file onto any channel.

Have a play and let me know, I'm looking for feedback on the ARI Framework implementation too.
Aug 8, 2014 at 11:49 AM
Ok, it's clear :)
Yeah AGI is blocking, that's why I planned to use AMI...
Dial with the "L" option could be perfect, but I must have the possibility to extend the time limit during the call, and I didn't find a way to do this with the "L" option...

Well, I'll look to ARI project and let you know if I can achieve this.
Thank you for your anwser !
Aug 8, 2014 at 1:24 PM
Is AsterNet.ARI available on nuget ?
Aug 12, 2014 at 11:06 AM
Not yet, I was hoping more people would give me some feedback before i put it on Nuget. I'd like people to have the source and dig into it a little bit :)
Aug 13, 2014 at 11:56 PM
Hi,

Finally I've succeed to playback on channel with OriginateAction.
Here what I've done :
I've created this extension (extension.conf)
;==================================
;Playback file
;==================================
exten => *78,1,Answer()
exten => *78,n,Playback(vm-youhave)
exten => *78,n,Playback(digits/10)
exten => *78,n,Playback(queue-seconds)
exten => *78,n,Hangup()
and I've created an OriginateAction like this :
OriginateAction chanspy = new OriginateAction();
chanspy.Channel = "local/*78@maison";//"maison" is the context
chanspy.Application = "ChanSpy";
chanspy.Data = "SIP/Android-00000005,qw";// "SIP/Android-00000005" is the channel to playback
chanspy.Timeout = 3000;
Aug 14, 2014 at 9:17 AM
Cunning! :)

I never thought about using chanspy! You could also use variables to set the digits (10) to whatever you wanted from the Originate.
Aug 14, 2014 at 9:26 AM
You're right, I'll do something more generic ;)