[libpri-commits] rmudgett: branch 1.4 r772 - /branches/1.4/

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Apr 21 18:32:17 CDT 2009


Author: rmudgett
Date: Tue Apr 21 18:32:13 2009
New Revision: 772

URL: http://svn.digium.com/svn-view/libpri?view=rev&rev=772
Log:
Added Q.SIG Advice-Of-Charge encode/decode routines.

Added:
    branches/1.4/rose_qsig_aoc.c   (with props)
Modified:
    branches/1.4/Makefile
    branches/1.4/pri_facility.c
    branches/1.4/rose.c
    branches/1.4/rose.h
    branches/1.4/rose_internal.h
    branches/1.4/rosetest.c

Modified: branches/1.4/Makefile
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/Makefile?view=diff&rev=772&r1=771&r2=772
==============================================================================
--- branches/1.4/Makefile (original)
+++ branches/1.4/Makefile Tue Apr 21 18:32:13 2009
@@ -54,6 +54,7 @@
 	rose_etsi_aoc.o \
 	rose_other.o \
 	rose_q931.o \
+	rose_qsig_aoc.o \
 	rose_qsig_ct.o \
 	rose_qsig_diversion.o \
 	rose_qsig_mwi.o \
@@ -72,6 +73,7 @@
 	rose_etsi_aoc.lo \
 	rose_other.lo \
 	rose_q931.lo \
+	rose_qsig_aoc.lo \
 	rose_qsig_ct.lo \
 	rose_qsig_diversion.lo \
 	rose_qsig_mwi.lo \

Modified: branches/1.4/pri_facility.c
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/pri_facility.c?view=diff&rev=772&r1=771&r2=772
==============================================================================
--- branches/1.4/pri_facility.c (original)
+++ branches/1.4/pri_facility.c Tue Apr 21 18:32:13 2009
@@ -1560,6 +1560,12 @@
 		break;
 #endif	/* Not handled yet */
 #if 0	/* Not handled yet */
+	case ROSE_QSIG_ChargeRequest:
+		break;
+	case ROSE_QSIG_AocComplete:
+		break;
+#endif	/* Not handled yet */
+#if 0	/* Not handled yet */
 	case ROSE_QSIG_CallTransferIdentify:
 		break;
 	case ROSE_QSIG_CallTransferInitiate:
@@ -1671,6 +1677,22 @@
 	case ROSE_QSIG_ConnectedName:
 		break;
 	case ROSE_QSIG_BusyName:
+		break;
+#endif	/* Not handled yet */
+#if 0	/* Not handled yet */
+	case ROSE_QSIG_ChargeRequest:
+		break;
+	case ROSE_QSIG_GetFinalCharge:
+		break;
+	case ROSE_QSIG_AocFinal:
+		break;
+	case ROSE_QSIG_AocInterim:
+		break;
+	case ROSE_QSIG_AocRate:
+		break;
+	case ROSE_QSIG_AocComplete:
+		break;
+	case ROSE_QSIG_AocDivChargeReq:
 		break;
 #endif	/* Not handled yet */
 #if 0	/* Not handled yet */

Modified: branches/1.4/rose.c
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/rose.c?view=diff&rev=772&r1=771&r2=772
==============================================================================
--- branches/1.4/rose.c (original)
+++ branches/1.4/rose.c Tue Apr 21 18:32:13 2009
@@ -344,6 +344,46 @@
 	},
 
 	/*
+	 * localValue's from Q.SIG SS-AOC-Operations
+	 * { iso(1) standard(0) pss1-advice-of-charge(15050) advice-of-charge-operations(0) }
+	 */
+	{
+		ROSE_QSIG_ChargeRequest,					NULL, 59,
+			rose_enc_qsig_ChargeRequest_ARG,		rose_enc_qsig_ChargeRequest_RES,
+			rose_dec_qsig_ChargeRequest_ARG,		rose_dec_qsig_ChargeRequest_RES
+	},
+	{
+		ROSE_QSIG_GetFinalCharge,					NULL, 60,
+			rose_enc_qsig_DummyArg_ARG,				NULL,
+			rose_dec_qsig_DummyArg_ARG,				NULL
+	},
+	{
+		ROSE_QSIG_AocFinal,							NULL, 61,
+			rose_enc_qsig_AocFinal_ARG,				NULL,
+			rose_dec_qsig_AocFinal_ARG,				NULL
+	},
+	{
+		ROSE_QSIG_AocInterim,						NULL, 62,
+			rose_enc_qsig_AocInterim_ARG,			NULL,
+			rose_dec_qsig_AocInterim_ARG,			NULL
+	},
+	{
+		ROSE_QSIG_AocRate,							NULL, 63,
+			rose_enc_qsig_AocRate_ARG,				NULL,
+			rose_dec_qsig_AocRate_ARG,				NULL
+	},
+	{
+		ROSE_QSIG_AocComplete,						NULL, 64,
+			rose_enc_qsig_AocComplete_ARG,			rose_enc_qsig_AocComplete_RES,
+			rose_dec_qsig_AocComplete_ARG,			rose_dec_qsig_AocComplete_RES
+	},
+	{
+		ROSE_QSIG_AocDivChargeReq,					NULL, 65,
+			rose_enc_qsig_AocDivChargeReq_ARG,		NULL,
+			rose_dec_qsig_AocDivChargeReq_ARG,		NULL
+	},
+
+	/*
 	 * localValue's from Q.SIG Call-Transfer-Operations
 	 * { iso(1) standard(0) pss1-call-transfer(13869) call-transfer-operations(0) }
 	 */
