I have installed asterisk 11 and configured the voip account.And am originate the call
If the call answered am sending to context ,s,1
If the call not answering am sending to context,failed,1
Issue : When the originated call in answered am getting single entry in CDR, but when the call is not answered or busy am getting two CDR entries with different unique ids.
Below is the command I am using to originate:
Action: Originate
CallerID:+911233211233
WaitTime: 30
Channel: SIP/Voip/mynumber
Context: asteriskdial
Exten: s
Priority: 1
example :I am originating a call and enduser rejected the call and the call came context asteriskdial,failed,1. But when I have NoOp the unique id in the context am getting different unique id and disposition as answered of the Busy call. And in CDR there are two entry one with actiual dial entry with proper entry and second one as wrong dispositions.
Can any one help on this??
Uniqueid is different on every different leg.
If you want not see unanswered calls, check cdr.conf unanswered= param.
Related
By default, asterisk will generate a CDR on every finished call into a database cdr table. i want asterisk to add record into database cdr table when the agent answered call.
First of all if you working with queue/agents - use queue_log
Options you are searching located in cdr.conf
https://github.com/asterisk/asterisk/blob/master/configs/samples/cdr.conf.sample
I am intending that you are talking about queues. There is an option in cdr.conf, you can set "unanswered = no". But I think if you are using musiconhold(moh) then for most of the DID/TFN providers do not support early media so you have to answer the call first.
You have to modify your dialplan to set the disposition to unanswered when the call is not answered by any agent. You can check the call when the call is exiting the queue if its queuestatus is "abandon" then set it to "unanswered".
We have a case where we only want one HTTP request to go out at a time and only want to allow retry or call again if the pending call either succeeds or fails. We've been doing the classic wrap it in a boolean but were wondering if there was an operator for it. My hunch is no.
I think you would need switchMap. It will only subscribe to the last value of the external observable and it will map it to an internal observable. With switchMap, its possible to cancel previous http requests on the fly.
For more info take a look in the following link
I'm investigating F# agents that have multiple states, i.e., using the "let rec/and" keyword combination (per Expert F# 3.0's "Message Processing and State Machines") to provide multiple async blocks. The only example I've been able to find so far is the "throttling agent" discussed here (also Fssnip.net). Are there any other resources for learning this pattern?
edit: My specific application is an agent that has two states,
| StartFeed rateMultiplier replychannel ->
- replychannel out data values at a delay (provided with each value)
multiplied by rateMultiplier
- loop by using
thisAgent.Post(StartFeed rateMultiplier replychannel)
| Pause ->
I would like to provide some way to pass in a feed rate multiplier value that increases/decreases the delay by the passed-in multiplier in the "feed" async state, without interrupting the feed of values. I guess the question boils down to "how do you keep an async state block actively looping while still being aware of new messages?" Almost like skipping the inbox.Receive asynchronous wait, unless a message actually comes in? Inbox.scan?
edit 2: Given the message queue aspect of MailboxProcessor, I can see that an external message (with a different rateMultiplier value) that is received by the agent and placed in the queue will successfully change the rate without interrupting the flow of data values out. Any advice on the "Pause" would be still be appreciated.
I have found Tomas Petricek's entry https://github.com/tpetricek/FSharp.AsyncExtensions/blob/master/src/Agents/BlockingQueueAgent.fs , which gives an agent, with the standard mailboxprocessor queue, a way to choose what async block it will employ to process the next incoming message (ie, let the agent 'change its state'):
inbox.Receive() is used for the 'standard state' - the agent's message 'inbox' queue is neither full nor empty (State #1)
inbox.Scan() is used for the 'edge' or limiting cases of empty (State #2) and full (State #3) message 'inbox' queue
the actions the agent (in whichever of the three states) can take in response to received messages are written as **distinct async blocks that are given their own 'and' async block in the agent's 'let rec' loop; I had thought that 'let rec...and...' async blocks were restricted to having a message receipt function (.Receive, .Scan, etc), which is incorrect, they may be any async block that maintains the desired control flow, as seen in the next feature of the 'let rec...and...' agent body:
once the agent, in whichever of the 3 states, responds to a new message by routing to the appropriate action, the action is itself finished with a call to another 'and' async block of the agent body 'let rec' loop, a 'chooseState()', an if/then block that determines which state will handle a new message and calls that 'and' async block from among the 3 available.
This example seems essential in demonstrating idiomatic use of the multi-state agent body construction, specifically how to combine the three functions of message receipt, response, and looping control as mutually recursive elements of a single 'let rec...and...and..." construction.
Of course other message-passing frameworks exist, but this is a general logic/routing design for a more complex agent, whatever the framework, so:
thanks, Tomas.
How can I get call duration during the call via AMI?
something like Status() or CoreShowChannels() but seconds needs to be after Answering call
You have following options:
1)You can collect "Link" events and store info about calls start in your application. AMI is not designed to got call info. This one is CORRECT way.
2) issue command
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+Command
with
"core show channel CHANNEL_NAME_HERE"
It will have info about duration
3)Other option is get variable CDR(billsec)
http://www.voip-info.org/wiki/view/Asterisk+Manager+API+Action+GetVar
My Node.js application accepts connections from the outside. Each connection handler reads a SET on Redis, eventually modifies the set itself, then moves on. The problem is that in the meanwhile another async connection can try to read the same SET and try to update it or decide its next step based on what it reads.
I know that Redis does its best to be atomic, but this is not quite sufficient for my use case. Think about this: the set is read to understand if it's FULL (there is a business rule for that). If it's FULL, then something happens. The problem is that if there is one only slot left, two semi-concurrent connections could think each one is the last one. And I get an overflow.
I there a way to keep a connection "waiting" for the very short time the other eventually needs to update the set state?
I think this is a corner case, very very unluckely... but you know :)
Using another key as the "lock" is an option, or does it stink?
How about using blpop to do locking. blpop key 5 to wait 5 seconds for key. At start put item(to identify queue is not empty) at key. The connection acquiring the lock should remove item from key. The next connect then can't acquire the lock, because empty, but blpop has the following nice property:
Multiple clients can block for the same key. They are put into a
queue, so the first to be served will be the one that started to wait
earlier, in a first-BLPOP first-served fashion.
When connection which acquired lock has finished task it should put back item back in queue, then the next connection waiting can acquire lock(item).
You may be looking for WATCH with MULTI/EXEC. Here's the pattern that both threads follow:
WATCH sentinel_key
GET value_of_interest
if (value_of_interest = FULL)
MULTI
SET sentinel_key = foo
EXEC
if (EXEC returned 1, i.e. succeeded)
do_something();
else
do_nothing();
else
UNWATCH
The way this works is that all of the commands between MULTI and EXEC are queued up but not actually executed until EXEC is called. When EXEC is called, before actually executing the queued instructions it checks to see if sentinel_key has changed at all since the WATCH was set; if it has, it returns (nil) and the queued commands are discarded. Otherwise the commands are executed atomically as a block, and it returns the number of commands executed (1 in this case), letting you know you won the race and do_something() can be called.
It's conceptually similar to the fork()/exec() Unix system calls - the return value from fork() tells you which process you are (parent or child). In this case it tells you whether you won the race or not.