asterisk queue_log late COMPLETEAGENT - asterisk

I am trying to write a wallboard for my asterisk server. This wallboard will process the queue_log file in /var/log/asterisk.
Here is a scenario in question:
1) A customer calls out call center. Let his number be 44556677889900 and our number 8881234567890.
2) The customer enters the queue 210.
3) Agent 1 takes the call.
4) Agent 1 decides that the call should go to another queue. And transfers it to queue 209
5) Agent 2 takes the call.
6) Agent 2 terminates the call after talking with the customer. (When Agent 2 is talking on the phone Agent 1 is idle and available for a new call.
7) Normally Agent 1 ended his call at 4th step, but the log with COMPLETEAGENT appears just now, even the agent is available since 4th step
Here is the output in the queue_log:
1550582529|1550582516.26480|210|NONE|DID|8881234567890 * 1. step*
1550582529|1550582516.26480|210|NONE|ENTERQUEUE||44556677889900|1 * 2. step*
1550582531|1550582516.26480|210|Test Agent 1|CONNECT|2|1550582529.26493|2 3. step
1550582536|1550582536.26498|209|NONE|DID| ** 4. step**
1550582536|1550582536.26498|209|NONE|ENTERQUEUE||9991|1 4. step
1550582539|1550582536.26498|209|Test Agent 2|CONNECT|3|1550582536.26499|2 5. step
1550582543|1550582536.26498|209|Test Agent 2|COMPLETECALLER|3|4|1 6. step
1550582549|1550582516.26480|210|Test 1|COMPLETEAGENT|2|18|1 7. step
As mentioned in the 7th step, Agent 1 if available for new calls after he transfers the call to queue 209. (In fact if a new call comes, the system send the call to Agent 1). However the log "COMPTELEAGENT" appears only when the customer disconnects.
This makes my wallboard think that Agent 1 is busy even he is not. And worse if he received a new call before Agent 2 finishes, everything gets more complicated.
Questions:
1) How it is possible to make the system send the COMPLETEAGENT at step 4 ?
2) Why is ATTENDEDTRANSFER log missing ? (Not related to this problem directly but can also be connected)
Asterisk Version: 13.22.0
Freepbx 14.0.5.25
Thank you in advance.

1) System should not send COMPLEATEAGENT at 4, becuase thoose event should be sent AFTER END of call.
That event is created by QUEUE, not by AGENT. From queue's point of view call not yet finished.
If you want it be finished, do transfer of LEGA, not queue's LEG.
2)Transfer subsystem not related to queue subsystem and SHOULD NOT be related in any realible PBX. You can write your own if you want.
Side notes
no point parse queue_log, much simpler setup queue_log in mysql or other db and read it.
you can write your own queue system using Async AGI.
you can add as many logs as you want by using dialplan CEL or UserEvents.

Related

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.

Diffrence b/w "Hangup" and "Remote end Busy" in asterisk while calling through call file?

I am trying to make a call through call file it works fine but I was trying to check all the possible message displayed in cli when like user hangs the call,call to switch off number,if user is busy to other call.In case If user cuts the call the status is sometimes hangup and sometime busy .Exact message is given below
Call Failed To Go through, reason (5) Remote end is Busy
Call Failed To Go through, reason (1) Hangup
I don't know what the reason is as it display different messages everytime? and where to find meaning of error code (5) and (1) so I can look into details.
Interestingly enough, the reason codes returned back for call files are not the same as the canonical Asterisk hangup cause codes. Instead, most likely for historical compatibility reasons, call files use their own mechanism for what happened to a call. In this case, that would be:
0 - "Call Failure (not BUSY, and not NO_ANSWER, maybe Circuit busy or down?)"
1 - "Hangup"
2 - "Local Ring"
3 - "Remote end Ringing"
4 - "Remote end has Answered"
5 - "Remote end is Busy"
8 - "Congestion (circuits busy)"
(any other value) - "Unknown"
The interpretation of these should mostly be:
1 or 4 - the call was answered by the remote party
2 or 3 - the call was terminated by the initiator before the call was answered
5 - the remote end was busy
8 - the remote end was congested
0 or any other value - something bad happened to the call

Out Bound Dialing Asterisk

I have a calling application developed in PHP with AGI on Asterisk framework, below is the basic flow of application.
We receive a call from user at our Asterisk ss7 server and forward the same call to another user from our server.
I want to know the status of call forward to another user. Status means what happen with call between both users e.g. Hangup, Busy, Not Answered etc.
Not much detail on how you are placing the call or anything else but if you are performing a Dial() and want to know at the end of the call the result try ${DIALSTATUS}.
This will contain something like 'ANSWER', 'NOANSWER' or 'BUSY'. For the full list and more info check out http://www.voip-info.org/wiki/view/Asterisk+variable+DIALSTATUS
you can use CDR feature or use a diaplan to get the dialed status
http://www.voip-info.org/wiki/view/Asterisk+variable+DIALSTATUS
http://www.voip-info.org/wiki/view/Asterisk+cdr+mysql

FreePBX / Asterisk queue leastrecent Breaks on transfer

I am running into some weird issue's with queue's, It almsot seem's as if when you transfer, or go on hold it does not reset the lastcall time
Scenario –
John is on a call with a customer.
Mary is sitting available waiting for calls.
John finishes with her customer, transfers her customer to an external number, puts herself in ready, and gets the next call that comes in.
Mary is still sitting available.
After speaking with the team, they tell me that this is how it always works. If you’re on a call and you transfer your caller away you’re automatically put back into the queue as the person to get the next call. So, given this information, Mary could sit in ready status for two hours and not get a call if everything was timed just right and all of John’s calls were transfers.
This shouldn’t function this way. It should be the other way around. The next call should always go to the agent that has been available the longest.
Let me know what you think.
Asterisk version
Asterisk 1.8.11-cert10 built by root # 89-139-19-10.digium.internal on a x86_64 running Linux on 2013-01-02 22:24:23 UTC
FreePBX Base Version: 2.10.0rc1
FreePBX Framework Version:
FreePBX Core Version: 2.10.1.1
I think you messed with priority. You need setup context for return after transfer, in which you have put max priority and put again into queue.
It is hard to say how it exactly have look, but i am sure any asterisk developer can do that.
See examples on bottom of this page:
http://www.voip-info.org/wiki/view/Asterisk+config+features.conf

PHPAGI keeps the channel live

I have a PHP script on extension h. I think extension h should be executed after call is finished, however when one of the parties hangup and AGI script is being executed - another party still can see the call as "active" until the script is finished processing.
In this scenario I need the script to perform some actions for 5 seconds, however for one of the parties call duration increases by 5 "fake" seconds:
[10:54:48] x.php: >>> [NOTICE] One of the parties hanged up <<<
[10:54:53] x.php: >>> [NOTICE] Script took 5 seconds <<<
[10:54:53] -- <SIP/from-sip-00000584>AGI Script x.php completed, returning 0
[10:54:53] == Spawn extension (from-sip, 123456789, 10) exited non-zero on 'SIP/from-sip-00000584'
Question: how to hangup both parties before running an AGI script?
That is expected behavour.
h extension is designed for logging, not for something that can take seconds. Also it can hangup script if it take too much(zombie prevention).
If you need do long-time actions after call is ended, correct way will be put in agi(better fastagi) script just code to log/prepair needed action(put info in temporary sql table or file).
After that you can do actions based on saved info in external daemon/script. As result every action can take hours without affection asterisk perfomance or calls

Resources