From 8ac3137057d07f42eb8845ae4fb29cd9c4021165 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Fri, 28 Feb 2020 11:39:24 +0100 Subject: [PATCH] pua_dialoginfo: local_identity_dlg_var --- .../doc/pua_dialoginfo_admin.xml | 19 +++++++++++++++++++ src/modules/pua_dialoginfo/pua_dialoginfo.c | 17 +++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml b/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml index f6e544c8323..676201cad49 100644 --- a/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml +++ b/src/modules/pua_dialoginfo/doc/pua_dialoginfo_admin.xml @@ -620,6 +620,25 @@ modparam("pua_dialoginfo", "publish_dialog_req_within", 0) +
+ <varname>local_identity_dlg_var</varname> (str) + + PUBLISH-requests reporting dialog-information will use the value of + the dialog variable if exists + + + Default value is NULL. + + + Set <varname>local_identity_dlg_var</varname> parameter + +... +modparam("pua_dialoginfo", "local_identity_dlg_var", "local_identity") +... + + +
+
<varname>attribute_display</varname> (int) diff --git a/src/modules/pua_dialoginfo/pua_dialoginfo.c b/src/modules/pua_dialoginfo/pua_dialoginfo.c index 83c4f2c3f83..1e4f17110d4 100644 --- a/src/modules/pua_dialoginfo/pua_dialoginfo.c +++ b/src/modules/pua_dialoginfo/pua_dialoginfo.c @@ -87,6 +87,7 @@ static str caller_dlg_var = {0, 0}; /* pubruri_caller */ static str callee_dlg_var = {0, 0}; /* pubruri_callee */ static str caller_entity_when_publish_disabled = {0, 0}; /* pubruri_caller */ static str callee_entity_when_publish_disabled = {0, 0}; /* pubruri_callee */ +static str local_identity_dlg_var = STR_NULL; /* Module parameter variables */ int include_callid = DEF_INCLUDE_CALLID; @@ -132,6 +133,7 @@ static param_export_t params[]={ {"pubruri_callee_avp", PARAM_STRING, &pubruri_callee_avp }, {"pubruri_caller_dlg_var", PARAM_STR, &caller_dlg_var }, {"pubruri_callee_dlg_var", PARAM_STR, &callee_dlg_var }, + {"local_identity_dlg_var", PARAM_STR, &local_identity_dlg_var }, {"callee_trying", INT_PARAM, &callee_trying }, {"disable_caller_publish_flag", INT_PARAM, &disable_caller_publish_flag }, {"disable_callee_publish_flag", INT_PARAM, &disable_callee_publish_flag }, @@ -312,6 +314,17 @@ void refresh_pubruri_avps(struct dlginfo_cell *dlginfo, str *uri) } } +void refresh_local_identity(struct dlg_cell *dlg, str *uri) { + str *s = dlg_api.get_dlg_var(dlg, &local_identity_dlg_var); + + if(s != NULL) { + uri->s = s->s; + uri->len = s->len; + LM_DBG("Found local_identity in dialog '%.*s'\n", + uri->len, uri->s); + } +} + static void __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params) { @@ -357,6 +370,10 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para refresh_pubruri_avps(dlginfo, &uri); } + if(local_identity_dlg_var.len > 0) { + refresh_local_identity(dlg, &uri); + } + switch (type) { case DLGCB_FAILED: case DLGCB_TERMINATED: