Sfoglia il codice sorgente

Modified cnxcc_set_max_credit behavior

- Updated documentation
- Updated examples
Carlos Ruiz Diaz 12 anni fa
parent
commit
0e9b4b351e
2 ha cambiato i file con 118 aggiunte e 4 eliminazioni
  1. 2 2
      modules/cnxcc/doc/cnxcc.xml
  2. 116 2
      modules/cnxcc/doc/cnxcc_admin.xml

+ 2 - 2
modules/cnxcc/doc/cnxcc.xml

@@ -17,7 +17,7 @@
 	<firstname>Carlos</firstname>
 	<firstname>Carlos</firstname>
 	<surname>Ruiz Diaz</surname>
 	<surname>Ruiz Diaz</surname>
 	<affiliation>
 	<affiliation>
-	    <orgname>ConexionGroup SA</orgname>
+	    <orgname>ConexionGroup S.A.</orgname>
 	</affiliation>
 	</affiliation>
 	<address>
 	<address>
 	    <email>[email protected]</email>
 	    <email>[email protected]</email>
@@ -25,7 +25,7 @@
 	</author>
 	</author>
     </authorgroup>
     </authorgroup>
     <copyright>
     <copyright>
-	<year>2012</year>
+	<year>2013</year>
 	<holder>Carlos Ruiz Diaz, [email protected]</holder>
 	<holder>Carlos Ruiz Diaz, [email protected]</holder>
     </copyright>
     </copyright>
     </bookinfo>
     </bookinfo>

+ 116 - 2
modules/cnxcc/doc/cnxcc_admin.xml

@@ -37,6 +37,11 @@
 		If your accounting program does not maintain the state of the call in real time, this module can provide you
 		If your accounting program does not maintain the state of the call in real time, this module can provide you
 		that ability.
 		that ability.
 	</para>
 	</para>
+	<para>
+		Cnxcc can also provide more common means of monitoring, i.e., by time limit or by maximum simultaneous calls.
+	</para>
+
+
     </section>
     </section>
 
 
     <section>
     <section>
@@ -120,6 +125,13 @@ modparam("cnxcc", "credit_check_period", 1)
 			<emphasis>-1 - failed, error logged</emphasis>
 			<emphasis>-1 - failed, error logged</emphasis>
 		    </para>
 		    </para>
 		    </listitem>
 		    </listitem>
+
+		    <listitem>
+		    <para>
+			<emphasis>-2 - failed, credit value is less than initial pulse value</emphasis>
+		    </para>
+		    </listitem>
+
 		</itemizedlist>
 		</itemizedlist>
 	    </para>
 	    </para>
 	    <example>
 	    <example>
@@ -168,13 +180,115 @@ cnxcc_set_max_credit("$var(customer)", "$var(credit)", "$var(cps)", "$var(initia
 $var(customer) = "john-doe-123-basic";
 $var(customer) = "john-doe-123-basic";
 $var(max_time) = 120;
 $var(max_time) = 120;
 
 
-cnxcc_set_max_tim ("$var(customer)", "$var(max_time)");
+cnxcc_set_max_time("$var(customer)", "$var(max_time)");
+...
+		</programlisting>
+            </example>
+        </section>
+
+    	<section>
+            <title>
+                <function moreinfo="none">cnxcc_set_max_channel()</function>
+            </title>
+            <para>
+		Specifies a limit for the number of simultaneous calls
+            </para>
+            <para>
+                <emphasis>Return code:</emphasis>
+                <itemizedlist>
+                    <listitem>
+                    <para>
+                        <emphasis>1 - successful</emphasis>
+                    </para>
+                    </listitem>
+                     
+                    <listitem>
+                    <para>
+                        <emphasis>-1 - failed, error logged</emphasis>
+                    </para>
+                    </listitem>
+
+                    <listitem>
+                    <para>
+                        <emphasis>-2 - failed, calls established plus calls being established result in more than the limit you specified</emphasis>
+                    </para>
+                    </listitem>
+		    
+		    <listitem>
+                    <para>
+                        <emphasis>-3 - failed, number of calls established is more than the limit you specified</emphasis>
+                    </para>
+                    </listitem>
+
+                </itemizedlist>
+            </para>
+            <example>
+		<title>cnxcc_set_max_time()</title>
+                <programlisting format="linespecific">
+...
+$var(customer)  = "john-doe-123-basic";
+$var(max_chan)  = 2;
+$var(retcode)   = cnxcc_set_max_channels("$var(customer)", "$var(max_chan)");
+
+if ($var(retcode) == -1) {
+	xlog("Error setting up credit control");
+	return;
+}
+
+if ($var(retcode) &lt; -1) {
+        xlog("Too many channels for customer");
+        sl_send_reply(403, "Forbidden");
+
+        if (!cnxcc_terminate_all("$var(customer)")) {
+		xlog("Error terminating customer's calls");
+	}
+
+	exit;
+}
+
+...
+		</programlisting>
+            </example>
+    	</section>
+	
+    	<section>
+            <title>
+                <function moreinfo="none">cnxcc_terminate_all()</function>
+            </title>
+            <para>
+		Terminates all calls of the specified customer/profile
+            </para>
+            <para>
+                <emphasis>Return code:</emphasis>
+                <itemizedlist>
+                    <listitem>
+                    <para>
+                        <emphasis>1 - successful</emphasis>
+                    </para>
+                    </listitem>
+                     
+                    <listitem>
+                    <para>
+                        <emphasis>-1 - failed, error logged</emphasis>
+                    </para>
+                    </listitem>
+                </itemizedlist>
+            </para>
+            <example>
+		<title>cnxcc_set_max_time()</title>
+                <programlisting format="linespecific">
+...
+$var(customer)  = "john-doe-123-basic";
+
+if (!cnxcc_terminate_all("$var(customer)")) {
+	xlog("Error terminating customer's calls");
+}
 ...
 ...
 		</programlisting>
 		</programlisting>
             </example>
             </example>
         </section>
         </section>
     </section>
     </section>
-    
+   
     <section>
     <section>
 	<title>Exported RPC Commands</title>
 	<title>Exported RPC Commands</title>