diff --git a/CHANGES b/CHANGES index 9c8ed5b8e776a8ba83e00beda30b0dbf396c104b..21fde194a99613b2ed8ca78aa8581c5964a9548d 100644 --- a/CHANGES +++ b/CHANGES @@ -42,6 +42,12 @@ res_pjsip_config_wizard 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 3d1e74139944a6a2b4343666bc96d3f7223f1511..32bd8df39ff60427ee367d92a6f92e7ff994bdd6 100644 --- a/configs/samples/hep.conf.sample +++ b/configs/samples/hep.conf.sample @@ -24,5 +24,9 @@ capture_id = 1234 ; A unique integer identifier for this ; 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 7191f466163040226e4ad7660726f543088b2fa8..395031a3d4dfa0b7592f933973cb1dadf92d1630 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);