agiphp guru of stack flow
My question is
I'm developing an application where a junk of work is about making conference call.I want to write Agi preferably PHP based where user A holds DID using SIP trunk which is connected to asterisk server need to make conference call(outgoing) like calling B,C,D....n and puting them in conference.If there is any example please share or give ur valuable feedback to implement it. I'm currently using asterisk 1.8
but meet me and confbridge is not much of use for me as well as auto dial out.I need something like for example user A with exten 1234 calling user B with exten 5678 and both are in a call now user A or B need to call to user c with exten 1111 and try to call him and put all user A,B,C in one conference
Please read this pages
http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out
http://www.voip-info.org/wiki/view/Asterisk+cmd+MeetMe
But note, dialout can have very tricky issues, so not recommended do dialout application if you are not expert.
For more info consider check opensource diallers like vicidial.
Related
I do have an Asterisk 11 PBX and I'm developing an Windows Service application using the github AsterNET.AMI Library to connect my PBX. Till here everything is working fine, I can send commands and read incoming event messages.
But now I need to develop a feature on my software based over one information that I thought it could be easy to retrieve. The information I'm looking for is - who hanged up?
I googled for it a lot and I could find a few answers, most of them talking about setup the G option on CDR but also some considerations about this approach. Still like this I couldn't grab any valuable information for my scenario.
Maybe if I tell you about my working scenario you could help me. Lets go, I'm going to bullet split this:
I do have a caller calling from a cellphone and this calling are incoming to my internal PBX extension
My PSTN trunk is a E1/R2 directly to my PBX
No matter if caller or callee hangs up always I do have "normal clearing" message for hangup_cause
I know I'm receiving from my service provider the information about the releasing device, because if I use my Siemens 3800 Hipath over CSTA I can retrieve this information.
So the gold question is: How can I retrieve who is the releasing device on this situation?
You can try a combination of g and F options in the Dial application. The g option allows dialplan execution when the called party hangs up, while the F option allows you to continue execution to a context,extension,priority of your choice if the caller hangs up.
So, you can understand which party is hanging up by the dialplan being executed after the call ended.
Find here more info on these options: https://www.voip-info.org/asterisk-cmd-dial/
The only way I could find after read Asterisk doc almost entirely was reading HangupRequest event messages.
As I'm using AsterNet.AMI library to connect and manage my Asterisk, so I change the source code a little bit to have an event handler do read HangupRequest event.
HangupRequest event writes the messages like the following one:
Event: HangupRequest
Privilege: call,all
Channel: SIP/8103-000001be
ChannelState: 6
ChannelStateDesc: Up
CallerIDNum: 8103
CallerIDName: Agent 8103
ConnectedLineNum: 51999887766
ConnectedLineName: 51999887766
Language: en
AccountCode:
Context: from-internal
Exten: 8100
Priority: 1
Uniqueid: 1569618521.446
Linkedid: 1569618519.445
So accordly to HangupRequest Event Asterisk documentation I could notice the channel in the message is the channel related to the releasing device, also CallerIDNum and CallerIDName are related to.
This feature is not implemented right now on the github library, but I'm going to push over there and ask them to include on next release.
Yet I don't know where to read this information on FreePBX Admin.
I'm trying to setup an emergency service for our company, and this is the need:
A person that is involved into an emergency situation have to dial a number with his mobile phone and automatically all ermergency squad's people phones will ring and all must be placed in conference call automatically.
I'm near to the solution but I have some difficult with call files , I'm also not sure this is the right way but this is what I made
I've created a conference ( extn 419 ) and also I've created one call file like this
Channel: SIP/123456789#from-internal
MaxRetries: 2
RetryTime: 60
WaitTime: 30
Context: ext-meetme
Extension: 419
Priority: 1
where 123456789 is one of the emergency squad number and 419 is the conference room number
this is working but I have to manually put the call file in the outgoing directory to generate the call
I would like to have the call originate when someone call the 419 extension.
Could someone help me please?
Thanks in advance
For your approach you need to trigger AGI script when somebody calls emergency number. And then this script can create call files and copy them to spool directory.
http://www.voip-info.org/wiki/view/Asterisk+cmd+AGI
If I was building similar solution, then I will probably will do all logic inside AGI script even triggering a call with originate command instead of call files.
My dialpaln:
[dialplan-for-emergency]
; 123456 - emergency number
exten => 123456,1,Answer()
exten => 123456,n,AGI(myscript.pl)
exten => 123456,n,Hangup()
myscript.pl # in pseudo code
create conference
create a calls to all other participants into conference
connect callee into conference
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.
I have followed the instructions in this thread: Asterisk AMI - pickup call. However, I am still unable to answer calls via AMI. I can make the call to the extension, but corresponding phone for that extension doesn't ring. I can then run the AMI command to answer that call, it does answer, but obviously there isn't any actual response.
Dialplan (testing with extension 116):
exten => 116,1,AGI(agi:async)
Any ideas what I am doing wrong here?
Use
exten => 116,1,Answer
exten => 116,2,AGI(agi:async)
or use Answer action via ami.
http://www.voip-info.org/wiki/view/Asterisk+manager+API
You need listen event, when see agi-async event issue Answer on same channel. For example you can do playback command with answer.
Very likly you need start with AGI interface, which is much more simpler for understanding. Not use agi:async, it require understanding of asterisk internals.
Found the Answer. For those wanting to answer with API Manager you can use the following -
http://ip-address:port/asterisk/rawman?action=Originate&Channel=Local/(exten you want to answer with)#(context)&Application=Exec&Data=Pickup((exten you want to answer with)#PICKUPMARK)
I am of course using http to send my requests, if you are using something else you will need to change the format.
Or you can use the bridge command. Two channels will be created when you make a call from one extension to the other, bridge those channels and you will have better overall functionality than pickup.
I would like to have pre-emption calls in Asterisk. With this I mean that if user A has priority/access-level 1 and wants to talk to user B, how could it preempt the call that user B is already having with user C which has only priority/access-level 2?
Does anyone know if this is supported by Asterisk or how this could be implemented?
Any idea would be very welcome.
No, it not supported by asterisk.
But yes, it can be implemented using dialplan+some script magic. Complexity is high and require expert or guru skill.
Short plan is following:
check if B is in call (need use DEVICE_STATE or GROUP functions)
check if B in call with lower priority caller( ASTDB or REALTIME or fastagi script)
wisper both(or only B) party that now have priority call. For that need read about asterisk auto-dialout and wisper.
wait till B press confirmation key(features.conf)
transfer both B&C to new extension, bridge A&B, play hold for C.
deal with restore C connection if needed.