[asterisk-commits] res hep rtcp: Provide chan sip Call-ID for RTCP messages. (asterisk[master])

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 11 16:39:55 CDT 2017


Jenkins2 has submitted this change and it was merged. ( https://gerrit.asterisk.org/5608 )

Change subject: res_hep_rtcp: Provide chan_sip Call-ID for RTCP messages.
......................................................................


res_hep_rtcp: Provide chan_sip Call-ID for RTCP messages.

This change adds the required logic to allow the SIP
Call-ID to be placed into the HEP RTCP traffic if the
chan_sip module is used. In cases where the option is
enabled but the channel is not either SIP or PJSIP then
the code will fallback to the channel name as done
previously.

Based on the change on Nir's branch at:
team/nirs/hep-chan-sip-support

ASTERISK-26427

Change-Id: I09ffa5f6e2fdfd99ee999650ba4e0a7aad6dc40d
---
M CHANGES
M configs/samples/hep.conf.sample
M res/res_hep_rtcp.c
3 files changed, 25 insertions(+), 5 deletions(-)

Approvals:
  Mark Michelson: Looks good to me, approved
  George Joseph: Looks good to me, but someone else must approve
  Jenkins2: Approved for Submit



diff --git a/CHANGES b/CHANGES
index 9c8ed5b..21fde19 100644
--- a/CHANGES
+++ b/CHANGES
@@ -42,6 +42,12 @@
    endpoint/outbound_proxy, aor/outbound_proxy and registration/outbound_proxy
    parameters.
 
+res_hep_rtcp
+------------------
+ * If the 'call-id' value is specified for the uuid_type option and a
+   chan_sip channel is used the resulting HEP traffic will now contain the
+   SIP Call-ID instead of the Asterisk channel name.
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 14.3.0 to Asterisk 14.4.0 ------------
 ------------------------------------------------------------------------------
diff --git a/configs/samples/hep.conf.sample b/configs/samples/hep.conf.sample
index 3d1e741..32bd8df 100644
--- a/configs/samples/hep.conf.sample
+++ b/configs/samples/hep.conf.sample
@@ -24,5 +24,9 @@
                                    ; with each packet from this server.
 uuid_type = call-id                ; Specify the preferred source for the Homer
                                    ; correlation UUID. Valid options are:
-                                   ; - 'call-id' for the PJSIP SIP Call-ID
+                                   ; - 'call-id' for the PJSIP or chan_sip SIP
+                                   ;             Call-ID
                                    ; - 'channel' for the Asterisk channel name
+                                   ; Note: If 'call-id' is specified but the
+                                   ; channel is not PJSIP or chan_sip then the
+                                   ; Asterisk channel name will be used instead.
diff --git a/res/res_hep_rtcp.c b/res/res_hep_rtcp.c
index 7191f46..395031a 100644
--- a/res/res_hep_rtcp.c
+++ b/res/res_hep_rtcp.c
@@ -53,12 +53,22 @@
 		return NULL;
 	}
 
-	if (uuid_type == HEP_UUID_TYPE_CALL_ID && ast_begins_with(channel_name, "PJSIP")) {
-		struct ast_channel *chan = ast_channel_get_by_name(channel_name);
+	if (uuid_type == HEP_UUID_TYPE_CALL_ID) {
+		struct ast_channel *chan = NULL;
 		char buf[128];
 
-		if (chan && !ast_func_read(chan, "CHANNEL(pjsip,call-id)", buf, sizeof(buf))) {
-			uuid = ast_strdup(buf);
+		if (ast_begins_with(channel_name, "PJSIP")) {
+			chan = ast_channel_get_by_name(channel_name);
+
+			if (chan && !ast_func_read(chan, "CHANNEL(pjsip,call-id)", buf, sizeof(buf))) {
+				uuid = ast_strdup(buf);
+			}
+		} else if (ast_begins_with(channel_name, "SIP")) {
+			chan = ast_channel_get_by_name(channel_name);
+
+			if (chan && !ast_func_read(chan, "SIP_HEADER(call-id)", buf, sizeof(buf))) {
+				uuid = ast_strdup(buf);
+			}
 		}
 
 		ast_channel_cleanup(chan);

-- 
To view, visit https://gerrit.asterisk.org/5608
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I09ffa5f6e2fdfd99ee999650ba4e0a7aad6dc40d
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>



More information about the asterisk-commits mailing list