[Freeswitch-users] Support for RTCP report via SIP PUBLISH

Helmut Kuper helmut.kuper at ewetel.de
Tue Dec 21 17:34:48 MSK 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I want to collect RTCP reports from snom devices via FS's event system.
Unfortunately it doesn't support it. Maybe because it is still a draft:

http://tools.ietf.org/html/draft-ietf-sipping-rtcp-summary-05

I wonder whether this feature is planed in near future.



Nevertheless I hacked sofia.c and sofia-presence.c to get it working
just for testing. Here is the "git diff":

-
---DIFF------------------------------------------------------------------------
diff --git a/src/mod/endpoints/mod_sofia/sofia.c
b/src/mod/endpoints/mod_sofia/sofia.c
index 2e13b54..3622506 100644
- --- a/src/mod/endpoints/mod_sofia/sofia.c
+++ b/src/mod/endpoints/mod_sofia/sofia.c
@@ -1530,6 +1530,7 @@ void *SWITCH_THREAD_FUNC
sofia_profile_thread_run(switch_thread_t *thread, void
                                   TAG_IF(profile->pres_type,
NUTAG_ALLOW_EVENTS("include-session-description")),
                                   TAG_IF(profile->pres_type,
NUTAG_ALLOW_EVENTS("presence.winfo")),
                                   TAG_IF(profile->pres_type,
NUTAG_ALLOW_EVENTS("message-summary")),
+                                       TAG_IF(profile->pres_type,
NUTAG_ALLOW_EVENTS("vq-rtcpxr")),
                                   NUTAG_ALLOW_EVENTS("refer"),
SIPTAG_SUPPORTED_STR(supported),
SIPTAG_USER_AGENT_STR(profile->user_agent), TAG_END(

        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set
params for %s\n", profile->name);
diff --git a/src/mod/endpoints/mod_sofia/sofia_presence.c
b/src/mod/endpoints/mod_sofia/sofia_presence.c
index 143666c..c998280 100644
- --- a/src/mod/endpoints/mod_sofia/sofia_presence.c
+++ b/src/mod/endpoints/mod_sofia/sofia_presence.c
@@ -2679,7 +2679,17 @@ void sofia_presence_handle_sip_i_publish(nua_t
*nua, sofia_profile_t *profile, n

                        pd_dup = strdup(payload->pl_data);

- -                       if ((xml = switch_xml_parse_str(pd_dup,
strlen(pd_dup)))) {
+            //EWETEL RTCP hack
+            //event_type = sip_header_as_string(profile->home, (void *)
sip->sip_event);
+            if (strcmp(sip_header_as_string(profile->home, (void *)
sip->sip_event), "vq-rtcpxr")==0) {
+                if (switch_event_create(&event,
SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
+                    switch_event_add_header_string(event,
SWITCH_STACK_BOTTOM, "event_type", "vq-rtcpxr");
+                    switch_event_add_body(event, "%s", pd_dup);
+                    switch_event_fire(&event);
+                }
+            }
+                       //DONE
+                       else if ((xml = switch_xml_parse_str(pd_dup,
strlen(pd_dup)))) {
                                char *open_closed = "", *note_txt = "";

                                if (sip->sip_user_agent) {
- ---DIFF END-----------------------------------------------------------

It simply allows SIP PUBLISH events of type "vq-rtcpxr" and adds the sip
payload to the internal event body.



The corresponding event is this:

Content-Length: 1178
Content-Type: text/event-plain

Event-Name: PRESENCE_IN
Core-UUID: f852daae-6da9-4979-8dc8-fa11651a7891
FreeSWITCH-Hostname: test
FreeSWITCH-IPv4: 1.2.3.4
FreeSWITCH-IPv6: %3A%3A1
Event-Date-Local: 2010-12-21%2015%3A19%3A09
Event-Date-GMT: Tue,%2021%20Dec%202010%2014%3A19%3A09%20GMT
Event-Date-Timestamp: 1292941149981062
Event-Calling-File: sofia_presence.c
Event-Calling-Function: sofia_presence_handle_sip_i_publish
Event-Calling-Line-Number: 2685
event_type: vq-rtcpxr
Content-Length: 703

VQSessionReport
LocalMetrics:
Timestamps:START=2010-12-21T14:19:08Z STOP=2010-12-21T14:19:10Z
SessionDesc:PT=9 PD=G.722 PPS=50 SSUP=off
CallID:3c2f99c5dc8f-k1jiuwkd70m9
x-UserAgent:snom370/8.4.22
FromID:"Helmut Kuper" <sip:8000 at sipdomain.de>
ToID:<sip:***6 at sipdomain.de;user=phone>
LocalAddr:IP=85.16.245.234 PORT=10568 SSRC=0xF919B973
RemoteAddr:IP=85.16.246.16 PORT=19770 SSRC=0x
DialogID:3c2f99c5dc8f-k1jiuwkd70m9;to-tag=7HU6y795c8r8B;from-tag=rbxbm5jjme
x-SIPmetrics:SVA=RG SRD=890 SFC=0
x-SIPterm:SDC=OK SDR=OR
JitterBuffer:JBA=0 JBR=0 JBN=0 JBM=0 JBX=65535
PacketLoss:NLR=0.0 JDR=0.0
BurstGapLoss:BLD=0.0 BD=0 GLD=0.0 GD=2440 GMIN=16
Delay:RTD=0 ESD=0 IAJ=0
QualityEst:MOSLQ=4.2 MOSCQ=4.1



regards
helmut
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk0QuwgACgkQ4tZeNddg3dx6/gCgij7KZDD0qHLFkujDjzH/hYu+
7UEAn2SM1eFQsPA6ICNxtexEprdWyGCk
=kbkn
-----END PGP SIGNATURE-----



More information about the FreeSWITCH-users mailing list