@@ -542,6 +582,15 @@
 	 */
 	{
 		ROSE_ERROR_QSIG_Unspecified,				NULL, 1008,
+			NULL,									NULL
+	},
+
+	/*
+	 * localValue Errors from Q.SIG SS-AOC-Operations
+	 * { iso(1) standard(0) pss1-advice-of-charge(15050) advice-of-charge-operations(0) }
+	 */
+	{
+		ROSE_ERROR_QSIG_AOC_FreeOfCharge,			NULL, 1016,
 			NULL,									NULL
 	},
 
@@ -843,6 +892,14 @@
 		{ ROSE_QSIG_CalledName,                     "ROSE_QSIG_CalledName" },
 		{ ROSE_QSIG_ConnectedName,                  "ROSE_QSIG_ConnectedName" },
 		{ ROSE_QSIG_BusyName,                       "ROSE_QSIG_BusyName" },
+
+		{ ROSE_QSIG_ChargeRequest,                  "ROSE_QSIG_ChargeRequest" },
+		{ ROSE_QSIG_GetFinalCharge,                 "ROSE_QSIG_GetFinalCharge" },
+		{ ROSE_QSIG_AocFinal,                       "ROSE_QSIG_AocFinal" },
+		{ ROSE_QSIG_AocInterim,                     "ROSE_QSIG_AocInterim" },
+		{ ROSE_QSIG_AocRate,                        "ROSE_QSIG_AocRate" },
+		{ ROSE_QSIG_AocComplete,                    "ROSE_QSIG_AocComplete" },
+		{ ROSE_QSIG_AocDivChargeReq,                "ROSE_QSIG_AocDivChargeReq" },
 
 		{ ROSE_QSIG_CallTransferIdentify,           "ROSE_QSIG_CallTransferIdentify" },
 		{ ROSE_QSIG_CallTransferAbandon,            "ROSE_QSIG_CallTransferAbandon" },
@@ -920,6 +977,8 @@
 
 		/* Q.SIG specific errors */
 		{ ROSE_ERROR_QSIG_Unspecified,                "Unspecified" },
+
+		{ ROSE_ERROR_QSIG_AOC_FreeOfCharge,           "AOC: FreeOfCharge" },
 
 		{ ROSE_ERROR_QSIG_CT_InvalidReroutingNumber,  "CT: Invalid Rerouting Number" },
 		{ ROSE_ERROR_QSIG_CT_UnrecognizedCallIdentity,"CT: Unrecognized Call Identity" },

Modified: branches/1.4/rose.h
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/rose.h?view=diff&rev=772&r1=771&r2=772
==============================================================================
--- branches/1.4/rose.h (original)
+++ branches/1.4/rose.h Tue Apr 21 18:32:13 2009
@@ -85,6 +85,15 @@
 	ROSE_QSIG_CalledName,                   /*!< Invoke only */
 	ROSE_QSIG_ConnectedName,                /*!< Invoke only */
 	ROSE_QSIG_BusyName,                     /*!< Invoke only */
+
+	/* Q.SIG SS-AOC-Operations */
+	ROSE_QSIG_ChargeRequest,                /*!< Invoke/Result */
+	ROSE_QSIG_GetFinalCharge,               /*!< Invoke only */
+	ROSE_QSIG_AocFinal,                     /*!< Invoke only */
+	ROSE_QSIG_AocInterim,                   /*!< Invoke only */
+	ROSE_QSIG_AocRate,                      /*!< Invoke only */
+	ROSE_QSIG_AocComplete,                  /*!< Invoke/Result */
+	ROSE_QSIG_AocDivChargeReq,              /*!< Invoke only */
 
 	/* Q.SIG Call-Transfer-Operations (CT) */
 	ROSE_QSIG_CallTransferIdentify,         /*!< Invoke/Result */
@@ -162,6 +171,9 @@
 
 	/* Q.SIG from various specifications */
 	ROSE_ERROR_QSIG_Unspecified,
+
+	/* Q.SIG SS-AOC-Operations */
+	ROSE_ERROR_QSIG_AOC_FreeOfCharge,
 
 	/* Q.SIG Call-Transfer-Operations (CT) */
 	ROSE_ERROR_QSIG_CT_InvalidReroutingNumber,
