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/
Related
SignInManager offers both these methods, but what is the advantage over the other? Wouldn't you always need to wait for the result of the Sign-in before proceeding?
SignInManager.PasswordSignInAsync and SignInManager.PasswordSignIn are doing the same thing. The difference is that the first one follows the TAP (Task based Asynchronous Pattern).
The Task-based Asynchronous Pattern (TAP) is based on the System.Threading.Tasks.Task and System.Threading.Tasks.Task<TResult> types in the System.Threading.Tasks namespace, which are used to represent arbitrary asynchronous operations.
SignInManager.PasswordSignInAsync and SignInManager.PasswordSignIn are used to sigin a user and they need to access to your database to check if that user and the given password are correct or not. You're doing an I/O operation because your application need to connect another external ressource like disk or network (like access to a database).
It's a good practice that every I/O operation should use TAP that is why the presence of SignInManager.PasswordSignInAsync method. You should use that method whenever you can. If you can't then use SignInManager.PasswordSignIn.
Because you're using ASP.Net MVC so I explain more in details in this answer why you should prefer TAP.
I'm just getting started with Meteor and I have a REST API hooked up with publish / subscribe that can periodically update per client. How do I run this behavior once globally and only refresh as long as a client is connected?
My first use case is periodically refreshing content while clients are active. My second use case is having some kind of global lock to make sure a task is only happening once at a time. I'm trying to use Meteor to make a deployment UI and I only want 1 deployment to happen at once.
publish/subscribe will work automatically only when clients are connected. However, do not put any functionality that you want to control amount of execution times in publish or subscribe functions. They might run arbitrary amount of times.
If you want some command to be executed by any client use Meteor.methodss on server side, and call it explicitly with Meteor.call from client template event.
To make sure that only one deployment happens at any given time, simplest way would be to create another collection, called for example, CurrentDeployments.And any time deployment script function in Meteor.methods is executed, check with CurrentDeployments.findOne if there are ongoing deployment or not, and only call new one if none is running.
As a side bonus, subscribe to CurrentDeployments in client, to disable 'deploy' button in case one is already running.
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.
I am currently writing an orchestration that is directly bound to the message box, picks up messages and filters according to the filter expression in the receive shape inside said orchestration. The problem I'm having is this; I want to be able to change the filter in the BizTalk bindings, just like send filters are changed in the bindings. Really, I just don't want to have to recompile and re deploy every time My filter changes. Is there a way to do this? I'm thinking maybe modify the binding.xml file somehow, or possibly try a custom pipeline with configurable properties(as my last resort).
If it matters I typically use the BizTalk Deployment Framework for deployments.
No, it is not possible to modify a Receive Shape Filter at Runtime.
If the filter needs to be dynamic, then you will have to apply that logic upstream. The idea of using a custom Pipeline Component is a common solution.
One other approach to consider is leaving you Receive Shape Filter broad and testing each incoming message with the BRE. If it 'passes', continue processing, otherwise exit. BRE Policies/Rules can be updated at runtime.
For this sort of thing you will probably want to execute Business Rules in the Receive Pipeline that then sets a context property on the message that then determines the routing.
That way the filter in the Orchestration is lightweight and doesn't need to be changed.
See http://brepipelineframework.codeplex.com/ (Disclosure: This is written by a colleague of mine)
I am creating a node.js module which communicates with a program through XML-RPC. The API for this program changed recently after a certain version. For this reason, when a client is created (createClient) I want to ask the program its version (through XML-RPC) and base my API definitions on that.
The problem with this is that, because I do the above asynchronously, there exists a possibility that the work has not finished before the client is actually used. In other words:
var client = program.createClient();
client.doSomething();
doSomething() will fail because the API definitions have not been set, I imagine because HTTP XML-RPC response has not returned from the program.
What are some ways to remedy this? I want to be able to have a variable named client and work with that, as later I will be calling methods on it to get information (which will be returned via a callback).
Set it up this way:
program.createClient(function (client) {
client.doSomething()
})
Any time there is IO, it must be async. Another approach to this would be with a promise/future/coroutine type thing, but imo, just learning to love the callback is best :)