Direct dialling from Callback option to be disabled - asterisk

I am facing 1 issue with my asterisk, When agents make calls directly from there "Callback list" that calls are not recorded. To make call recorded they need to copy number from callback list and dial it manually. Is there any way i can record calls dialed directly from callback list or any way to disable direct dialing from callback list?

Yes, you have rewrite your callback application to use recording dialplan or call back via
Local/number#from-internal/n
Recording of call is not property of call, it have be enabled by dialplan function MixMonitor.
So most likly your callback app just not designed for your pbx or created by stranger in asterisk field.

Related

Increasing timeout on channel originate

Using ARI (C#, AsterNET), I'm creating a channel via the Originate command:
var channel = client.Channels.Originate($"SIP/{number}#{destination}", app: appName, callerId: CLI, timeout: timeout);
This works fine; however,timeout starts from when the channel is created, and in reality I'd like to timeout to only be enforced once the channel starts ringing.
Is there any way (via ARI) to manipulate the timeout setting once the channel is created - so I could, for example, create the channel with an arbitrary timeout, and then (re)set the timeout once the channel state has changed to RINGING?
There is no way do timeout based on ringing in asterisk.
Not in dialplan, not in ARI or AMI or AGI. No at all.
Only complex things like listen for event and manualy hangup channels.
Instead of using originate:
POST /channels
you could use:
POST /channels/create
to create a channel without dialing immediately. This allows your Stasis Application to gain control of the channel before it is answered.
Before /channels/create, you should now be setting a StasisStart event handler that does /channels/dial and sets the timeout in this request.
This won't be for exactly when the channel starts ringing (since that is not possible to set), but it will be exactly when the channel is dialed, which is hopefully pretty close to what you're looking for.
Note: when using this method, you will likely want to be setting the Caller ID in the StasisStart event handler as well, since it cannot be set in the /channels/create request.

Asterisk Event to listen to for Transferred call

I'm building an application that listens to the Asterisk AMI to see when a user gets a call or makes a call out. I have got the events for when a user gets a call and when they make a call out. But what event do I listen for when a call gets transferred to a user or the user picks up the call with a feature code? The events that I am using now are AgentCalled and Newchannel. I would appreciate any advice on this topic. Thanks.
For asterisk 1.8 you have check
Transfer
Masquerade
Bridge
Hangup
events.
For 11+ bridge replaced by "Link" event.
Just do transfer and dump all events you got, you will see needed events for your asterisk version. There are more then one method of transfer, events will be different.

Asterisk: callerid is shown as anonymous

I'm trying to use asterisk to dial auto calls, but the problem is that the callerid is shown anonymous in the client device.
so how can I set the callerid to be shown correctly in the client device?
You're probably originating that call. Two methods are responsible for that:
ast_pbx_outgoing_app
ast_pbx_outgoing_exten
Based on how the origination is done, you may need to slightly modify apps/app_originate.c or res/res_clioriginate.c.
If you're using AMI (The Asterisk Manager Interface) to originate the call, you can just simply "Set" the variable CALLERID(all) to whatever you want to use.
The anonymous is the default value when NULL callerid is passed to one of the functions.

Do local db writes happen synchronously or asynchronously?

New to firebase and trying to understand how things work. I have an android app and plan to use the offline support and I'm trying to figure out whether or not I need to use callbacks. When I make a call like:
productNode.child("price").setValue(product.price)
Does that call to setValue happen synchronously on the main thread and the sync to the cloud happens asynchronously? Or does both execute asynchronously on a background thread?
The Firebase client immediately updates its local copy of the data with the new value. As part of this it fires any local (value, child_*) events that are needed.
Sending of the data to the database happens on a separate thread. If you want to know when this has completed, you can register a CompletionListener.
If the server somehow cannot complete the write operation (typically because the write violates a security rule), the client will fire any additional events that are needed to get the app back into the correct state. So in the case of a value listener it will then fire a second value event with the previous value.

Implement Call queues in adhearsion

I need to implement the below use-case in asterisk + adhearsion and not sure on how to do that
When a customer call comes. I check list of available agents if the agents are busy i need to put the call in a queue with a timeout. If the agents don't become free within the given timeout the call hangs-up otherwise call gets routed to the agent.
Any idea on how to implement this flow?
There are a few ways to implement this, your approach very much depends on how will you know if an agent is available? What I would recommend is:
Call comes in
Adhearsion router, routes the call to the inbound call controller
This in bound controller checks your list of agents
If the agent is available and not on a call you can use the "dial" command to call the agent and automatically join the two calls.
If the agent is available and has an active call you can use "join"
If there are no agents available then use the "play" command to play some hold music asynchronously, while you keep checking if an agent becomes available.
When you detect an agent is available you can then "stop" the hold music and dial the call to the agent.
In order to determine which agents are available you will need some sort of agent list and their associated status which you update as they take calls. Alternatively you can try pull some of this information directly from the asterisk extensions.conf file, or the DB if you are using PIAF.
Most of the code examples you need to write something like this are given on the Adhearsion website. http://www.adhearsion.com/docs
Edit:
The better way of approaching this now will be to use the ElectricSlide call queue module. There has been a lot of work done on it recently and it is now a pretty solid call queue.
https://github.com/adhearsion/electric_slide/

Resources