From 6cb01561ebb15029b4be2d18ffc2a84872d2a79a Mon Sep 17 00:00:00 2001 From: Richard Mudgett Date: Mon, 19 Oct 2009 22:49:59 +0000 Subject: [PATCH] Fix call state ie transmission. Sending a STATUS message failed to include the call state ie for some reason. We will now always send a call state ie when a message ie list includes one. git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@1220 2fbb986a-6c06-0410-b554-c9c1f0a7f128 --- q931.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/q931.c b/q931.c index 4c19dc7..e10c3de 100644 --- a/q931.c +++ b/q931.c @@ -2120,11 +2120,34 @@ static int transmit_progress_indicator(int full_ie, struct pri *ctrl, q931_call } static int transmit_call_state(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len, int order) { - if (call->ourcallstate > -1 ) { + ie->data[0] = Q931_CALL_STATE_NULL; + switch (call->ourcallstate) { + case Q931_CALL_STATE_NULL: + case Q931_CALL_STATE_CALL_INITIATED: + case Q931_CALL_STATE_OVERLAP_SENDING: + case Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING: + case Q931_CALL_STATE_CALL_DELIVERED: + case Q931_CALL_STATE_CALL_PRESENT: + case Q931_CALL_STATE_CALL_RECEIVED: + case Q931_CALL_STATE_CONNECT_REQUEST: + case Q931_CALL_STATE_INCOMING_CALL_PROCEEDING: + case Q931_CALL_STATE_ACTIVE: + case Q931_CALL_STATE_DISCONNECT_REQUEST: + case Q931_CALL_STATE_DISCONNECT_INDICATION: + case Q931_CALL_STATE_SUSPEND_REQUEST: + case Q931_CALL_STATE_RESUME_REQUEST: + case Q931_CALL_STATE_RELEASE_REQUEST: + case Q931_CALL_STATE_CALL_ABORT: + case Q931_CALL_STATE_OVERLAP_RECEIVING: + case Q931_CALL_STATE_CALL_INDEPENDENT_SERVICE: + case Q931_CALL_STATE_RESTART_REQUEST: + case Q931_CALL_STATE_RESTART: ie->data[0] = call->ourcallstate; - return 3; + break; + case Q931_CALL_STATE_NOT_SET: + break; } - return 0; + return 3; } static int receive_call_state(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)