diff options
author | Joshua Colp <jcolp@digium.com> | 2016-05-19 05:26:57 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2016-05-19 05:26:57 -0500 |
commit | b57032c3646229ab5abcb16f8a7e77bde350afae (patch) | |
tree | 1deab9e8e9601fd0d7ce39a0bdc11e0e63bd8158 /res/res_hep_pjsip.c | |
parent | 1f36270b21149e92f0552170acd441ae543c0ff2 (diff) | |
parent | e06a23681ca8c6933d705ad9e52c24395ed0a506 (diff) |
Merge "res_hep: Provide an option to pick the UUID type"
Diffstat (limited to 'res/res_hep_pjsip.c')
-rw-r--r-- | res/res_hep_pjsip.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/res/res_hep_pjsip.c b/res/res_hep_pjsip.c index a19b15f0e..0cc54c237 100644 --- a/res/res_hep_pjsip.c +++ b/res/res_hep_pjsip.c @@ -51,13 +51,18 @@ static char *assign_uuid(const pj_str_t *call_id, const pj_str_t *local_tag, con RAII_VAR(struct ast_sip_session *, session, NULL, ao2_cleanup); pjsip_dialog *dlg; char *uuid = NULL; + enum hep_uuid_type uuid_type = hepv3_get_uuid_type(); - if ((dlg = pjsip_ua_find_dialog(call_id, local_tag, remote_tag, PJ_FALSE)) + if ((uuid_type == HEP_UUID_TYPE_CHANNEL) + && (dlg = pjsip_ua_find_dialog(call_id, local_tag, remote_tag, PJ_FALSE)) && (session = ast_sip_dialog_get_session(dlg)) && (session->channel)) { uuid = ast_strdup(ast_channel_name(session->channel)); - } else { + } + + /* If we couldn't get the channel or we never wanted it, default to the call-id */ + if (!uuid) { uuid = ast_malloc(pj_strlen(call_id) + 1); if (uuid) { |