Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7495839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T18:21:00+00:00 2026-05-29T18:21:00+00:00

I’m trying to make a web page which lists unanswered calls from CDR. On

  • 0

I’m trying to make a web page which lists unanswered calls from CDR. On incoming call all softphones and some mobile phones ring simultaneously. Asterisk version is 1.8.5.

Here is what gets written to CDR table for a single ANSWERED call:

╔═════════════════════╦══════╦═════════╦═════╦══════════╦═══════════════════════════╦═══════════════════════════╦═════════╦═══════════════════════╦══════════╦═════════╦═════════════╦══════════╦═════════════╦═══════════╦════════════════╦══════════╗
║      calldate       ║ clid ║   src   ║ dst ║ dcontext ║          channel          ║        dstchannel         ║ lastapp ║       lastdata        ║ duration ║ billsec ║ disposition ║ amaflags ║ accountcode ║ userfield ║    uniqueid    ║ imported ║
╠═════════════════════╬══════╬═════════╬═════╬══════════╬═══════════════════════════╬═══════════════════════════╬═════════╬═══════════════════════╬══════════╬═════════╬═════════════╬══════════╬═════════════╬═══════════╬════════════════╬══════════╣
║ 2012-02-06 12:40:45 ║      ║ 5020971 ║ 595 ║ OUTGOING ║ Local/595@OUTGOING-5d9a;2 ║ SIP/help.desk-000000b8    ║ Dial    ║ SIP/help.desk/595,,Tt ║        8 ║       0 ║ ANSWERED    ║        3 ║             ║           ║ 1328524845.301 ║        0 ║
║ 2012-02-06 12:40:45 ║      ║ 5020971 ║ 599 ║ OUTGOING ║ Local/599@OUTGOING-038b;2 ║ SIP/help.desk-000000b9    ║ Dial    ║ SIP/help.desk/599,,Tt ║        8 ║       0 ║ NO ANSWER   ║        3 ║             ║           ║ 1328524845.303 ║        1 ║
║ 2012-02-06 12:40:44 ║      ║ 5020971 ║ s   ║ to_tech  ║ SIP/help.desk-000000b6    ║ Local/595@OUTGOING-5d9a;1 ║ Queue   ║ TECH,Tt,,,300         ║      111 ║     110 ║ ANSWERED    ║        3 ║             ║           ║ 1328524844.298 ║        0 ║
╚═════════════════════╩══════╩═════════╩═════╩══════════╩═══════════════════════════╩═══════════════════════════╩═════════╩═══════════════════════╩══════════╩═════════╩═════════════╩══════════╩═════════════╩═══════════╩════════════════╩══════════╝

The SQL to get the unanswered calls is this:

SELECT * FROM cdr WHERE disposition = 'NO ANSWER' AND imported='0'

Needless to say, I’m getting false positives with calls that are actually answered. 🙂

They only link I see is that the NO ANSWER and ANSWERED lines have very short time interval between them (and they share the same src number).

Now, before I go ahead and start checking if there are some ANSWERED calls from the same number with a close time interval (like 3 seconds), I’d like to hear if someone knows a better way to solve this.

I don’t speak extensions.conf very fluently and the guys who actually put our dialplan up are long gone but I noticed this in extensions.conf:

[class1]
exten => s,n,SET(CDR(accountcode)=${UNIQUEID})
include => accounts
include => OUTGOING

If I get this straight, the exten line there is supposed to set accountcode field in the CDR table to a value of the incoming call’s uniqueid? Anyway it is not working as the accountcode field is never filled in the table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T18:21:02+00:00Added an answer on May 29, 2026 at 6:21 pm

    If I am reading that output correctly, it seems that the call came in and was put into a queue, then the Queue() app transferred the call to an agent (599) who did not answer, so the call was then transferred to another agent (595), who then answered the call.

    In addition, it seems that each time the call is handled by the Queue() application, it is given a new call id, so it makes it very difficult to track.

    What I would suggest, for this specific issue with Queues, is to use the QueueLog functionality, which can be integrated with SQL. You can then track the call in the QueueLog table, and track each step and transfer it made in the QueueLog SQL Table.

    It will then be possible to construct an SQL query to join the QueueLog table with the cdr table to see which unique calls were unanswered, as opposed to a situation like the one you currently have.

    EDIT:

    Step-by-step instructions can be found at : http://www.voip-info.org/wiki/view/Asterisk+queue_log+on+MySQL . Queue events will then be inserted into a table, which looks like:

    mysql> select * from queue_log;
    +----+------------+--------------+------------------+-------+------------+-------+
    | id | time       | callid       | queuename        | agent | event      | data  |
    +----+------------+--------------+------------------+-------+------------+-------+
    | 1  | 1198356717 | 1198356717.0 | voipsolutions.ru | NONE  | ENTERQUEUE | |serg |
    | 2  | 1198356719 | 1198356717.0 | voipsolutions.ru | NONE  | ABANDON    | 1|1|2 |
    +----+------------+--------------+------------------+-------+------------+-------+
    

    You can then track the queue activity using this table.

    Hope that helped.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm trying to select an H1 element which is the second-child in its group
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.