Module: kamailio Branch: master Commit: 60a5ea45c5cc18b7074330da52ed1944cfbf3fbb URL: https://github.com/kamailio/kamailio/commit/60a5ea45c5cc18b7074330da52ed1944...
Author: Xenofon Karamanos 22965395+xkaraman@users.noreply.github.com Committer: Henning Westerholt hw@gilawa.com Date: 2024-09-16T13:39:06+02:00
mediaproxy: Remove dlg_flag and update docs
---
Modified: src/modules/mediaproxy/doc/mediaproxy_admin.xml Modified: src/modules/mediaproxy/mediaproxy.c
---
Diff: https://github.com/kamailio/kamailio/commit/60a5ea45c5cc18b7074330da52ed1944... Patch: https://github.com/kamailio/kamailio/commit/60a5ea45c5cc18b7074330da52ed1944...
---
diff --git a/src/modules/mediaproxy/doc/mediaproxy_admin.xml b/src/modules/mediaproxy/doc/mediaproxy_admin.xml index d89207b33a3..c75ed86e629 100644 --- a/src/modules/mediaproxy/doc/mediaproxy_admin.xml +++ b/src/modules/mediaproxy/doc/mediaproxy_admin.xml @@ -349,7 +349,6 @@ modparam("mediaproxy", "ice_candidate_avp", "$avp(ice_candidate)") called internally on dialog callbacks, so for this function to work, the dialog module must be loaded and configured. </para> - <para> This function is an advanced mechanism to use a media relay without having to manually call a function on each message that @@ -371,6 +370,11 @@ modparam("mediaproxy", "ice_candidate_avp", "$avp(ice_candidate)") This function can be used from REQUEST_ROUTE. </para>
+ <note> + The <emphasis>dlg_manage()</emphasis> function must be called + in the configuration file before using this function. + </note> + <example> <title>Using the <function>engage_media_proxy</function> function</title> <programlisting format="linespecific"> @@ -378,6 +382,7 @@ modparam("mediaproxy", "ice_candidate_avp", "$avp(ice_candidate)") if (method==INVITE && !has_totag()) { # We can also use a specific media relay if we need to #$avp(media_relay) = "1.2.3.4"; + dlg_manage() engage_media_proxy(); } ... @@ -466,4 +471,3 @@ if (method==BYE) { </section>
</chapter> - diff --git a/src/modules/mediaproxy/mediaproxy.c b/src/modules/mediaproxy/mediaproxy.c index 7b4e301bdc7..c7ccd901a1d 100644 --- a/src/modules/mediaproxy/mediaproxy.c +++ b/src/modules/mediaproxy/mediaproxy.c @@ -207,7 +207,6 @@ static MediaproxySocket mediaproxy_socket = {
struct dlg_binds dlg_api; Bool have_dlg_api = False; -static int dialog_flag = -1;
// The AVP where the caller signaling IP is stored (if defined) static AVP_Param signaling_ip_avp = {str_init(SIGNALING_IP_AVP_SPEC), {0}, 0}; @@ -1996,7 +1995,6 @@ static int EngageMediaProxy(struct sip_msg *msg) return -1; } msg->msg_flags |= FL_USE_MEDIA_PROXY; - setflag(msg, dialog_flag); // have the dialog module trace this dialog return 1; }
@@ -2049,9 +2047,6 @@ static int w_EndMediaSession(struct sip_msg *msg, char *p1, char *p2) static int mod_init(void) { pv_spec_t avp_spec; - int *param; - modparam_t type; - // initialize the signaling_ip_avp structure if(!signaling_ip_avp.spec.s || signaling_ip_avp.spec.len <= 0) { LM_WARN("missing/empty signaling_ip_avp parameter. will use " @@ -2130,21 +2125,6 @@ static int mod_init(void) if(load_dlg_api(&dlg_api) == 0) { have_dlg_api = True;
- // load dlg_flag and default_timeout parameters from the dialog module - param = find_param_export( - find_module_by_name("dialog"), "dlg_flag", INT_PARAM, &type); - if(!param) { - LM_CRIT("cannot find dlg_flag parameter in the dialog module\n"); - return -1; - } - - if(type != INT_PARAM) { - LM_CRIT("dlg_flag parameter found but with wrong type: %d\n", type); - return -1; - } - - dialog_flag = *param; - // register dialog creation callback if(dlg_api.register_dlgcb( NULL, DLGCB_CREATED, __dialog_created, NULL, NULL)