Huge thanks to Joshua Colp for mirroring services

Asterisk RTP Monitoring

Share on Twitter Digg this story Click to view a printable version Thu, 24 Sep 2009 21:50:38 -0300

thumnail

Tzafrir has committed some documentation to his branch for RTP Monitoring:

Asterisk RTP Monitoring

This document describes using the Monitoring To RTP feature of Asterisk. Note that this feature is still work in progress.

"RTP Monitoring" adds an extra backend to the current Monitor (recording) code: rather than recoding calls to files, send them as RTP streams over the network to a resording server. The RTP streams are proided with extra meta-data through dummy SIP INVITE (at the beginning) and BYE (in the end of the call) messages.

Usage

RTP monitoring is configured through monitor.conf (a file currently only used for this feature). See a sample/reference file in the configs directory.

In order for recording to work, 'rtp_server' under [general]' must be set. Set it to the server to which you wish to send recordings.

In order for calls to be recorded you also need to:

1. Set the channel to be monitored. Use one of the following:

- An explicit Monitor(wav) in the dialplan. Note that the value used here ('wav') will actually be ignored.
- Set(AUTO_MONITOR=wav) in the dialplan. As before, the actual value will be ignored.
- setvar = AUTO_MONITOR=wav in the channel configuration (sip.conf, iax.conf, chan_dahdi.conf, maybe others).

2. (If not a DAHDI channel) set a unique port offset in the variable RTP_PORT_OFFSET . This should be unique for the run-time.

The requirement for RTP_PORT_OFFSET is ugly and should hopefully be removed soon.

There are two RTP streams per recorded channel (one for rx and one for tx). At the moment the rx stream is sent to port 9000+RTP_PORT_OFFSET and the tx stream is sent to port 11000+RTP_PORT_OFFSET (the numbers 9000 and 11000 can be modified in monitor.conf).

Oreka / Orecx

Support for recording the produced streams of this plugin has been added in recent SVN versions (try using at least rev. 641) of orkaudio. In order to use it, add the following line inside the tag in /etc/orkaudio/config.xml

<DahdiIntercept>yes</DahdiIntercept>

I hope it will be renamed to something along the lines of 'AsteriskIntercept' as the code should not have anything DAHDI-specific.

Wireshark

The generated streams can be shown in wireshark. Either capture in it directly or capture in tcpdump:

tcpdump -s 0 -w recordings.cap #add custom filter here

In Wireshark use Statistics => RTP => Show All Streams

This opens a window in which each stream is shown (there are two such streams per recorded channel).

Testing

The following can be used to generate a call without any other channels about in the system:

In extensions.conf:

[rtp-monitor]
exten => genrec,1,Answer
exten => genrec,n,Set(AUTO_MONITOR=wav)
exten => genrec,n,Set(RTP_PORT_OFFSET=23)
exten => genrec,n,Dial(Local/answer-rec@rtp-monitor/n)
exten => genrec,n,Hangup

exten => answer-rec,1,Answer
exten => answer-rec,n,Set(AUTO_MONITOR=wav)
exten => answer-rec,n,Set(RTP_PORT_OFFSET=29)
exten => answer-rec,n,Playback(demo-thanks)
exten => answer-rec,n,Hangup

And now generate a call with:

asterisk -rx 'channel originate Local/genrec@rtp-monitor/n application Echo'

Bugs

Many. Did I mention work in progress?

  • The fact that you have to set RTP_PORT_OFFSET for channels.

  • It takes restarting Asterisk or so to re-read monitor.conf.

  • Starting a monitoring with Monitor() can crash Asterisk. Didn't look into it yet.

  • In a normal Hangup, the channel's CDR gets destroyed before the channel's monitors are destroyed. Which means that the CDR data is not availalable when we send the BYE. This was not the case in 1.4. There is an ugly and very partial workaround in the code for that.


You haven't voted yet! Vote:
Current Rating: 5.33/10 (3 votes)

Comments (Click to post)

Comments
Name:
Subject:
Website:
Message: 

Similar Articles (Based on Title)

Asterisk Installation CD set. with 24/7 monitoring - March 27, 2005
Paul Mahler of signate.com has posted a note to the Asterisk-Users list on a new commercial Asterisk CD Set.

*starShop: Open Source Calling Shop Monitoring System - August 19, 2005
The writers of a new open source call shop monitoring system have mailed us to let you know of their first release.

New GTK Gui for Monitoring and Administration - July 12, 2006
j has posted details of a new GUI for Asterisk.

Tutorial: Simple queue and agent debug monitoring - October 11, 2006
Lenz has posted another tutorial, this one on receiving just the information you need in a call center.

Monitoring Asterisk with Munin - January 7, 2010
I had a few requests for these munin plugins after some discussion on one of the Asterisk lists and thought people might like them.

Monitoring Asterisk with OpenNMS - January 8, 2010
The OpenNMS blog has an article on monitoring Asterisk with OpenNMS using SNMP.

Asterisk Monitoring with iPhone and iPod touch - February 12, 2010
For the past couple of weeks I have been working on an app that allows you to monitor and restart Asterisk servers.

Asterisk-Dev: Patch 2570: More verbose RTP debugging - October 23, 2004
Filip Olsson has posted details of a patch to allow more verbose RTP debugging.

Convergence: IAX2 trunked (vs) IAX2+trunking (vs) RTP (vs) cRTP - October 31, 2004
Wasim has put up a comparisson of packet usages between diferrent methods of communication (trunking)

RTP timing problems patch - October 5, 2005
Carlos Antunes has posted details of a patch he has written which will generate timing independently of incoming packets.

