summaryrefslogtreecommitdiff
path: root/res/res_hep_rtcp.c
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2017-05-09 10:25:29 +0000
committerJoshua Colp <jcolp@digium.com>2017-05-09 05:38:59 -0500
commit3c36c29c81c07ad220860a59349def72afc35d86 (patch)
treebaa4e18bdd28bb75e54b6436a2989da17eb2f38e /res/res_hep_rtcp.c
parent3dae4279be4f61f16473d3e5ea9d45d1f8462eda (diff)
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
Diffstat (limited to 'res/res_hep_rtcp.c')
-rw-r--r--res/res_hep_rtcp.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/res/res_hep_rtcp.c b/res/res_hep_rtcp.c
index 7191f4661..395031a3d 100644
--- a/res/res_hep_rtcp.c
+++ b/res/res_hep_rtcp.c
@@ -53,12 +53,22 @@ static char *assign_uuid(struct ast_json *json_channel)
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);