[svn-commits] dvossel: branch dvossel/aoc_send r1642 - /team/dvossel/aoc_send/
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Tue Apr 20 17:30:32 CDT 2010
Author: dvossel
Date: Tue Apr 20 17:30:31 2010
New Revision: 1642
URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1642
Log:
addresses more reviewboard comments
Modified:
team/dvossel/aoc_send/pri_aoc.c
team/dvossel/aoc_send/pri_facility.c
team/dvossel/aoc_send/pri_facility.h
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=1642&r1=1641&r2=1642
==============================================================================
--- team/dvossel/aoc_send/pri_aoc.c (original)
+++ team/dvossel/aoc_send/pri_aoc.c Tue Apr 20 17:30:31 2010
@@ -119,7 +119,7 @@
/*!
* \internal
- * \brief Fill in the the ETSI recorded currency from the subcmd currency info
+ * \brief Fill in the the ETSI recorded currency from the subcmd currency info
*
* \param subcmd_recorded AOC subcmd recorded currency.
* \param etsi_recorded AOC ETSI recorded currency.
@@ -166,7 +166,7 @@
/*!
* \internal
- * \brief Fill in the ETSI recorded units from the AOC subcmd recorded units.
+ * \brief Fill in the ETSI recorded units from the AOC subcmd recorded units.
*
* \param subcmd_recorded AOC subcmd recorded units list.
* \param etsi_recorded AOC ETSI recorded units list.
@@ -202,16 +202,18 @@
* \brief Handle the ETSI ChargingRequest.
*
* \param ctrl D channel controller for diagnostic messages or global options.
+ * \param call Q.931 call leg.
* \param invoke Decoded ROSE invoke message contents.
*
* \return Nothing
*/
-void aoc_etsi_aoc_request(struct pri *ctrl, const struct rose_msg_invoke *invoke)
+void aoc_etsi_aoc_request(struct pri *ctrl, q931_call *call, const struct rose_msg_invoke *invoke)
{
struct pri_subcommand *subcmd;
int request;
if (!PRI_MASTER(ctrl)->aoc_support) {
+ send_facility_error(ctrl, call, invoke->invoke_id, ROSE_ERROR_Gen_NotSubscribed);
return;
}
switch (invoke->args.etsi.ChargingRequest.charging_case) {
@@ -225,11 +227,13 @@
request = PRI_AOC_REQUEST_E;
break;
default:
+ send_facility_error(ctrl, call, invoke->invoke_id, ROSE_ERROR_Gen_NotImplemented);
return;
}
subcmd = q931_alloc_subcommand(ctrl);
if (!subcmd) {
+ send_facility_error(ctrl, call, invoke->invoke_id, ROSE_ERROR_Gen_NotAvailable);
return;
}
@@ -685,8 +689,7 @@
* \internal
* \brief Determine the etsi aoc-e billing_id value from the subcmd.
*
- * \param billing_id_present TRUE if billing_id valid.
- * \param billing_id ETSI billing id from ROSE.
+ * \param PRI_AOC_E_BILLING_ID billing_id
*
* \retval -1 failure
* \retval etsi billing id
@@ -721,8 +724,7 @@
* \internal
* \brief Determine the etsi aoc-d billing_id value from the subcmd.
*
- * \param billing_id_present TRUE if billing_id valid.
- * \param billing_id ETSI billing id from ROSE.
+ * \param PRI_AOC_D_BILLING_ID billing_id
*
* \retval -1 failure
* \retval etsi billing id
@@ -918,7 +920,6 @@
case PRI_AOC_E_CHARGING_ASSOCIATION_NUMBER:
msg.args.etsi.AOCECurrency.currency_info.charging_association_present = 1;
msg.args.etsi.AOCECurrency.currency_info.charging_association.type = 1; /* number */
- q931_party_number_init(&q931_number);
pri_copy_party_number_to_q931(&q931_number, &aoc_e->associated.charge.number);
q931_copy_number_to_rose(ctrl,
&msg.args.etsi.AOCECurrency.currency_info.charging_association.number,
@@ -989,7 +990,6 @@
case PRI_AOC_E_CHARGING_ASSOCIATION_NUMBER:
msg.args.etsi.AOCEChargingUnit.charging_unit.charging_association_present = 1;
msg.args.etsi.AOCEChargingUnit.charging_unit.charging_association.type = 1; /* number */
- q931_party_number_init(&q931_number);
pri_copy_party_number_to_q931(&q931_number, &aoc_e->associated.charge.number);
q931_copy_number_to_rose(ctrl,
&msg.args.etsi.AOCEChargingUnit.charging_unit.charging_association.number,
@@ -1306,7 +1306,7 @@
* \param invoke_id
* \param aoc_s Optional AOC-S rate list for response
*
- * \note if aoc_s is NULL, then a response will be sent back as AOC-S not available.
+ * \note if aoc_s is NULL, then a response will be sent back as AOC-S not available.
*
* \retval 0 on success.
* \retval -1 on error.
@@ -1485,7 +1485,8 @@
memset(&response, 0, sizeof(response));
response.invoke_id = ctrl->last_invoke;
/* Set a custom timeout period. Wait 60 seconds for AOC-S response
- * TODO, this may need to be configurable */
+ * TODO, "Timing out" when a specific message comes in would be a
+ * better solution than a simple timout in this case */
response.timeout_time = 60000;
response.callback = pri_aoc_request_get_response;
response.user.value = request;
Modified: team/dvossel/aoc_send/pri_facility.c
URL: http://svnview.digium.com/svn/libpri/team/dvossel/aoc_send/pri_facility.c?view=diff&rev=1642&r1=1641&r2=1642
==============================================================================
--- team/dvossel/aoc_send/pri_facility.c (original)
+++ team/dvossel/aoc_send/pri_facility.c Tue Apr 20 17:30:31 2010
@@ -4056,7 +4056,7 @@
}
break;
case ROSE_ETSI_ChargingRequest:
- aoc_etsi_aoc_request(ctrl, invoke);
+ aoc_etsi_aoc_request(ctrl, call, invoke);
break;
case ROSE_ETSI_AOCSCurrency:
aoc_etsi_aoc_s_currency(ctrl, invoke);
Modified: team/dvossel/aoc_send/pri_facility.h
URL: http://svnview.digium.com/svn/libpri/team/dvossel/aoc_send/pri_facility.h?view=diff&rev=1642&r1=1641&r2=1642
==============================================================================
--- team/dvossel/aoc_send/pri_facility.h (original)
+++ team/dvossel/aoc_send/pri_facility.h Tue Apr 20 17:30:31 2010
@@ -245,7 +245,7 @@
void pri_cc_qsig_cancel(struct pri *ctrl, q931_call *call, int msgtype, const struct rose_msg_invoke *invoke);
void pri_cc_qsig_exec_possible(struct pri *ctrl, q931_call *call, int msgtype, const struct rose_msg_invoke *invoke);
-void aoc_etsi_aoc_request(struct pri *ctrl, const struct rose_msg_invoke *invoke);
+void aoc_etsi_aoc_request(struct pri *ctrl, q931_call *call, const struct rose_msg_invoke *invoke);
void aoc_etsi_aoc_s_currency(struct pri *ctrl, const struct rose_msg_invoke *invoke);
void aoc_etsi_aoc_s_special_arrangement(struct pri *ctrl, const struct rose_msg_invoke *invoke);
void aoc_etsi_aoc_d_currency(struct pri *ctrl, const struct rose_msg_invoke *invoke);
More information about the svn-commits
mailing list