Playing A Beep/noise During A Call

Home » Asterisk Users » Playing A Beep/noise During A Call
Asterisk Users 2 Comments

Hi. I am using an appliance as SIP-ISDN gateway that has a (not so nice)
feature of hanging up a call if it detects more than 10 minutes of silence from the originating side. The problem is that the calls are always originated from a digital system that, most of the times, just sends silence, for more than 10 minutes, only sporadically has people talking, so this makes the calls to hangup automatically after 10 minutes…

I need to inject some noise/tone, periodically (like every 9 minutes), on the originating call to avoid this behaviour. What is the best way to achieve it?

I’ve seen the Extenspy or mixmonitor commands, but i need to make it periodic…

Thank you in advance. Rui

2 thoughts on - Playing A Beep/noise During A Call

  • I use ChanSpy for that.

    This should get you on track:
    https://community.asterisk.org/t/play-audio-file-on-channel-that-is-in-confbridge/67678

    I don’t use AMI, I just trigger asterisk binary through a shell script
    (via AGI) like this to originate the call, it’s easier for me:

    /usr/sbin/asterisk -rx “originate local/something@whisper extension something@whisper-playback”

    [whisper]

    exten => _[a-z,0-9].,1,Answer exten => _[a-z,0-9].,n,Verbose(… whispering to admins)
    exten => _[a-z,0-9].,n,ChanSpy(SIP/${EXTEN},qw)
    exten => _[a-z,0-9].,n,Hangup

    [whisper-playback]

    exten => 5555,1,Answer exten => 5555,n,Verbose(… playback to chanspy for admins)
    exten => 5555,n,Playback(/var/lib/asterisk/sounds/somewavfile)

    So, if you need this periodically you could maybe spawn a shell script through AGI which will sleep for a certain amount of minutes and then repeat the originate command …

    Good luck!

    Am 07.02.2019 um 12:59 schrieb Rui Mota: