Retrieving events and CDR about recorded calls

The API supports two types of approaches to retrieve information about calls being recorded:

  • Application can subscribe on call start/stop events and can get notified by the API about the ongoing calls under recording
  • Application can request a list of currently recorded calls and get detailed Call Detail Record information

If the application wants to continuously retrieve information about the ongoing calls, we strongly recommend to use the first approach by subscribing to call events, instead of periodically or occasionally requesting the list of ongoing calls.

In a multi-site deployment, where more then one Recording Server is deployed, the application has to establish connection with all recording services individually.

The XML used in the Call Detail Response (below) is in the same format as the Call Detail Recorder XML file stored next to the media files.

Subscribe to call events

In order to obtain detailed data about currently recorded calls the application has to subscribe to events.

You can specify to trigger notifications for all calls, or in a selective way by specifying phone numbers. The connection has to be kept open to receive the notifications. If the remote side closes the connection, the socket has to be destroyed on the application side as well.

Subscribe request

Use the Extension attribute to subscribe to call events only for the specified phone numbers. The phone number can appear as called or calling party number.

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Request type="SubscribeOnCallEvent" id="1">

<Extension number="1000"/>

</Request>

</VerbaApi>

Subscribe response

For successful subscribe request, the system responses with the following message:

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Response code="0"">

<Request type="SubscribeOnCallEvent" id="1"/>

<Keepalive time="10"/>

</Response>

</VerbaApi>

To monitor the connection between the application and the recording service, and keep it alive, the application can use an optional keep alive mechanism. In this case the API server sends an empty response with the next keep alive interval. If the server cannot send the keep alive message or the application does not receive the next keep alive message within the time set by the previous request * 1.5, then session should be interpreted as ended/closed/disconnected.

Call start notification

Example for call start event notification:

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Response code="0">

<Request type="SubscribeOnCallEvent" id="1"/>

<CallEvent event="Start"/>

<verbacdr state="0"> <!-- Ongoing Call State -->

<id>1651d3c9-7bce-11e0-a220-005056c00008</id>

<native_id>b9eda00-dca1876d-56f-d201a8c0@192.168.1.210</native_id>

<location>PETER-LAPTOP</location>

<source_caller_id>2000</source_caller_id>

<destination_caller_id>9970</destination_caller_id>

<start_time>2011.05.11 12:56:33.603</start_time>

<audio_codec_id>6</audio_codec_id> <!-- G.722 64 kbps -->

<direction_id>1</direction_id> <!-- Incoming -->

<signaling_id>2</signaling_id> <!-- SIP -->

<recorder_service_id>5</recorder_service_id> <!-- Dial-in Recorder -->

<ondemand>false</ondemand>

<conference>false</conference>

<files>

<file expected_url="2011\05\11\1651d3c9-7bce-11e0-a220-005056c00008_(20110511145633604).wav" ></file>

</files>

<media>

<mediasegment id="0" start_time="2011.05.11 12:56:33.605">

<mediadescriptor>

<destination ip="192.168.1.75" port="16384" bitrate="64000" tipsupported="false" />

<content type="main"/>

<codecs>

<codec name="G722" pt="9" clk="8000" />

</codecs>

</mediadescriptor>

</mediasegment>

</media>

</verbacdr>

</Response>

</VerbaApi>

Call end notification

Example for call end notification message:

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Response code="0">

<Request type="SubscribeOnCallEvent" id="1"/>

<CallEvent event="Stop"/>

<verbacdr state="1"> <!-- Finished Call State -->

<id>1651d3c9-7bce-11e0-a220-005056c00008</id>

<native_id>b9eda00-dca1876d-56f-d201a8c0@192.168.1.210</native_id>

<location>PETER-LAPTOP</location>

<source_caller_id>2000</source_caller_id>

<destination_caller_id>9970</destination_caller_id>

<start_time>2011.05.11 12:56:33.603</start_time>

<end_time>2011.05.11 12:56:50.012</end_time>

<audio_codec_id>6</audio_codec_id> <!-- G.722 64 kbps -->

<direction_id>1</direction_id> <!-- Incoming -->

<cause_id>0</cause_id> <!-- Normal -->

<signaling_id>2</signaling_id> <!-- SIP -->

<recorder_service_id>5</recorder_service_id> <!-- Dial-in Recorder -->

<ondemand>false</ondemand>

<conference>false</conference>

<files>

<file expected_url="2011\05\11\1651d3c9-7bce-11e0-a220-005056c00008_(20110511145633604).wav" >2011\05\11\1651d3c9-7bce-11e0-a220-005056c00008_(20110511145633604).wav</file>

</files>

<media>

<mediasegment id="0" start_time="2011.05.11 12:56:33.605" end_time="2011.05.11 12:56:37.743">

<mediadescriptor>

<destination ip="192.168.1.75" port="16384" bitrate="64000" tipsupported="false" />

<content type="main"/>

<codecs>

<codec name="G722" pt="9" clk="8000" />

</codecs>

<statistics>

<start_time>2011.05.11 12:56:33.616</start_time>

<rtp total="121" lost="0" duplicated="0" outoforder="0" outofbuffer="0" streamchange="1"/>

<decoding ok="232" error="0" skipped="0" outofbuffer="0" resync="1"/>

<mixing normalwrite="232" solowrite="0" silencewrite="0" latemedia="0" resync="0"/>

</statistics>

</mediadescriptor>

</mediasegment>

<mediasegment id="1" start_time="2011.05.11 12:56:37.743" end_time="2011.05.11 12:56:50.012"></mediasegment>

</media>

</verbacdr>

</Response>

</VerbaApi>

Requesting information about ongoing calls

External applications can request a list about the currently recorded calls. With this list, the application can also request additional, detailed information about each call.

List request

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Request type="GetCallList" id="1"/>

</VerbaApi>

List response

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Response code="0">

<Request type="GetCallList" id="1"/>

<CallList>

<Call id="bd0b8ae0-7704-11e0-a230-005056c00008">

<Call id="c00d562f-7704-11e0-a230-005056c00008">

</CallList>

</Response>

</VerbaApi>

Call detail request

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Request type="GetCallDetail" id="1">

<Call id="c00d562f-7704-11e0-a230-005056c00008">

</Request>

</VerbaApi>

Call detail response

<?xml version="1.0" encoding="UTF-8"?>

<VerbaApi>

<Response code="0">

<Request type="GetCallDetail" id="1"/>

<verbacdr state="1"> <!-- Finished Call State -->

<id>1651d3c9-7bce-11e0-a220-005056c00008</id>

<native_id>b9eda00-dca1876d-56f-d201a8c0@192.168.1.210</native_id>

<location>PETER-LAPTOP</location>

<source_caller_id>2000</source_caller_id>

<destination_caller_id>9970</destination_caller_id>

<start_time>2011.05.11 12:56:33.603</start_time>

<end_time>2011.05.11 12:56:50.012</end_time>

<audio_codec_id>6</audio_codec_id> <!-- G.722 64 kbps -->

<direction_id>1</direction_id> <!-- Incoming -->

<cause_id>0</cause_id> <!-- Normal -->

<signaling_id>2</signaling_id> <!-- SIP -->

<recorder_service_id>5</recorder_service_id> <!-- Dial-in Recorder -->

<ondemand>false</ondemand>

<conference>false</conference>

<files>

<file expected_url="2011\05\11\1651d3c9-7bce-11e0-a220-005056c00008_(20110511145633604).wav" >2011\05\11\1651d3c9-7bce-11e0-a220-005056c00008_(20110511145633604).wav</file>

</files>

<media>

<mediasegment id="0" start_time="2011.05.11 12:56:33.605" end_time="2011.05.11 12:56:37.743">

<mediadescriptor>

<destination ip="192.168.1.75" port="16384" bitrate="64000" tipsupported="false" />

<content type="main"/>

<codecs>

<codec name="G722" pt="9" clk="8000" />

</codecs>

<statistics>

<start_time>2011.05.11 12:56:33.616</start_time>

<rtp total="121" lost="0" duplicated="0" outoforder="0" outofbuffer="0" streamchange="1"/>

<decoding ok="232" error="0" skipped="0" outofbuffer="0" resync="1"/>

<mixing normalwrite="232" solowrite="0" silencewrite="0" latemedia="0" resync="0"/>

</statistics>

</mediadescriptor>

</mediasegment>

<mediasegment id="1" start_time="2011.05.11 12:56:37.743" end_time="2011.05.11 12:56:50.012"></mediasegment>

</media>

</verbacdr>

</Response>

</VerbaApi>