[svn-commits] dvossel: branch dvossel/generic_aoc r258187 - in /team/dvossel/generic_aoc: c...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Apr 20 15:21:59 CDT 2010


Author: dvossel
Date: Tue Apr 20 15:21:57 2010
New Revision: 258187

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=258187
Log:
addresses more reviewboard comments

Modified:
    team/dvossel/generic_aoc/channels/sig_pri.c
    team/dvossel/generic_aoc/channels/sig_pri.h
    team/dvossel/generic_aoc/doc/advice_of_charge.txt
    team/dvossel/generic_aoc/main/manager.c

Modified: team/dvossel/generic_aoc/channels/sig_pri.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/sig_pri.c?view=diff&rev=258187&r1=258186&r2=258187
==============================================================================
--- team/dvossel/generic_aoc/channels/sig_pri.c (original)
+++ team/dvossel/generic_aoc/channels/sig_pri.c Tue Apr 20 15:21:57 2010
@@ -1031,12 +1031,14 @@
 		new_chan->digital = old_chan->digital;
 #if defined(HAVE_PRI_AOC_EVENTS)
 		new_chan->aoc_s_request_invoke_id = old_chan->aoc_s_request_invoke_id;
+		new_chan->aoc_s_request_invoke_id_valid = old_chan->aoc_s_request_invoke_id_valid;
 		new_chan->holding_aoce = old_chan->holding_aoce;
 		new_chan->waiting_for_aoce = old_chan->waiting_for_aoce;
 		memcpy(&new_chan->aoc_e, &old_chan->aoc_e, sizeof(new_chan->aoc_e));
 
 		old_chan->holding_aoce = 0;
 		old_chan->aoc_s_request_invoke_id = 0;
+		old_chan->aoc_s_request_invoke_id_valid = 0;
 		old_chan->waiting_for_aoce = 0;
 		memset(&old_chan->aoc_e, 0, sizeof(&old_chan->aoc_e));
 #endif	/* defined(HAVE_PRI_AOC_EVENTS) */
@@ -2139,6 +2141,7 @@
  *
  * \param aoc_s AOC-S event parameters.
  * \param owner Asterisk channel associated with the call.
+ * \param passthrough indicating if this message should be queued on the ast channel
  *
  * \note Assumes the pri->lock is already obtained.
  * \note Assumes the sig_pri private is locked
@@ -2251,6 +2254,8 @@
 			/* An AOC-S response must come from the other side, so save off this invoke_id
 			 * and see if an AOC-S message comes in before the call is answered. */
 			pvt->aoc_s_request_invoke_id = aoc_request->invoke_id;
