Преглед на файлове

ims_qos: Make Release-Reason from QoS configurable, add option to add Extra-Header, in case QoS fails during a session.

Carsten Bock преди 10 години
родител
ревизия
682eb47b1b
променени са 4 файла, в които са добавени 54 реда и са изтрити 3 реда
  1. 3 3
      modules/ims_qos/cdpeventprocessor.c
  2. 4 0
      modules/ims_qos/cdpeventprocessor.h
  3. 42 0
      modules/ims_qos/doc/ims_qos_admin.xml
  4. 5 0
      modules/ims_qos/mod.c

+ 3 - 3
modules/ims_qos/cdpeventprocessor.c

@@ -173,7 +173,7 @@ void cdp_cb_event_process() {
     cdp_cb_event_t *ev;
     udomain_t* domain;
     pcontact_t* pcontact;
-    str release_reason = {"QoS released", 12}; /* TODO: This could be a module parameter */
+
     struct pcontact_info ci;
     memset(&ci, 0, sizeof (struct pcontact_info));
 
@@ -275,8 +275,8 @@ void cdp_cb_event_process() {
                                 p_session_data->ftag.len, p_session_data->ftag.s,
                                 p_session_data->ttag.len, p_session_data->ttag.s);
                         dlgb.terminate_dlg(&p_session_data->callid,
-                                &p_session_data->ftag, &p_session_data->ttag, NULL,
-                                &release_reason);
+                                &p_session_data->ftag, &p_session_data->ttag, &confirmed_qosrelease_headers,
+                                &early_qosrelease_reason);
                     }
                 }
 

+ 4 - 0
modules/ims_qos/cdpeventprocessor.h

@@ -49,6 +49,7 @@
 #include "../../locking.h"
 #include "sem.h"
 #include "rx_authdata.h"
+#include "../../str.h"
 
 typedef struct _cdp_cb_event{
 	int event;							/* event id */
@@ -66,6 +67,9 @@ typedef struct {
 	int size;
 } cdp_cb_event_list_t;
 
+str early_qosrelease_reason;
+str confirmed_qosrelease_headers;
+
 int init_cdp_cb_event_list();
 void destroy_cdp_cb_event_list();
 

+ 42 - 0
modules/ims_qos/doc/ims_qos_admin.xml

@@ -258,6 +258,48 @@ modparam("ims_qos", "video_default_bandwidth", 256)
         </programlisting>
       </example>
     </section>
+    <section>
+      <title><varname>early_qosrelease_reason</varname> (String)</title>
+
+      <para>This sets the default Reason, when a call is terminated in 
+            early stage due to QoS-failure.</para>
+
+      <para><emphasis> Default value is "QoS released", an call in early stage
+		       would be released with "488 QoS released".</emphasis></para>
+
+      <example>
+        <title><varname>early_qosrelease_reason</varname> parameter
+        usage</title>
+
+        <programlisting format="linespecific">
+...
+modparam("ims_qos", "early_qosrelease_reason", "Sorry - QoS failed")
+...
+        </programlisting>
+      </example>
+    </section>
+    <section>
+      <title><varname>confirmed_qosrelease_headers</varname> (String)</title>
+
+      <para>These headers are added to the BYE-Message, when an confirmed call
+	    is terminated due to a QoS failure.</para>
+
+      <para><emphasis> Default value is "", no Extra-Headers</emphasis></para>
+
+      <para><emphasis> The headers must end with CRLF.</emphasis></para>
+
+      <example>
+        <title><varname>confirmed_qosrelease_headers</varname> parameter
+        usage</title>
+
+        <programlisting format="linespecific">
+...
+modparam("ims_qos", "confirmed_qosrelease_headers", "X-Reason: QoS failed\r\n")
+...
+        </programlisting>
+      </example>
+    </section>
+
   </section>
 
   <section>

+ 5 - 0
modules/ims_qos/mod.c

@@ -121,6 +121,9 @@ static int fixup_aar(void** param, int param_no);
 
 int * callback_singleton; /*< Callback singleton */
 
+str early_qosrelease_reason = {"QoS released", 12};
+str confirmed_qosrelease_headers = {NULL, 0};
+
 /* parameters storage */
 str rx_dest_realm = str_init("ims.smilecoms.com");
 /* Only used if we want to force the Rx peer usually this is configured at a stack level and the first request uses realm routing */
@@ -147,6 +150,8 @@ static param_export_t params[] = {
     { "cdp_event_list_size_threshold", INT_PARAM, &cdp_event_list_size_threshold}, /**Threshold for size of cdp event list after which a warning is logged */
     { "audio_default_bandwidth", INT_PARAM, &audio_default_bandwidth},
     { "video_default_bandwidth", INT_PARAM, &video_default_bandwidth},
+    { "early_qosrelease_reason", PARAM_STR, &early_qosrelease_reason},
+    { "confirmed_qosrelease_headers", PARAM_STR, &confirmed_qosrelease_headers},
     { 0, 0, 0}
 };