Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CDRs are sent after every call, whether or not it was answered/handled. These are used for call accounting both on the providers side as well as in the 3rd party application. As CDRs are critical we make use of a persistent Redis List to send them. A single worker must exist which handles/processes these notifications.

 

Redis

Key

enigma:notifications:campaigns

Type

List

Key

("BLPOP" for FIFO)

Code Block
languagejs
//Notification Example 
brpop enigma:notifications:campaigns

Payload


{
    type:
cdrpayload: <notif>
  • extension: <ext> agent extension number
  • number: the number that was dialed (from v1.1.2)
  • call_ref: <internal_call_ref> 
     "cdr",
        payload: {
            extension    : <ext>,
            number       : <client_number>,
            dial_number  : <dial_number>,
            recording_url: <recording_url>,
            call_ref     : <internal_call_ref>,
            contact_ref  : <custom_call_ref>,
            dialed_at    : <dialed_at>,
    		call_time    : <call_time>,
            end_reason   : <disposition>,
            end_code     : <ISDN_termination_code>,
            call_dir     : <call_dir>,
            ref          : <campaign_ref>
        }
    }
    • <ext> agent extension/number
    • <client_number> clients number
    • <dial_number> the dialers number
    • <internal_call_ref> Internal dialler call reference (the call_ref used to download recordings)
    • contact_ref: <custom_call_ref> ref> your custom call reference
    • dialed<dialed_at: at> time the call was placed
    • end_reason: <disposition> how the call ended
    • end_code: <SIP<ISDN_termination_code>
    • call<call_time: > duration of call in seconds
    • call<call_dir: > whether this was was inbound or  or outboundrecording
    • <recording_url: url> location where you can fetch recording (via FTP, this is not recommended, and may be removed)
    • ref: <campaign_ref> campaign reference

    Values:

    <ext>The agent extension number
    <internal_call_ref>Internal dialler call reference, this is used to disposition the call and download recordings
    <custom_call_ref>Your custom call reference specified for this callee (use this for your lookups)
    <disposition>

    Dispositions: how the call ended

    info

    Dispositions were remapped from v1.1.2

    <SIP_termination_code>The SIP termination code
    <campaign_ref>Your Campaign reference
    <client_number>

    The clients number (as opposed to the agent)

    • Inbound: callers number (can be empty if the callers number is set to private)
    • Outbound: dialed number
    <dial_number>

    The dialers number (as opposed to the callee)

    • Inbound: number dialer was contacted on
    • Outbound: campaign outbound ID

    Example:

    Code Block
    languagebash
    themeMidnight
    # get cdr's for all campaigns
    brpop enigma:notifications:campaigns

    When will you get a CDR?

    You will receive a CDR for each call that the dialer makes, at the end of the call. 

    If a callee has multiple numbers, it will try the numbers in order and send a CDR for each number it tried to call, if a call is connected then the callee has been contacted and the rest of the numbers won't be called. 

    Key CDR Indicators

    ConditionsMeaning
    extension is nullCallee hangup in queue (before being connected to an agent)
    Warning

    Only one integrator can consume CDR's currently. This is a limitation in how a Redis List was designed, and we use a Redis List here to be reliable. Its an unfortunate limitation that will be fixed in the future but requires a lot of planned features to be implemented first and the completion of a fairly large rearchitecting of the application.