Interrupting the Monitor() command with a DTMF press - asterisk

The asterisk Record command allows for stopping the recording when the pound(#) key is pressed.
I'm looking for an equivalent for the Monitor() command. i.e. that audio stops streaming to a file if the pound key is pressed.

What you searching calling "one touch monitor"
See features.conf options
automon => *1 ; One Touch Record a.k.a. Touch Monitor
;-- Make sure to set the W and/or w option in the Dial() or Queue() app call!
You also can do custom feature and use in it MixMonStop.

Related

Trigger a script in a FreePBX Distro when arbitrary call is picked up

I am using Asterisk 13.17.0 on a FreePBX 14.0.1.1 distro. I would like to execute a python script whenever a call gets picked up, regardless of whether it is an internal or external one, passing to it as command line parameters the number who's calling and the user who's picking it up. How could I modify my dialplan in order for this to be done? I've tried modifying the [app-pickup] extension in /etc/asterisk/extensions_additional.conf, but picking up an internal call with this modification was to no avail
You should check diall command params, especial G param
https://wiki.asterisk.org/wiki/display/AST/Asterisk+11+Application_Dial
G( context^exten^priority ) - If the call is answered, transfer the calling party to the specified priority and the called party to the specified priority plus one.
context
exten
priority
In freepbx you can change dial params in settings tab.
You also SHOULD NOT ever touch extensions_additional.conf, it even have warning on top of file. File will be rewrited every time you change config. You have do changes in extensions_custom.conf

Keep calling channel after called channel hangs up in Asterisk

I want to execute an AGI script for calling party after called party hangs up. For example, for doing a survey for customers I am going to run an AGI script after agent hangs up.
Unfortunately, when AGI scripts runs the agi debug output says:
"511: The command cannot be executed on a dead channel"
I use commands like "ANSWER" or "STREAM FILE" in my agi script which need a channel to run on.
I know that calling channel hangs up as soon as called party hangs up.
I tried DeadAGI instead of AGI and also "g" option in dial command but none of them works.
So, I think I have to search for a solution that keep the calling channel up so that I can run my script on that.
Any suggestion please?
You should not use "g" param for this case, because it is CALLER hangup. You should use "F"
F([[context^]exten^]priority): When the caller hangs up, transfer
the *called* party to the specified destination and *start* execution
at that location.
NOTE: Any channel variables you want the called channel to inherit
from the caller channel must be prefixed with one or two underbars ('_').
F: When the caller hangs up, transfer the *called* party to the next
priority of the current extension and *start* execution at that location.
NOTE: Any channel variables you want the called channel to inherit
from the caller channel must be prefixed with one or two underbars ('_').
NOTE: Using this option from a Macro() or GoSub() might not make
sense as there would be no return points.
g: Proceed with dialplan execution at the next priority in the current
extension if the destination channel hangs up.
Finally I found the answer. The problem is that we don't have to execute agi script in h extension otherwise we get an error for some functions like answer or streamfile in agi. we have to redirect the call to some extension before h extension and for that in elastix I had to change extensions.conf.

Playback a file to both sites of a call by DTMF request

I want to play a sound file to both call legs whenever the caller clicks a DTMF,
I used asterisk features so if the caller clicks the dtmf 6 a sound file will be played to both call legs, The problem is asterisk features only allow the feature to run on one side of the call: self OR peer,
I tried configuring 2 features with the same DTMF like that:
features.conf:
[applicationmap]
PlaySound6p => 6,peer/peer,Playback,tt-monkeys
PlaySound6s => 6,self/peer,Playback,tt-monkeys
but the playback of tt-monkeys works only 1 time, here is the log:
-- Feature Found: PlaySound6p exten: PlaySound6p
-- Playing 'tt-monkeys.slin' (language 'en')
writting asterisk features show command returns:
Dynamic Feature Default Current
--------------- ------- -------
PlaySound6s no def 6
PlaySound6p no def 6
It appears asterisk doesn't fire 2 features when they are configured on the same DTMF,
Anyone knows a way this can be done?
Thanks,
Rami.
Only one feature can be fired by digit.
Digits will be "consumed" and not go after that.
However you can start on that digit one or more OTHER call, each one you can connect to this channel by ChanSpy or audiohooks and whatever you want.

Asterisk Music On Hold loop

I would need to be able to allow users to 'loop' through our MOH files.
Currently we have MOH set like this:
[moh]
mode=files
directory=/var/lib/asterisk/moh/custom
is there a way to allow users to go to next file from that directory by clicking number 1 on keypad?
Thank you
Only variant i see without rewrite of asterisk is just stop/start moh based on key pressed
See features.conf
http://www.voip-info.org/wiki/index.php?page_id=1483
You also can create custom application which stream file and other app which on key pressed do "next track" on that app, but that will result alot of CPU usage.
See streaming:
http://www.voip-info.org/wiki/view/Asterisk+config+musiconhold.conf

execute command after asterisk confbridge recording is finished

I'm trying to find answer how to make Asterisk execute some command (my script) after confbridge's recording is finished
There is the next info in confbridge.conf:
record_conference=yes
Records the conference call starting when the first user enters the
room, and ending when the last user exits the room.
It records file well but I want it sending wav file via email.
Could anybody help me?
My config now looks like this (if it's necessary):
exten => 333,1,ConfBridge(100010,100010_bridge_profile,100010_user_profile)
Dialplan scripting is limited to events relating to each call channel. To get event info for other parts of asterisk (such as the ConfBridge application) you should hook into the Asterisk Manager Interface (AMI).
There are many libraries already created to make working with the AMI easier. (That site may be outdated. Refer to the official Asterisk Wiki whenever possible.)
The AMI event you're interested in is "ConfBridgeEnd". Docs here.
You can use h-extension after confbridge, in which you have check if confbridge still active(last user).
If yes, run your script via System call.

Resources