+			pvt->aoc_s_request_invoke_id_valid = 1;
+
 		} else {
 			pri_aoc_s_request_response_send(pvt->pri->pri,
 				call,
@@ -2297,6 +2302,7 @@
  *
  * \param aoc_e AOC-D event parameters.
  * \param owner Asterisk channel associated with the call.
+ * \param passthrough indicating if this message should be queued on the ast channel
  *
  * \note Assumes the pri->lock is already obtained.
  * \note Assumes the sig_pri private is locked
@@ -2390,6 +2396,7 @@
  *
  * \param aoc_e AOC-E event parameters.
  * \param owner Asterisk channel associated with the call.
+ * \param passthrough indicating if this message should be queued on the ast channel
  *
  * \note Assumes the pri->lock is already obtained.
  * \note Assumes the sig_pri private is locked
@@ -2595,9 +2602,10 @@
 
 	/* if this rate should be sent as a response to an AOC-S request we will
 	 * have an aoc_s_request_invoke_id associated with this pvt */
-	if (pvt->aoc_s_request_invoke_id) {
+	if (pvt->aoc_s_request_invoke_id_valid) {
 		pri_aoc_s_request_response_send(pvt->pri->pri, pvt->call, pvt->aoc_s_request_invoke_id, &aoc_s);
 		pvt->aoc_s_request_invoke_id = 0;
+		pvt->aoc_s_request_invoke_id_valid = 0;
 	} else {
 		pri_aoc_s_send(pvt->pri->pri, pvt->call, &aoc_s);
 	}
@@ -2704,7 +2712,6 @@
 
 	memset(aoc_e, 0, sizeof(*aoc_e));
 	pvt->holding_aoce = 1;
-
 
 	switch (ca->charging_type) {
 	case AST_AOC_CHARGING_ASSOCIATION_NUMBER:
@@ -5158,6 +5165,7 @@
 
 #if defined(HAVE_PRI_AOC_EVENTS)
 	p->aoc_s_request_invoke_id = 0;
+	p->aoc_s_request_invoke_id_valid = 0;
 	p->holding_aoce = 0;
 	p->waiting_for_aoce = 0;
 #endif
@@ -5854,12 +5862,13 @@
 	/* Send a pri acknowledge */
 	if (!pri_grab(p, p->pri)) {
 #if defined(HAVE_PRI_AOC_EVENTS)
-		if (p->aoc_s_request_invoke_id) {
+		if (p->aoc_s_request_invoke_id_valid) {
 			/* if AOC-S was requested and the invoke id is still present on hangup.  That means
 			 * no AOC-S rate list was provided, so send a NULL response which will indicate that
 			 * AOC-S is not available */
 			pri_aoc_s_request_response_send(p->pri->pri, p->call, p->aoc_s_request_invoke_id, NULL);
 			p->aoc_s_request_invoke_id = 0;
+			p->aoc_s_request_invoke_id_valid = 0;
 		}
 #endif
 		p->proceeding = 1;
@@ -6783,4 +6792,5 @@
 	}
 #endif	/* defined(HAVE_PRI_CCSS) */
 }
+
 #endif /* HAVE_PRI */

Modified: team/dvossel/generic_aoc/channels/sig_pri.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/channels/sig_pri.h?view=diff&rev=258187&r1=258186&r2=258187
==============================================================================
--- team/dvossel/generic_aoc/channels/sig_pri.h (original)
+++ team/dvossel/generic_aoc/channels/sig_pri.h Tue Apr 20 15:21:57 2010
@@ -201,6 +201,7 @@
 
 #if defined(HAVE_PRI_AOC_EVENTS)
 	int aoc_s_request_invoke_id;     /*!< If an AOC-S request was present for the call, this is the invoke_id to use for the response */
+	int aoc_s_request_invoke_id_valid; /*!< This is set when the AOC-S invoke id is present */
 	struct pri_subcmd_aoc_e aoc_e;
 	unsigned int waiting_for_aoce:1; /*!< Delaying hangup for AOC-E msg. If this is set and AOC-E is recieved, continue with hangup before timeout period. */
 	unsigned int holding_aoce:1;     /*!< received AOC-E msg from asterisk. holding for disconnect/release */

Modified: team/dvossel/generic_aoc/doc/advice_of_charge.txt
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/doc/advice_of_charge.txt?view=diff&rev=258187&r1=258186&r2=258187
==============================================================================
--- team/dvossel/generic_aoc/doc/advice_of_charge.txt (original)
+++ team/dvossel/generic_aoc/doc/advice_of_charge.txt Tue Apr 20 15:21:57 2010
@@ -91,9 +91,9 @@
 wishes to receive the specified forms of AOC during the call.
 
 Example Usage in extensions.conf
-exten => 1111,1,Dial(DAHDI/g1/1112/A(sde) ; requests AOC-S, AOC-D, and AOC-E on
+exten => 1111,1,Dial(DAHDI/g1/1112/A(s,d,e) ; requests AOC-S, AOC-D, and AOC-E on
                                           ; call setup
-exten => 1111,1,Dial(DAHDI/g1/1112/A(de)  ; requests only AOC-D, and AOC-E on
+exten => 1111,1,Dial(DAHDI/g1/1112/A(d,e)  ; requests only AOC-D, and AOC-E on
                                           ; call setup
 
 --------------------------------------

Modified: team/dvossel/generic_aoc/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/generic_aoc/main/manager.c?view=diff&rev=258187&r1=258186&r2=258187
==============================================================================
--- team/dvossel/generic_aoc/main/manager.c (original)
+++ team/dvossel/generic_aoc/main/manager.c Tue Apr 20 15:21:57 2010
@@ -769,16 +769,9 @@
 					<enum name="SubTotal" />
 				</enumlist>
 			</parameter>
-			<parameter name="AOCDBillingId">
-				<para>Represents a billing id associated with a AOC-D message.</para>
-				<enumlist>
-					<enum name="Normal" />
-					<enum name="ReverseCharge" />
-					<enum name="CreditCard" />
-				</enumlist>
-			</parameter>
-			<parameter name="AOCEBillingId">
-				<para>Represents a billing id associated with a AOC-E message.</para>
+			<parameter name="AOCBillingId">
+				<para>Represents a billing ID associated with an AOC-D or AOC-E message. Note
+				that only the first 3 items of the enum are valid AOC-D billing IDs</para>
 				<enumlist>
 					<enum name="Normal" />
 					<enum name="ReverseCharge" />
@@ -3549,8 +3542,7 @@
 	const char *currencyamount = astman_get_header(m, "CurrencyAmount");
 	const char *mult = astman_get_header(m, "CurrencyMultiplier");
 	const char *totaltype = astman_get_header(m, "TotalType");
-	const char *aocebillingid = astman_get_header(m, "AOCEBillingId");
-	const char *aocdbillingid = astman_get_header(m, "AOCDBillingId");
+	const char *aocbillingid = astman_get_header(m, "AOCBillingId");
 	const char *association_id= astman_get_header(m, "ChargingAssociationId");
 	const char *association_num = astman_get_header(m, "ChargingAssociationNumber");
 	const char *association_plan = astman_get_header(m, "ChargingAssociationPlan");
@@ -3648,49 +3640,39 @@
 			_totaltype = AST_AOC_SUBTOTAL;
 		}
 
-		if (ast_strlen_zero(aocdbillingid)) {
+		if (ast_strlen_zero(aocbillingid)) {
 			/* ignore this is optional */
-		} else if (!strcasecmp(aocdbillingid, "Normal")) {
+		} else if (!strcasecmp(aocbillingid, "Normal")) {
 			_billingid = AST_AOC_BILLING_NORMAL;
-		} else if (!strcasecmp(aocdbillingid, "ReverseCharge")) {
+		} else if (!strcasecmp(aocbillingid, "ReverseCharge")) {
 			_billingid = AST_AOC_BILLING_REVERSE_CHARGE;
-		} else if (!strcasecmp(aocdbillingid, "CreditCard")) {
+		} else if (!strcasecmp(aocbillingid, "CreditCard")) {
 			_billingid = AST_AOC_BILLING_CREDIT_CARD;
 		} else {
-			astman_send_error(s, m, "Invalid AOCDBillingId");
+			astman_send_error(s, m, "Invalid AOC-D AOCBillingId");
 			goto aocmessage_cleanup;
 		}
-
-		if (ast_strlen_zero(aocdbillingid) && !ast_strlen_zero(aocebillingid)) {
-			astman_send_error(s, m, "AOC-E billingid set when message type is AOC-D");
-			goto aocmessage_cleanup;
-		}
 	} else {
-		if (ast_strlen_zero(aocebillingid)) {
+		if (ast_strlen_zero(aocbillingid)) {
 			/* ignore this is optional */
-		} else if (!strcasecmp(aocebillingid, "Normal")) {
+		} else if (!strcasecmp(aocbillingid, "Normal")) {
 			_billingid = AST_AOC_BILLING_NORMAL;
-		} else if (!strcasecmp(aocebillingid, "ReverseCharge")) {
+		} else if (!strcasecmp(aocbillingid, "ReverseCharge")) {
 			_billingid = AST_AOC_BILLING_REVERSE_CHARGE;
-		} else if (!strcasecmp(aocebillingid, "CreditCard")) {
+		} else if (!strcasecmp(aocbillingid, "CreditCard")) {
 			_billingid = AST_AOC_BILLING_CREDIT_CARD;
-		} else if (!strcasecmp(aocebillingid, "CallFwdUnconditional")) {
+		} else if (!strcasecmp(aocbillingid, "CallFwdUnconditional")) {
 			_billingid = AST_AOC_BILLING_CALL_FWD_UNCONDITIONAL;
-		} else if (!strcasecmp(aocebillingid, "CallFwdBusy")) {
+		} else if (!strcasecmp(aocbillingid, "CallFwdBusy")) {
 			_billingid = AST_AOC_BILLING_CALL_FWD_BUSY;
-		} else if (!strcasecmp(aocebillingid, "CallFwdNoReply")) {
+		} else if (!strcasecmp(aocbillingid, "CallFwdNoReply")) {
 			_billingid = AST_AOC_BILLING_CALL_FWD_NO_REPLY;
-		} else if (!strcasecmp(aocebillingid, "CallDeflection")) {
+		} else if (!strcasecmp(aocbillingid, "CallDeflection")) {
 			_billingid = AST_AOC_BILLING_CALL_DEFLECTION;
-		} else if (!strcasecmp(aocebillingid, "CallTransfer")) {
+		} else if (!strcasecmp(aocbillingid, "CallTransfer")) {
 			_billingid = AST_AOC_BILLING_CALL_TRANSFER;
 		} else {
-			astman_send_error(s, m, "Invalid AOCEBillingId");
-			goto aocmessage_cleanup;
-		}
-
-		if (ast_strlen_zero(aocebillingid) && !ast_strlen_zero(aocdbillingid)) {
-			astman_send_error(s, m, "AOC-D billingid set when message type is AOC-E");
+			astman_send_error(s, m, "Invalid AOC-E AOCBillingId");
 			goto aocmessage_cleanup;
 		}
 




More information about the svn-commits mailing list