[libpri-commits] rmudgett: branch group/ccss r1394 - /team/group/ccss/

SVN commits to the libpri project libpri-commits at lists.digium.com
Sat Dec 19 01:06:26 CST 2009


Author: rmudgett
Date: Sat Dec 19 01:06:24 2009
New Revision: 1394

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1394
Log:
Q.SIG requires knowledge of the Q.931 message type when processing CC.

Adjusted the paramter types of the APDU response callback to pass in the
Q.931 message type.

Modified:
    team/group/ccss/pri_cc.c
    team/group/ccss/pri_facility.c
    team/group/ccss/pri_facility.h

Modified: team/group/ccss/pri_cc.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_cc.c?view=diff&rev=1394&r1=1393&r2=1394
==============================================================================
--- team/group/ccss/pri_cc.c (original)
+++ team/group/ccss/pri_cc.c Sat Dec 19 01:06:24 2009
@@ -2392,7 +2392,7 @@
  *
  * \return TRUE if no more responses are expected.
  */
-static int pri_cc_ccbs_status_response(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const union apdu_msg_data *msg)
+static int pri_cc_ccbs_status_response(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const struct apdu_msg_data *msg)
 {
 	struct pri_cc_record *cc_record;
 
@@ -2402,7 +2402,8 @@
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_TIMEOUT_T_CCBS1);
 		break;
 	case APDU_CALLBACK_REASON_MSG_RESULT:
-		pri_cc_event(ctrl, call, cc_record, msg->result->args.etsi.CCBSStatusRequest.free
+		pri_cc_event(ctrl, call, cc_record,
+			msg->response.result->args.etsi.CCBSStatusRequest.free
 			? CC_EVENT_A_FREE : CC_EVENT_A_BUSY);
 		break;
 	default:
@@ -2521,7 +2522,7 @@
  *
  * \return TRUE if no more responses are expected.
  */
-static int pri_cc_req_response_ptmp(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const union apdu_msg_data *msg)
+static int pri_cc_req_response_ptmp(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const struct apdu_msg_data *msg)
 {
 	struct pri_cc_record *cc_record;
 
@@ -2537,20 +2538,21 @@
 		 * reference and linkage id's.
 		 */
 		cc_record->ccbs_reference_id =
-			msg->result->args.etsi.CCBSRequest.ccbs_reference & 0x7F;
-		cc_record->option.recall_mode = msg->result->args.etsi.CCBSRequest.recall_mode;
+			msg->response.result->args.etsi.CCBSRequest.ccbs_reference & 0x7F;
+		cc_record->option.recall_mode =
+			msg->response.result->args.etsi.CCBSRequest.recall_mode;
 
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_CC_REQUEST_ACCEPT);
 		break;
 	case APDU_CALLBACK_REASON_MSG_ERROR:
 		cc_record->msg.cc_req_rsp.reason = reason;
-		cc_record->msg.cc_req_rsp.code = msg->error->code;
+		cc_record->msg.cc_req_rsp.code = msg->response.error->code;
 
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_CC_REQUEST_FAIL);
 		break;
 	case APDU_CALLBACK_REASON_MSG_REJECT:
 		cc_record->msg.cc_req_rsp.reason = reason;
-		cc_record->msg.cc_req_rsp.code = msg->reject->code;
+		cc_record->msg.cc_req_rsp.code = msg->response.reject->code;
 
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_CC_REQUEST_FAIL);
 		break;
@@ -2577,7 +2579,7 @@
  *
  * \return TRUE if no more responses are expected.
  */
-static int pri_cc_req_response_ptp(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const union apdu_msg_data *msg)
+static int pri_cc_req_response_ptp(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const struct apdu_msg_data *msg)
 {
 	struct pri_cc_record *cc_record;
 
@@ -2589,19 +2591,19 @@
 		break;
 	case APDU_CALLBACK_REASON_MSG_RESULT:
 		cc_record->option.retain_service =
-			msg->result->args.etsi.CCBS_T_Request.retention_supported;
+			msg->response.result->args.etsi.CCBS_T_Request.retention_supported;
 
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_CC_REQUEST_ACCEPT);
 		break;
 	case APDU_CALLBACK_REASON_MSG_ERROR:
 		cc_record->msg.cc_req_rsp.reason = reason;
