[libpri-commits] rmudgett: branch dvossel/aoc_send r1659 - /team/dvossel/aoc_send/

SVN commits to the libpri project libpri-commits at lists.digium.com
Thu Apr 22 18:31:00 CDT 2010


Author: rmudgett
Date: Thu Apr 22 18:30:57 2010
New Revision: 1659

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1659
Log:
Merged revisions 1658 via svnmerge from 
https://origsvn.digium.com/svn/libpri/team/rmudgett/aoc_event

........
  r1658 | rmudgett | 2010-04-22 18:27:45 -0500 (Thu, 22 Apr 2010) | 3 lines
  
  * Change PRI_SUBCMD_AOC_S definition to allow an empty rate list.
  * Make encoding AOC-S currency rate list handle an empty list.
........

Modified:
    team/dvossel/aoc_send/   (props changed)
    team/dvossel/aoc_send/libpri.h
    team/dvossel/aoc_send/pri_aoc.c
    team/dvossel/aoc_send/rose_etsi_aoc.c

Propchange: team/dvossel/aoc_send/
------------------------------------------------------------------------------
--- aoc_send-integrated (original)
+++ aoc_send-integrated Thu Apr 22 18:30:57 2010
@@ -1,1 +1,1 @@
-/team/rmudgett/aoc_event:1-1655
+/team/rmudgett/aoc_event:1-1658

Modified: team/dvossel/aoc_send/libpri.h
URL: http://svnview.digium.com/svn/libpri/team/dvossel/aoc_send/libpri.h?view=diff&rev=1659&r1=1658&r2=1659
==============================================================================
--- team/dvossel/aoc_send/libpri.h (original)
+++ team/dvossel/aoc_send/libpri.h Thu Apr 22 18:30:57 2010
@@ -765,6 +765,10 @@
 };
 
 struct pri_subcmd_aoc_s {
+	/*!
+	 * \brief Number of items in the rate list.
+	 * \note If the list is empty then the charging information is not available.
+	 */
 	int num_items;
 	struct pri_aoc_s_element item[10];
 };

Modified: team/dvossel/aoc_send/pri_aoc.c
URL: http://svnview.digium.com/svn/libpri/team/dvossel/aoc_send/pri_aoc.c?view=diff&rev=1659&r1=1658&r2=1659
==============================================================================
--- team/dvossel/aoc_send/pri_aoc.c (original)
+++ team/dvossel/aoc_send/pri_aoc.c Thu Apr 22 18:30:57 2010
@@ -444,9 +444,7 @@
 
 	subcmd->cmd = PRI_SUBCMD_AOC_S;
 	if (!invoke->args.etsi.AOCSCurrency.type) {
-		subcmd->u.aoc_s.num_items = 1;
-		subcmd->u.aoc_s.item[0].chargeable = PRI_AOC_CHARGED_ITEM_NOT_AVAILABLE;
-		subcmd->u.aoc_s.item[0].rate_type = PRI_AOC_RATE_TYPE_NOT_AVAILABLE;
+		subcmd->u.aoc_s.num_items = 0;
 		return;
 	}
 
@@ -475,12 +473,11 @@
 		return;
 	}
 	subcmd->cmd = PRI_SUBCMD_AOC_S;
+	if (!invoke->args.etsi.AOCSSpecialArr.type) {
+		subcmd->u.aoc_s.num_items = 0;
+		return;
+	}
 	subcmd->u.aoc_s.num_items = 1;
-	if (!invoke->args.etsi.AOCSSpecialArr.type) {
-		subcmd->u.aoc_s.item[0].chargeable = PRI_AOC_CHARGED_ITEM_NOT_AVAILABLE;
-		subcmd->u.aoc_s.item[0].rate_type = PRI_AOC_RATE_TYPE_NOT_AVAILABLE;
-		return;
-	}
 	subcmd->u.aoc_s.item[0].chargeable = PRI_AOC_CHARGED_ITEM_SPECIAL_ARRANGEMENT;
 	subcmd->u.aoc_s.item[0].rate_type = PRI_AOC_RATE_TYPE_SPECIAL_CODE;
 	subcmd->u.aoc_s.item[0].rate.special =

Modified: team/dvossel/aoc_send/rose_etsi_aoc.c
URL: http://svnview.digium.com/svn/libpri/team/dvossel/aoc_send/rose_etsi_aoc.c?view=diff&rev=1659&r1=1658&r2=1659
==============================================================================
--- team/dvossel/aoc_send/rose_etsi_aoc.c (original)
+++ team/dvossel/aoc_send/rose_etsi_aoc.c Thu Apr 22 18:30:57 2010
@@ -623,8 +623,13 @@
 		ASN1_CALL(pos, asn1_enc_null(pos, end, ASN1_TYPE_NULL));
 		break;
 	case 1:	/* currency_info_list */
-		ASN1_CALL(pos, rose_enc_etsi_AOCSCurrencyInfoList(ctrl, pos, end,
-			ASN1_TAG_SEQUENCE, &args->etsi.AOCSCurrency.currency_info));
+		if (args->etsi.AOCSCurrency.currency_info.num_records) {
+			ASN1_CALL(pos, rose_enc_etsi_AOCSCurrencyInfoList(ctrl, pos, end,
+				ASN1_TAG_SEQUENCE, &args->etsi.AOCSCurrency.currency_info));
+		} else {
+			/* There were no records so encode as charge_not_available */
+			ASN1_CALL(pos, asn1_enc_null(pos, end, ASN1_TYPE_NULL));
+		}
 		break;
 	default:
 		ASN1_ENC_ERROR(ctrl, "Unknown AOCSCurrency type");




More information about the libpri-commits mailing list