@@ -1116,6 +1128,455 @@
  */
 struct roseQsigPartyName_ARG {
 	struct roseQsigName name;
+};
+
+
+/* ------------------------------------------------------------------- */
+
+
+/*
+ * Time ::= SEQUENCE {
+ *     lengthOfTimeUnit [1] IMPLICIT LengthOfTimeUnit,
+ *     scale            [2] IMPLICIT Scale
+ * }
+ */
+struct roseQsigAOCTime {
+	/*! LengthOfTimeUnit ::= INTEGER (0..16777215) -- 24 bit number */
+	u_int32_t length;
+	/*!
+	 * \details
+	 * oneHundredthSecond(0),
+	 * oneTenthSecond(1),
+	 * oneSecond(2),
+	 * tenSeconds(3),
+	 * oneMinute(4),
+	 * oneHour(5),
+	 * twentyFourHours(6)
+	 */
+	u_int8_t scale;
+};
+
+/*
+ * Amount ::= SEQUENCE {
+ *     currencyAmount [1] IMPLICIT CurrencyAmount,
+ *     multiplier     [2] IMPLICIT Multiplier
+ * }
+ */
+struct roseQsigAOCAmount {
+	/*! CurrencyAmount ::= INTEGER (0..16777215) -- 24 bit number */
+	u_int32_t currency;
+	/*!
+	 * \details
+	 * oneThousandth(0),
+	 * oneHundredth(1),
+	 * oneTenth(2),
+	 * one(3),
+	 * ten(4),
+	 * hundred(5),
+	 * thousand(6)
+	 */
+	u_int8_t multiplier;
+};
+
+/*
+ * DurationCurrency ::= SEQUENCE {
+ *     dCurrency       [1] IMPLICIT Currency,
+ *     dAmount         [2] IMPLICIT Amount,
+ *     dChargingType   [3] IMPLICIT ChargingType,
+ *     dTime           [4] IMPLICIT Time,
+ *     dGranularity    [5] IMPLICIT Time OPTIONAL
+ * }
+ */
+struct roseQsigAOCDurationCurrency {
+	struct roseQsigAOCAmount amount;
+	struct roseQsigAOCTime time;
+	/*! \brief dGranularity (optional) */
+	struct roseQsigAOCTime granularity;
+	/*!
+	 * \brief Name of currency
+	 * \details
+	 * Currency ::= IA5String (SIZE (0..10))
+	 * \note The empty string is the default currency for the network.
+	 */
+	unsigned char currency[10 + 1];
+	/*!
+	 * \details
+	 * continuousCharging(0),
+	 * stepFunction(1)
+	 */
+	u_int8_t charging_type;
+	/*! TRUE if granularity time is present */
+	u_int8_t granularity_present;
+};
+
+/*
+ * FlatRateCurrency ::= SEQUENCE {
+ *     fRCurrency      [1] IMPLICIT Currency,
+ *     fRAmount        [2] IMPLICIT Amount
+ * }
+ */
+struct roseQsigAOCFlatRateCurrency {
+	struct roseQsigAOCAmount amount;
+	/*!
+	 * \brief Name of currency
+	 * \details
+	 * Currency ::= IA5String (SIZE (0..10))
+	 * \note The empty string is the default currency for the network.
+	 */
+	unsigned char currency[10 + 1];
+};
+
+/*
+ * VolumeRateCurrency ::= SEQUENCE {
+ *     vRCurrency      [1] IMPLICIT Currency,
+ *     vRAmount        [2] IMPLICIT Amount,
+ *     vRVolumeUnit    [3] IMPLICIT VolumeUnit
+ * }
+ */
+struct roseQsigAOCVolumeRateCurrency {
+	struct roseQsigAOCAmount amount;
+	/*!
+	 * \brief Name of currency
+	 * \details
+	 * Currency ::= IA5String (SIZE (0..10))
+	 * \note The empty string is the default currency for the network.
+	 */
+	unsigned char currency[10 + 1];
+	/*!
+	 * \brief Volume rate volume unit
+	 * \details
+	 * octet(0),
+	 * segment(1),
+	 * message(2)
+	 */
+	u_int8_t unit;
+};
+
+/*
+ * AOCSCurrencyInfo ::= SEQUENCE {
+ *     chargedItem                     ChargedItem,
+ *     rateType CHOICE {
+ *         durationCurrency            [1] IMPLICIT DurationCurrency,
+ *         flatRateCurrency            [2] IMPLICIT FlatRateCurrency,
+ *         volumeRateCurrency          [3] IMPLICIT VolumeRateCurrency,
+ *         specialChargingCode         SpecialChargingCode,
+ *         freeOfCharge                [4] IMPLICIT NULL,
+ *         currencyInfoNotAvailable    [5] IMPLICIT NULL,
+ *         freeOfChargefromBeginning   [6] IMPLICIT NULL
+ *     }
+ * }
+ */
+struct roseQsigAOCSCurrencyInfo {
+	union {
+		struct roseQsigAOCDurationCurrency duration;
+		struct roseQsigAOCFlatRateCurrency flat_rate;
+		struct roseQsigAOCVolumeRateCurrency volume_rate;
+		/*! SpecialChargingCode ::= INTEGER (1..10) */
+		u_int8_t special_charging_code;
+	} u;
+	/*!
+	 * \brief Determine what is stored in the union.
+	 * \details
+	 * specialChargingCode(0),
+	 * durationCurrency(1),
+	 * flatRateCurrency(2),
+	 * volumeRateCurrency(3),
+	 * freeOfCharge(4),
+	 * currencyInfoNotAvailable(5),
+	 * freeOfChargeFromBeginning(6)
+	 */
+	u_int8_t currency_type;
+	/*!
+	 * \brief What service is being billed.
+	 * \details
+	 * basicCommunication(0),
+	 * callAttempt(1),
+	 * callSetup(2),
+	 * userToUserInfo(3),
+	 * operationOfSupplementaryServ(4)
+	 */
+	u_int8_t charged_item;
+};
+
+/*
+ * AOCSCurrencyInfoList ::= SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo
+ */
+struct roseQsigAOCSCurrencyInfoList {
+	/*! \brief SEQUENCE SIZE (1..10) OF AOCSCurrencyInfo */
+	struct roseQsigAOCSCurrencyInfo list[10];
+
+	/*! \brief Number of AOCSCurrencyInfo records present */
+	u_int8_t num_records;
+};
+
+/*
+ * RecordedCurrency ::= SEQUENCE {
+ *     rCurrency       [1] IMPLICIT Currency,
+ *     rAmount         [2] IMPLICIT Amount
+ * }
+ */
+struct roseQsigAOCRecordedCurrency {
+	/*! Amount of currency involved. */
+	struct roseQsigAOCAmount amount;
+	/*!
+	 * \brief Name of currency
+	 * \details
+	 * Currency ::= IA5String (SIZE (0..10))
+	 * \note The empty string is the default currency for the network.
+	 */
+	unsigned char currency[10 + 1];
+};
+
+/*
+ * ChargingAssociation ::= CHOICE {
+ *     chargedNumber     [0] EXPLICIT PartyNumber,
+ *     chargeIdentifier  ChargeIdentifier
+ * }
+ */
+struct roseQsigAOCChargingAssociation {
+	/*! chargeIdentifier: INTEGER (-32768..32767) -- 16 bit number */
+	int16_t id;
+	/*! chargedNumber */
+	struct rosePartyNumber number;
+	/*!
+	 * \details
+	 * charge_identifier(0)
+	 * charged_number(1),
+	 */
+	u_int8_t type;
+};
+
+/*
+ * AocRateArg ::= SEQUENCE {
+ *     aocRate CHOICE
+ *     {
+ *         chargeNotAvailable      NULL,
+ *         aocSCurrencyInfoList    AOCSCurrencyInfoList
+ *     },
+ *     rateArgExtension CHOICE {
+ *         extension               [1] IMPLICIT Extension,
+ *         multipleExtension       [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigAocRateArg_ARG {
+	struct roseQsigAOCSCurrencyInfoList currency_info;
+	/*!
+	 * \details
+	 * charge_not_available(0),
+	 * currency_info_list(1)
+	 */
+	u_int8_t type;
+};
+
+/*
+ * AocInterimArg ::= SEQUENCE {
+ *     interimCharge CHOICE {
+ *         chargeNotAvailable      [0] IMPLICIT NULL,
+ *         freeOfCharge            [1] IMPLICIT NULL,
+ *         specificCurrency        SEQUENCE {
+ *             recordedCurrency    [1] IMPLICIT RecordedCurrency,
+ *             interimBillingId    [2] IMPLICIT InterimBillingId OPTIONAL
+ *         }
+ *     },
+ *     interimArgExtension CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigAocInterimArg_ARG {
+	struct {
+		/*! \brief recorded currency */
+		struct roseQsigAOCRecordedCurrency recorded;
+		/*!
+		 * \brief InterimBillingId (optional)
+		 * \details
+		 * normalCharging(0),
+		 * creditCardCharging(2)
+		 */
+		u_int8_t billing_id;
+		/*! \brief TRUE if billing id is present */
+		u_int8_t billing_id_present;
+	} specific;
+	/*!
+	 * \details
+	 * charge_not_available(0),
+	 * free_of_charge(1),
+	 * specific_currency(2)
+	 */
+	u_int8_t type;
+};
+
+/*
+ * AocFinalArg ::= SEQUENCE {
+ *     finalCharge CHOICE {
+ *         chargeNotAvailable      [0] IMPLICIT NULL,
+ *         freeOfCharge            [1] IMPLICIT NULL,
+ *         specificCurrency        SEQUENCE {
+ *             recordedCurrency    [1] IMPLICIT RecordedCurrency,
+ *             finalBillingId      [2] IMPLICIT FinalBillingId OPTIONAL
+ *         }
+ *     },
+ *     chargingAssociation ChargingAssociation OPTIONAL,
+ *     finalArgExtension   CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigAocFinalArg_ARG {
+	struct {
+		/*! \brief recorded currency */
+		struct roseQsigAOCRecordedCurrency recorded;
+		/*!
+		 * \brief FinalBillingId (optional)
+		 * \details
+		 * normalCharging(0),
+		 * creditCardCharging(2),
+		 * callForwardingUnconditional(3),
+		 * callForwardingBusy(4),
+		 * callForwardingNoReply(5),
+		 * callDeflection(6),
+		 * callTransfer(7)
+		 */
+		u_int8_t billing_id;
+		/*! \brief TRUE if billing id is present */
+		u_int8_t billing_id_present;
+	} specific;
+
+	/*! \brief chargingAssociation (optional) */
+	struct roseQsigAOCChargingAssociation charging_association;
+
+	/*! \brief TRUE if charging_association is present */
+	u_int8_t charging_association_present;
+
+	/*!
+	 * \details
+	 * charge_not_available(0),
+	 * free_of_charge(1),
+	 * specific_currency(2)
+	 */
+	u_int8_t type;
+};
+
+/*
+ * ChargeRequestArg ::= SEQUENCE {
+ *     adviceModeCombinations  SEQUENCE SIZE(0..7) OF AdviceModeCombination,
+ *     chargeReqArgExtension   CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigChargeRequestArg_ARG {
+	/*!
+	 * \brief SEQUENCE SIZE(0..7) OF AdviceModeCombination
+	 * \details
+	 * rate(0) <charge rate provision>,
+	 * rateInterim(1) <charge rate and interim charge provision>,
+	 * rateFinal(2) <charge rate and final charge provision>,
+	 * interim(3) <interim charge provision>,
+	 * final(4) <final charge provision>,
+	 * interimFinal(5) <interim charge and final charge provision>,
+	 * rateInterimFinal(6) <charge rate, interim charge and final charge provision>
+	 */
+	u_int8_t advice_mode_combinations[7];
+
+	/*! \brief Number of AdviceModeCombination values present */
+	u_int8_t num_records;
+};
+
+/*
+ * ChargeRequestRes ::= SEQUENCE {
+ *     adviceModeCombination   AdviceModeCombination,
+ *     chargeReqResExtension   CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigChargeRequestRes_RES {
+	/*!
+	 * \details
+	 * rate(0) <charge rate provision>,
+	 * rateInterim(1) <charge rate and interim charge provision>,
+	 * rateFinal(2) <charge rate and final charge provision>,
+	 * interim(3) <interim charge provision>,
+	 * final(4) <final charge provision>,
+	 * interimFinal(5) <interim charge and final charge provision>,
+	 * rateInterimFinal(6) <charge rate, interim charge and final charge provision>
+	 */
+	u_int8_t advice_mode_combination;
+};
+
+/*
+ * AocCompleteArg ::= SEQUENCE {
+ *     chargedUser             PartyNumber,
+ *     chargingAssociation     ChargingAssociation OPTIONAL,
+ *     completeArgExtension    CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigAocCompleteArg_ARG {
+	/*! \brief chargingAssociation (optional) */
+	struct roseQsigAOCChargingAssociation charging_association;
+
+	struct rosePartyNumber charged_user_number;
+
+	/*! \brief TRUE if charging_association is present */
+	u_int8_t charging_association_present;
+};
+
+/*
+ * AocCompleteRes ::= SEQUENCE {
+ *     chargingOption          ChargingOption,
+ *     completeResExtension    CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigAocCompleteRes_RES {
+	/*!
+	 * \details
+	 * aocFreeOfCharge(0),
+	 * aocContinueCharging(1),
+	 * aocStopCharging(2)
+	 */
+	u_int8_t charging_option;
+};
+
+/*
+ * AocDivChargeReqArg ::= SEQUENCE {
+ *     divertingUser           PartyNumber,
+ *     chargingAssociation     ChargingAssociation OPTIONAL,
+ *     diversionType           DiversionType,
+ *     aocDivChargeReqArgExt   CHOICE {
+ *         extension           [1] IMPLICIT Extension,
+ *         multipleExtension   [2] IMPLICIT SEQUENCE OF Extension
+ *     } OPTIONAL
+ * }
+ */
+struct roseQsigAocDivChargeReqArg_ARG {
+	/*! \brief chargingAssociation (optional) */
+	struct roseQsigAOCChargingAssociation charging_association;
+
+	struct rosePartyNumber diverting_user_number;
+
+	/*! \brief TRUE if charging_association is present */
+	u_int8_t charging_association_present;
+
+	/*!
+	 * \details
+	 * callForwardingUnconditional(0),
+	 * callForwardingBusy(1),
+	 * callForwardingNoReply(2),
+	 * callDeflection(3)
+	 */
+	u_int8_t diversion_type;
 };
 
 
