Explorar o código

modules/ims_qos: new mod param terminate_dialog_on_rx_failure

	terminate_dialog_on_rx_failure this parameter determines if a dialog is torn down if a media Rx session is terminated
Richard Good %!s(int64=10) %!d(string=hai) anos
pai
achega
da70040e8f
Modificáronse 2 ficheiros con 9 adicións e 1 borrados
  1. 6 1
      modules/ims_qos/cdpeventprocessor.c
  2. 3 0
      modules/ims_qos/mod.c

+ 6 - 1
modules/ims_qos/cdpeventprocessor.c

@@ -63,6 +63,8 @@ extern int cdp_event_list_size_threshold;
 
 extern struct ims_qos_counters_h ims_qos_cnts_h;
 
+extern int terminate_dialog_on_rx_failure;
+
 int init_cdp_cb_event_list() {
     cdp_event_list = shm_malloc(sizeof (cdp_cb_event_list_t));
     if (!cdp_event_list) {
@@ -226,7 +228,10 @@ void cdp_cb_event_process() {
                     LM_DBG("This is a media bearer session session");
                     //this is a media bearer session that was terminated from the transport plane - we need to terminate the associated dialog
                     //so we set p_session_data->must_terminate_dialog to 1 and when we receive AUTH_EV_SERVICE_TERMINATED event we will terminate the dialog
-                    p_session_data->must_terminate_dialog = 1;
+                    //we only terminate the dialog if terminate_dialog_on_rx_failure is set
+                    if(terminate_dialog_on_rx_failure) {
+                        p_session_data->must_terminate_dialog = 1;
+                    }
                 }
                 break;
 

+ 3 - 0
modules/ims_qos/mod.c

@@ -121,6 +121,8 @@ static int fixup_aar(void** param, int param_no);
 
 int * callback_singleton; /*< Callback singleton */
 
+int terminate_dialog_on_rx_failure = 1;  //this specifies whether a dialog is torn down when a media rx session fails - in some cases you might not want the dialog torn down
+
 str early_qosrelease_reason = {"QoS released", 12};
 str confirmed_qosrelease_headers = {NULL, 0};
 
@@ -152,6 +154,7 @@ static param_export_t params[] = {
     { "video_default_bandwidth", INT_PARAM, &video_default_bandwidth},
     { "early_qosrelease_reason", PARAM_STR, &early_qosrelease_reason},
     { "confirmed_qosrelease_headers", PARAM_STR, &confirmed_qosrelease_headers},
+    { "terminate_dialog_on_rx_failure", INT_PARAM, &terminate_dialog_on_rx_failure},
     { 0, 0, 0}
 };