-		cc_record->msg.cc_req_rsp.code = msg->error->code;
+		cc_record->msg.cc_req_rsp.code = msg->response.error->code;
 
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_CC_REQUEST_FAIL);
 		break;
 	case APDU_CALLBACK_REASON_MSG_REJECT:
 		cc_record->msg.cc_req_rsp.reason = reason;
-		cc_record->msg.cc_req_rsp.code = msg->reject->code;
+		cc_record->msg.cc_req_rsp.code = msg->response.reject->code;
 
 		pri_cc_event(ctrl, call, cc_record, CC_EVENT_CC_REQUEST_FAIL);
 		break;

Modified: team/group/ccss/pri_facility.c
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_facility.c?view=diff&rev=1394&r1=1393&r2=1394
==============================================================================
--- team/group/ccss/pri_facility.c (original)
+++ team/group/ccss/pri_facility.c Sat Dec 19 01:06:24 2009
@@ -3279,7 +3279,7 @@
 {
 	q931_call *orig_call;
 	struct apdu_event *apdu;
-	union apdu_msg_data msg;
+	struct apdu_msg_data msg;
 
 	/* Gripe to the user about getting rejected. */
 	pri_error(ctrl, "ROSE REJECT:\n");
@@ -3325,7 +3325,8 @@
 	} else {
 		orig_call = call;
 	}
-	msg.reject = reject;
+	msg.response.reject = reject;
+	msg.type = msgtype;
 	if (apdu->response.callback(APDU_CALLBACK_REASON_MSG_REJECT, ctrl, call, apdu, &msg)) {
 		pri_call_apdu_delete(orig_call, apdu);
 	}
@@ -3349,7 +3350,7 @@
 	const char *dms100_operation;
 	q931_call *orig_call;
 	struct apdu_event *apdu;
-	union apdu_msg_data msg;
+	struct apdu_msg_data msg;
 
 	/* Gripe to the user about getting an error. */
 	pri_error(ctrl, "ROSE RETURN ERROR:\n");
@@ -3407,7 +3408,8 @@
 	} else {
 		orig_call = call;
 	}
-	msg.error = error;
+	msg.response.error = error;
+	msg.type = msgtype;
 	if (apdu->response.callback(APDU_CALLBACK_REASON_MSG_ERROR, ctrl, call, apdu, &msg)) {
 		pri_call_apdu_delete(orig_call, apdu);
 	}
@@ -3430,7 +3432,7 @@
 {
 	q931_call *orig_call;
 	struct apdu_event *apdu;
-	union apdu_msg_data msg;
+	struct apdu_msg_data msg;
 
 	switch (ctrl->switchtype) {
 	case PRI_SWITCH_DMS100:
@@ -3483,7 +3485,8 @@
 	} else {
 		orig_call = call;
 	}
-	msg.result = result;
+	msg.response.result = result;
+	msg.type = msgtype;
 	if (apdu->response.callback(APDU_CALLBACK_REASON_MSG_RESULT, ctrl, call, apdu, &msg)) {
 		pri_call_apdu_delete(orig_call, apdu);
 	}

Modified: team/group/ccss/pri_facility.h
URL: http://svnview.digium.com/svn/libpri/team/group/ccss/pri_facility.h?view=diff&rev=1394&r1=1393&r2=1394
==============================================================================
--- team/group/ccss/pri_facility.h (original)
+++ team/group/ccss/pri_facility.h Sat Dec 19 01:06:24 2009
@@ -108,10 +108,15 @@
 	APDU_CALLBACK_REASON_MSG_REJECT,
 };
 
-union apdu_msg_data {
-	const struct rose_msg_result *result;
-	const struct rose_msg_error *error;
-	const struct rose_msg_reject *reject;
+struct apdu_msg_data {
+	/*! Decoded response message contents. */
+	union {
+		const struct rose_msg_result *result;
+		const struct rose_msg_error *error;
+		const struct rose_msg_reject *reject;
+	} response;
+	/*! Q.931 message type the response came in with. */
+	int type;
 };
 
 union apdu_callback_param {
@@ -143,7 +148,7 @@
 	 *
 	 * \return TRUE if no more responses are expected.
 	 */
-	int (*callback)(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const union apdu_msg_data *msg);
+	int (*callback)(enum APDU_CALLBACK_REASON reason, struct pri *ctrl, struct q931_call *call, struct apdu_event *apdu, const struct apdu_msg_data *msg);
 	/*! \brief Sender data for the callback function to identify the particular APDU. */
 	union apdu_callback_param user;
 };




More information about the libpri-commits mailing list