فهرست منبع

cnxcc: update docs [skip ci]

* new error return values
* delete return value from set_max_credit not in code
Jose Luis Verdeguer 5 سال پیش
والد
کامیت
bc0264f480
2فایلهای تغییر یافته به همراه22 افزوده شده و 19 حذف شده
  1. 0 13
      src/modules/cnxcc/doc/cnxcc.xml
  2. 22 6
      src/modules/cnxcc/doc/cnxcc_admin.xml

+ 0 - 13
src/modules/cnxcc/doc/cnxcc.xml

@@ -23,15 +23,6 @@
 	    <email>[email protected]</email>
 	</address>
 	</author>
-        <editor>
-        <firstname>Jose Luis</firstname>
-        <surname>Verdeguer</surname>
-        <email>[email protected]</email>
-        <affiliation><orgname>Zoon Suite</orgname></affiliation>
-        <address>
-                <email>[email protected]</email>
-        </address>
-        </editor>
     </authorgroup>
     <copyright>
 	<year>2013</year>
@@ -41,10 +32,6 @@
 	<year>2014</year>
 	<holder>Carlos Ruiz Díaz, [email protected]</holder>
     </copyright>
-    <copyright>
-	<year>2018</year>
-	<holder>Jose Luis Verdeguer</holder>
-    </copyright>
 
     </bookinfo>
 

+ 22 - 6
src/modules/cnxcc/doc/cnxcc_admin.xml

@@ -177,10 +177,9 @@ modparam("cnxcc", "credit_check_period", 1)
 
 					<listitem>
 						<para>
-							<emphasis>-2 - failed, credit value is less than initial pulse value</emphasis>
+							<emphasis>-4 - call-id already present for this client</emphasis>
 						</para>
 					</listitem>
-
 				</itemizedlist>
 			</para>
 			<example>
@@ -234,6 +233,11 @@ cnxcc_set_max_credit("$var(customer)", "$var(credit)", "$var(connect)",
 							<emphasis>-1 - failed, error logged</emphasis>
 						</para>
 					</listitem>
+					<listitem>
+						<para>
+							<emphasis>-4 - call-id already present for this client</emphasis>
+						</para>
+					</listitem>
 				</itemizedlist>
 			</para>
 			<example>
@@ -345,6 +349,11 @@ if (!cnxcc_update_max_time("$var(client)", "$var(update_time)")) {
 						</para>
 					</listitem>
 
+					<listitem>
+						<para>
+							<emphasis>-4 - call-id already present for this client</emphasis>
+						</para>
+					</listitem>
 				</itemizedlist>
 			</para>
 			<example>
@@ -543,14 +552,21 @@ route[CNXCC]
 	$var(i_pulse)             = 30;
 	$var(f_pulse)             = 6;
 
-	if (!cnxcc_set_max_credit("$var(client)",
+
+	cnxcc_set_max_credit("$var(client)",
 			"$var(credit)",
 			"$var(connect_cost)",
 			"$var(cost_per_sec)",
 			"$var(i_pulse)",
-			"$var(f_pulse)")) {
-		xlog("Error setting up credit control");
-	}
+			"$var(f_pulse)");
+
+	switch ($?) {
+		case -1:
+			xerr("Error setting up credit control");
+			sl_send_reply("503", "Internal Server Error");
+		case -4:
+			xwarn("$ci already present for client $var(client)");
+	};
 }
 
 event_route[cnxcc:call-shutdown]