[svn-commits] rmudgett: branch rmudgett/mcid r1560 - /team/rmudgett/mcid/pri_facility.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Mar 18 15:24:27 CDT 2010


Author: rmudgett
Date: Thu Mar 18 15:24:23 2010
New Revision: 1560

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1560
Log:
Fix rejected MCID after DISCONNECT.

Modified:
    team/rmudgett/mcid/pri_facility.c

Modified: team/rmudgett/mcid/pri_facility.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/mcid/pri_facility.c?view=diff&rev=1560&r1=1559&r2=1560
==============================================================================
--- team/rmudgett/mcid/pri_facility.c (original)
+++ team/rmudgett/mcid/pri_facility.c Thu Mar 18 15:24:23 2010
@@ -4536,24 +4536,28 @@
 				ROSE_ERROR_Gen_NotIncomingCall);
 			break;
 		}
-		if (call->ourcallstate != Q931_CALL_STATE_ACTIVE
-			&& call->ourcallstate != Q931_CALL_STATE_DISCONNECT_INDICATION) {
+		switch (call->ourcallstate) {
+		case Q931_CALL_STATE_ACTIVE:
+		case Q931_CALL_STATE_DISCONNECT_INDICATION:
+		case Q931_CALL_STATE_DISCONNECT_REQUEST:/* XXX We are really in the wrong state for this mode. */
+			subcmd = q931_alloc_subcommand(ctrl);
+			if (!subcmd) {
+				send_facility_error(ctrl, call, invoke->invoke_id,
+					ROSE_ERROR_Gen_NotAvailable);
+				break;
+			}
+
+			subcmd->cmd = PRI_SUBCMD_MCID_REQ;
+			q931_party_id_copy_to_pri(&subcmd->u.mcid_req.originator, &call->local_id);
+			q931_party_id_copy_to_pri(&subcmd->u.mcid_req.answerer, &call->remote_id);
+
+			send_facility_result_ok(ctrl, call, invoke->invoke_id);
+			break;
+		default:
 			send_facility_error(ctrl, call, invoke->invoke_id,
 				ROSE_ERROR_Gen_InvalidCallState);
 			break;
 		}
-		subcmd = q931_alloc_subcommand(ctrl);
-		if (!subcmd) {
-			send_facility_error(ctrl, call, invoke->invoke_id,
-				ROSE_ERROR_Gen_NotAvailable);
-			break;
-		}
-
-		subcmd->cmd = PRI_SUBCMD_MCID_REQ;
-		q931_party_id_copy_to_pri(&subcmd->u.mcid_req.originator, &call->local_id);
-		q931_party_id_copy_to_pri(&subcmd->u.mcid_req.answerer, &call->remote_id);
-
-		send_facility_result_ok(ctrl, call, invoke->invoke_id);
 		break;
 	case ROSE_QSIG_CallingName:
 		/* CallingName is put in remote_id.name */




More information about the svn-commits mailing list