@@ -2193,6 +2654,14 @@
 	struct roseQsigPartyName_ARG ConnectedName;
 	struct roseQsigPartyName_ARG BusyName;
 
+	/* Q.SIG SS-AOC-Operations */
+	struct roseQsigChargeRequestArg_ARG ChargeRequest;
+	struct roseQsigAocFinalArg_ARG AocFinal;
+	struct roseQsigAocInterimArg_ARG AocInterim;
+	struct roseQsigAocRateArg_ARG AocRate;
+	struct roseQsigAocCompleteArg_ARG AocComplete;
+	struct roseQsigAocDivChargeReqArg_ARG AocDivChargeReq;
+
 	/* Q.SIG Call-Transfer-Operations */
 	struct roseQsigCTInitiateArg_ARG CallTransferInitiate;
 	struct roseQsigCTSetupArg_ARG CallTransferSetup;
@@ -2219,6 +2688,10 @@
 
 /*! \brief Facility ie result qsig messages with arguments. */
 union rose_msg_result_qsig_args {
+	/* Q.SIG SS-AOC-Operations */
+	struct roseQsigChargeRequestRes_RES ChargeRequest;
+	struct roseQsigAocCompleteRes_RES AocComplete;
+
 	/* Q.SIG Call-Transfer-Operations */
 	struct roseQsigCTIdentifyRes_RES CallTransferIdentify;
 

Modified: branches/1.4/rose_internal.h
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/rose_internal.h?view=diff&rev=772&r1=771&r2=772
==============================================================================
--- branches/1.4/rose_internal.h (original)
+++ branches/1.4/rose_internal.h Tue Apr 21 18:32:13 2009
@@ -169,9 +169,10 @@
 
 /*
  * Q.SIG Dummy invoke/result argument used by:
+ * SS-AOC-Operations,
  * Call-Transfer-Operations,
- * Call-Diversion-Operations, 
- * and SS-MWI-Operations 
+ * Call-Diversion-Operations,
+ * and SS-MWI-Operations.
  */
 unsigned char *rose_enc_qsig_DummyArg_ARG(struct pri *ctrl, unsigned char *pos,
 	unsigned char *end, const union rose_msg_invoke_args *args);
@@ -184,6 +185,49 @@
 const unsigned char *rose_dec_qsig_DummyRes_RES(struct pri *ctrl, unsigned tag,
 	const unsigned char *pos, const unsigned char *end,
 	union rose_msg_result_args *args);
+
+/* Q.SIG SS-AOC-Operations */
+unsigned char *rose_enc_qsig_ChargeRequest_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args);
+unsigned char *rose_enc_qsig_ChargeRequest_RES(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_result_args *args);
+unsigned char *rose_enc_qsig_AocFinal_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args);
+unsigned char *rose_enc_qsig_AocInterim_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args);
+unsigned char *rose_enc_qsig_AocRate_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args);
+unsigned char *rose_enc_qsig_AocComplete_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args);
+unsigned char *rose_enc_qsig_AocComplete_RES(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_result_args *args);
+unsigned char *rose_enc_qsig_AocDivChargeReq_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args);
+
+const unsigned char *rose_dec_qsig_ChargeRequest_ARG(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_invoke_args *args);
+const unsigned char *rose_dec_qsig_ChargeRequest_RES(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_result_args *args);
+const unsigned char *rose_dec_qsig_AocFinal_ARG(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_invoke_args *args);
+const unsigned char *rose_dec_qsig_AocInterim_ARG(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_invoke_args *args);
+const unsigned char *rose_dec_qsig_AocRate_ARG(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_invoke_args *args);
+const unsigned char *rose_dec_qsig_AocComplete_ARG(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_invoke_args *args);
+const unsigned char *rose_dec_qsig_AocComplete_RES(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_result_args *args);
+const unsigned char *rose_dec_qsig_AocDivChargeReq_ARG(struct pri *ctrl, unsigned tag,
+	const unsigned char *pos, const unsigned char *end,
+	union rose_msg_invoke_args *args);
 
 /* Q.SIG Call-Diversion-Operations */
 unsigned char *rose_enc_qsig_ActivateDiversionQ_ARG(struct pri *ctrl, unsigned char *pos,

Added: branches/1.4/rose_qsig_aoc.c
URL: http://svn.digium.com/svn-view/libpri/branches/1.4/rose_qsig_aoc.c?view=auto&rev=772
==============================================================================
--- branches/1.4/rose_qsig_aoc.c (added)
+++ branches/1.4/rose_qsig_aoc.c Tue Apr 21 18:32:13 2009
@@ -1,0 +1,1714 @@
+/*
+ * libpri: An implementation of Primary Rate ISDN
+ *
+ * Copyright (C) 2009 Digium, Inc.
+ *
+ * Richard Mudgett <rmudgett at digium.com>
+ *
+ * See http://www.asterisk.org for more information about
+ * the Asterisk project. Please do not directly contact
+ * any of the maintainers of this project for assistance;
+ * the project provides a web site, mailing lists and IRC
+ * channels for your use.
+ *
+ * This program is free software, distributed under the terms of
+ * the GNU General Public License Version 2 as published by the
+ * Free Software Foundation. See the LICENSE file included with
+ * this program for more details.
+ *
+ * In addition, when this program is distributed with Asterisk in
+ * any form that would qualify as a 'combined work' or as a
+ * 'derivative work' (but not mere aggregation), you can redistribute
+ * and/or modify the combination under the terms of the license
+ * provided with that copy of Asterisk, instead of the license
+ * terms granted here.
+ */
+
+/*!
+ * \file
+ * \brief Q.SIG ROSE Advice-Of-Charge (AOC) operations
+ *
+ * SS-AOC-Operations ECMA-212 Annex E Table E.1
+ *
+ * \author Richard Mudgett <rmudgett at digium.com>
+ */
+
+
+#include "compat.h"
+#include "libpri.h"
+#include "pri_internal.h"
+#include "rose.h"
+#include "rose_internal.h"
+#include "asn1.h"
+
+
+/* ------------------------------------------------------------------- */
+
+/*!
+ * \internal
+ * \brief Encode the Time type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param time Time information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_Time(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, unsigned tag, const struct roseQsigAOCTime *time)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
+		time->length));
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 2, time->scale));
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the Amount type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param amount Amount information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_Amount(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, unsigned tag, const struct roseQsigAOCAmount *amount)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
+		amount->currency));
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 2,
+		amount->multiplier));
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the RecordedCurrency type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param recorded Recorded currency information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_RecordedCurrency(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end, unsigned tag,
+	const struct roseQsigAOCRecordedCurrency *recorded)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_string_max(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
+		recorded->currency, sizeof(recorded->currency) - 1));
+	ASN1_CALL(pos, rose_enc_qsig_AOC_Amount(ctrl, pos, end,
+		ASN1_CLASS_CONTEXT_SPECIFIC | 2, &recorded->amount));
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the DurationCurrency type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param duration Duration currency information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_DurationCurrency(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end, unsigned tag,
+	const struct roseQsigAOCDurationCurrency *duration)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_string_max(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
+		duration->currency, sizeof(duration->currency) - 1));
+	ASN1_CALL(pos, rose_enc_qsig_AOC_Amount(ctrl, pos, end,
+		ASN1_CLASS_CONTEXT_SPECIFIC | 2, &duration->amount));
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 3,
+		duration->charging_type));
+	ASN1_CALL(pos, rose_enc_qsig_AOC_Time(ctrl, pos, end,
+		ASN1_CLASS_CONTEXT_SPECIFIC | 4, &duration->time));
+	if (duration->granularity_present) {
+		ASN1_CALL(pos, rose_enc_qsig_AOC_Time(ctrl, pos, end,
+			ASN1_CLASS_CONTEXT_SPECIFIC | 5, &duration->granularity));
+	}
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the FlatRateCurrency type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param flat_rate Flat rate currency information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_FlatRateCurrency(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end, unsigned tag,
+	const struct roseQsigAOCFlatRateCurrency *flat_rate)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_string_max(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
+		flat_rate->currency, sizeof(flat_rate->currency) - 1));
+	ASN1_CALL(pos, rose_enc_qsig_AOC_Amount(ctrl, pos, end,
+		ASN1_CLASS_CONTEXT_SPECIFIC | 2, &flat_rate->amount));
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the VolumeRateCurrency type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param volume_rate Volume rate currency information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_VolumeRateCurrency(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end, unsigned tag,
+	const struct roseQsigAOCVolumeRateCurrency *volume_rate)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_string_max(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 1,
+		volume_rate->currency, sizeof(volume_rate->currency) - 1));
+	ASN1_CALL(pos, rose_enc_qsig_AOC_Amount(ctrl, pos, end,
+		ASN1_CLASS_CONTEXT_SPECIFIC | 2, &volume_rate->amount));
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 3,
+		volume_rate->unit));
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the AOCSCurrencyInfo type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param currency_info Currency information record to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOCSCurrencyInfo(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end, unsigned tag,
+	const struct roseQsigAOCSCurrencyInfo *currency_info)
+{
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_TYPE_ENUMERATED,
+		currency_info->charged_item));
+
+	switch (currency_info->currency_type) {
+	case 0:	/* specialChargingCode */
+		ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_TYPE_INTEGER,
+			currency_info->u.special_charging_code));
+		break;
+	case 1:	/* durationCurrency */
+		ASN1_CALL(pos, rose_enc_qsig_AOC_DurationCurrency(ctrl, pos, end,
+			ASN1_CLASS_CONTEXT_SPECIFIC | 1, &currency_info->u.duration));
+		break;
+	case 2:	/* flatRateCurrency */
+		ASN1_CALL(pos, rose_enc_qsig_AOC_FlatRateCurrency(ctrl, pos, end,
+			ASN1_CLASS_CONTEXT_SPECIFIC | 2, &currency_info->u.flat_rate));
+		break;
+	case 3:	/* volumeRateCurrency */
+		ASN1_CALL(pos, rose_enc_qsig_AOC_VolumeRateCurrency(ctrl, pos, end,
+			ASN1_CLASS_CONTEXT_SPECIFIC | 3, &currency_info->u.volume_rate));
+		break;
+	case 4:	/* freeOfCharge */
+		ASN1_CALL(pos, asn1_enc_null(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 4));
+		break;
+	case 5:	/* currencyInfoNotAvailable */
+		ASN1_CALL(pos, asn1_enc_null(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 5));
+		break;
+	case 6:	/* freeOfChargeFromBeginning */
+		ASN1_CALL(pos, asn1_enc_null(pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 6));
+		break;
+	default:
+		ASN1_ENC_ERROR(ctrl, "Unknown currency type");
+		return NULL;
+	}
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the AOCSCurrencyInfoList type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param tag Component tag to identify the encoded component.
+ *   The tag should be ASN1_TAG_SEQUENCE unless the caller implicitly
+ *   tags it otherwise.
+ * \param currency_info Currency information list to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOCSCurrencyInfoList(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end, unsigned tag,
+	const struct roseQsigAOCSCurrencyInfoList *currency_info)
+{
+	unsigned index;
+	unsigned char *seq_len;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, tag);
+
+	for (index = 0; index < currency_info->num_records; ++index) {
+		ASN1_CALL(pos, rose_enc_qsig_AOCSCurrencyInfo(ctrl, pos, end, ASN1_TAG_SEQUENCE,
+			&currency_info->list[index]));
+	}
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \internal
+ * \brief Encode the ChargingAssociation type.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param charging Charging association information to encode.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+static unsigned char *rose_enc_qsig_AOC_ChargingAssociation(struct pri *ctrl,
+	unsigned char *pos, unsigned char *end,
+	const struct roseQsigAOCChargingAssociation *charging)
+{
+	unsigned char *explicit_len;
+
+	switch (charging->type) {
+	case 0:	/* charge_identifier */
+		ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_TYPE_INTEGER, charging->id));
+		break;
+	case 1:	/* charged_number */
+		/* EXPLICIT tag */
+		ASN1_CONSTRUCTED_BEGIN(explicit_len, pos, end, ASN1_CLASS_CONTEXT_SPECIFIC | 0);
+		ASN1_CALL(pos, rose_enc_PartyNumber(ctrl, pos, end, &charging->number));
+		ASN1_CONSTRUCTED_END(explicit_len, pos, end);
+		break;
+	default:
+		ASN1_ENC_ERROR(ctrl, "Unknown ChargingAssociation type");
+		return NULL;
+	}
+
+	return pos;
+}
+
+/*!
+ * \brief Encode the Q.SIG ChargeRequest invoke facility ie arguments.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param args Arguments to encode in the buffer.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+unsigned char *rose_enc_qsig_ChargeRequest_ARG(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_invoke_args *args)
+{
+	unsigned index;
+	unsigned char *seq_len;
+	unsigned char *advice_len;
+	const struct roseQsigChargeRequestArg_ARG *charge_request;
+
+	charge_request = &args->qsig.ChargeRequest;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, ASN1_TAG_SEQUENCE);
+
+	/* SEQUENCE SIZE(0..7) OF AdviceModeCombination */
+	ASN1_CONSTRUCTED_BEGIN(advice_len, pos, end, ASN1_TAG_SEQUENCE);
+	for (index = 0; index < charge_request->num_records; ++index) {
+		ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_TYPE_ENUMERATED,
+			charge_request->advice_mode_combinations[index]));
+	}
+	ASN1_CONSTRUCTED_END(advice_len, pos, end);
+
+	/* No extension to encode */
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \brief Encode the Q.SIG ChargeRequest result facility ie arguments.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param args Arguments to encode in the buffer.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.
+ * \retval NULL on error.
+ */
+unsigned char *rose_enc_qsig_ChargeRequest_RES(struct pri *ctrl, unsigned char *pos,
+	unsigned char *end, const union rose_msg_result_args *args)
+{
+	unsigned char *seq_len;
+	const struct roseQsigChargeRequestRes_RES *charge_request;
+
+	charge_request = &args->qsig.ChargeRequest;
+
+	ASN1_CONSTRUCTED_BEGIN(seq_len, pos, end, ASN1_TAG_SEQUENCE);
+
+	ASN1_CALL(pos, asn1_enc_int(pos, end, ASN1_TYPE_ENUMERATED,
+		charge_request->advice_mode_combination));
+
+	/* No extension to encode */
+
+	ASN1_CONSTRUCTED_END(seq_len, pos, end);
+
+	return pos;
+}
+
+/*!
+ * \brief Encode the Q.SIG AocFinal invoke facility ie arguments.
+ *
+ * \param ctrl D channel controller for diagnostic messages or global options.
+ * \param pos Starting position to encode ASN.1 component.
+ * \param end End of ASN.1 encoding data buffer.
+ * \param args Arguments to encode in the buffer.
+ *
+ * \retval Start of the next ASN.1 component to encode on success.

[... 1598 lines stripped ...]



More information about the libpri-commits mailing list