Secure RTP - ready for testing - June 20, 2006
Olle has posted details of a testing branch for Secure RTP.

RTP packetization - August 18, 2006
Dan Austin has posted details of some packetization patches that need review.

RTP Packetization - September 1, 2006
Dan Austin has posted some details about a patch for RTP Packetization he is trying to complete (bugid 5162).

rtpBreak - detects, reconstructs and analyzes any RTP session - June 5, 2007
Michele Dallachiesa has posted details of an RTP analysis package.

AST-2009-004: Remote Crash Vulnerability in RTP stack - August 4, 2009
An attacker can cause Asterisk to crash remotely by sending malformed RTP text frames. While the attacker can cause Asterisk to crash, he cannot execute arbitrary remote code with this exploit.


Original Content (C) 2004-2010 Matt Riddell
Back 5  Feed Add
to
Google Subscribe with Bloglines
Go to today

Icons by: FastIcon.com


Back to life
July 21, 2010 Average Vote: 10
Hey all - I am back online after some pretty big projects which have taken all my time. Will be updating the Asterisk news over the next few days.

Nerd Vittles: Building a Bluetooth Proximity Detection System with Asterisk
December 12, 2005 Average Vote: 10
The Nerd Vittles site has an article on proximity detection using Asterisk and a TomTom GPS

Automated Testing Update
July 30, 2010 Average Vote: 10
Russell Bryant has posted details of a new mailing list for automated testing of Asterisk and some information on the progress that has been made. There is no way to say how important I think this work is. It really makes a huge difference to Asterisk and the ability to use it in an enterprise environment. Really great work.

VoIP-Info: FFasterisk Video file converter
August 25, 2006 Average Vote: 10
The wiki has a link to a new piece of software for converting video to the format required for Asterisk.

Code Review: SRTP support for Asterisk
March 12, 2009 Average Vote: 10
Terry Wilson has moved his SRTP branch onto the Digium review board.

HumBug - Pre BETA Launch Registration
July 27, 2010 Average Vote: 10
Nir Simionovich has posted details of the beta of the new call analytics service.

Interview with BKW_
December 7, 2004 Average Vote: 10
We've finally completed our interview with BKW. Hope you like! :-)

SlashDot: GSM and Asterisk Integration
August 21, 2005 Average Vote: 10
There is a post up on SlashDot which talks about using cellphones with Asterisk.

Interview with Mark Spencer
November 26, 2004 Average Vote: 9.9
We have managed to get an interview with Mark Spencer AKA Markster. Mark Spencer is the creator of Asterisk and by far the most active developer.

Asterisk and Kamailio realtime integration tutorial
May 24, 2010 Average Vote: 9.9
Daniel-Constantin Mierla has posted a link to a tutorial on integrating Asterisk and Kamailio using realtime.

Asterisk IPv6 update
February 1, 2010 Average Vote: 9.8
Olle has posted an update on IPV6 in Asterisk and a link to a blog post of his.

Proposal for T.38 transparent gateway design in Asterisk
April 29, 2010 Average Vote: 9.8
Kevin Fleming has posted a proposed design for a transparent T.38 gateway for Asterisk:

Asterisk Monitoring with iPhone and iPod touch
February 12, 2010 Average Vote: 9.7
For the past couple of weeks I have been working on an app that allows you to monitor and restart Asterisk servers.

Monitoring Asterisk with Munin
January 7, 2010 Average Vote: 9.7
I had a few requests for these munin plugins after some discussion on one of the Asterisk lists and thought people might like them.

New Zealand Asterisk Voices
March 2, 2006 Average Vote: 9.7
Chris Hodgetts has posted details of recordings of Asterisk Sounds with a New Zealand accent.


Automated Testing Update
July 30, 2010
Russell Bryant has posted details of a new mailing list for automated testing of Asterisk and some information on the progress that has been made. There is no way to say how important I think this work is. It really makes a huge difference to Asterisk and the ability to use it in an enterprise environment. Really great work.

Asterisk 1.8.0-beta2 Now Available
July 28, 2010
The Asterisk Development Team has announced the release of Asterisk 1.8.0-beta2.

HumBug - Pre BETA Launch Registration
July 27, 2010
Nir Simionovich has posted details of the beta of the new call analytics service.

Branch Merging Changes
July 26, 2010
Russell Bryant has posted details of some changes to the way developers need to commit code to Asterisk because of the newly released 1.8 branch.

Asterisk 1.8.0-beta1 is Now Available
July 26, 2010
The Asterisk Development Team has announced the release of Asterisk 1.8.0-beta1. This release marks the beginning of the testing process for the eventual release of Asterisk 1.8.0.

Asterisk 1.6.2.10 Now Available
July 26, 2010
The Asterisk Development Team has announced the release of Asterisk 1.6.2.10.

Asterisk 1.4.34 Now Available
July 26, 2010
The Asterisk Development Team has announced the release of Asterisk 1.4.34.

AppleRaisin - AstDB over realtime
July 23, 2010
Olle has posted a note about his awesome AppleRaisin branch which provides the ability to store AstDB in realtime. This would make for a much simpler failover and clustering situation.

QueueMetrics 1.6.1 released
July 22, 2010
Lenz has posted a note to inform us that QueueMetrics version 1.6.1 has been released. This release offers a large number of bug fixes, misc improvements and new developements including hotdesking.

Asterisk 1.8 Branch Creation
July 22, 2010
Russell Bryant has posted a note to inform us of the creation of the 1.8 branch of Asterisk.