How to Budge into a call with an audio file every 30 seconds


#1

Hi All,

I would like to know how to play an audio file every 30 seconds between participants in a call on Asterisk 13?

Ideally I would like this to apply to every call on both the caller and the individual being called.

Regards,
Kevin


#2

Bridge them into a conference where the third leg plays the audio. My guess is that is less hassle than setting up two whispers .


#3

Hi,

Thanks for the feedback. I must confess that I am relatively new to Asterisk therefore some of my questions might sound a bit naive to Asterisk.

I read up on how to create a ConfBridge here but I could not get it to work. I assume that I am missing something basic as I am still getting my head around Asterisk.

For the purpose of this discussion can we assume two extensions, 200 and 201. Then 202 for the audio file that is on loop every 30 seconds.

Questions:

  1. How do I create a new conference between all 3 participants automatically every time when 200 calls 201 or 201 calls 200?

  2. How do I pass the audio file that is played every 30 seconds as a parameter through extension 202?

  3. How do I configure the audio file to only be played at certain intervals, e.g. every 30 seconds

Regards,
Kevin


#4

Here you have a way of how to complete this task : using chanspy and AMI you can play the audio file to an specific extension , use Wait() application to establish a pause in the audio playing, Goto() for looping and then trigger this script using local channel and sequential dialing
for example :.

exten=>201,1,Dial(SIP/201&Local/s@alert)

[alert]
exten=>s,1(start),Noop()
same=>n,wait(30)
same=>n,System(/usr/bin/php /home/spy.php 201)
same=>n,Goto(alert,s,1)

Call this dial plan using local channel for example


#5

The Answer on the local channel will cause the call on SIP/201 to be cancelled. You haven’t provided the difficult bit, which is the PHP script.


#6

Yes you right about the answer() part I just forgot to replace it, related to the PHP there are many exmaples on this forum and on the internet of using of PHP and Asterisk AMI, This is a support forum I dont think nobody is writing and posting codes, instead we provide a general idea of how to the things can be done, Anyway PHP scripting is not mandory he can use dial plan coding I just gave him an option of the multiples choices , also this theread could help Play audio file on channel that is in ConfBridge


#7

Thanks for the feedback I am trying out the proposed ideas. Just bear with me as I am relatively new to Asterisk and my responses may be a bit delayed.


#8

Can I track back a bit. My Asterisk seems to be ignoring everything in _/etc/asterisk/extensions_custom.conf

My extensions_custom.conf looks like below

[ext-local-custom]
exten => 201,1,Answer()
same => n,Hangup()

Am I missing something obvious as I am assuming that all calls to 201 should be automatically answered and hung up according to this link?


#9

That isn’t part of Asterisk, or rather it created on top of Asterisk, using the capabilities of Asterisk, but the behaviour is determined by what’s in the FreePBX dialplan. You will need to ask on http://community.freepbx.org/ for information about how FreePBX uses that file.

However, an extension that answers and immediately hangs up doesn’t seem very useful to me, unless you are trying to ditch a nuisance caller in a way that ensures they get charged for the call.


#10

Thanks david551, I will take this up with the FreePBX community. The answer and hangup is not very useful I agree, it was part of just troubleshooting as the suggestions made above were not working.