[libpri-commits] rmudgett: branch group/ccss r1026 - in /team/group/ccss: ./ q931.c

SVN commits to the libpri project libpri-commits at lists.digium.com
Tue Aug 25 13:08:23 CDT 2009


Author: rmudgett
Date: Tue Aug 25 13:08:19 2009
New Revision: 1026

URL: http://svn.asterisk.org/svn-view/libpri?view=rev&rev=1026
Log:
Merged revisions 1018-1019 via svnmerge from 
https://origsvn.digium.com/svn/libpri/branches/1.4

........
  r1018 | rmudgett | 2009-08-25 11:49:07 -0500 (Tue, 25 Aug 2009) | 1 line
  
  Fix ie ordering in some ie lists for send_message().
........
  r1019 | rmudgett | 2009-08-25 11:50:56 -0500 (Tue, 25 Aug 2009) | 1 line
  
  Put connected name in display ie for CONNECT message.
........

Modified:
    team/group/ccss/   (props changed)
    team/group/ccss/q931.c

Propchange: team/group/ccss/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/ccss/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Aug 25 13:08:19 2009
@@ -1,1 +1,1 @@
-/branches/1.4:1-1012
+/branches/1.4:1-1025

Modified: team/group/ccss/q931.c
URL: http://svn.asterisk.org/svn-view/libpri/team/group/ccss/q931.c?view=diff&rev=1026&r1=1025&r2=1026
==============================================================================
--- team/group/ccss/q931.c (original)
+++ team/group/ccss/q931.c Tue Aug 25 13:08:19 2009
@@ -1882,6 +1882,18 @@
 static int receive_display(int full_ie, struct pri *ctrl, q931_call *call, int msgtype, q931_ie *ie, int len)
 {
 	unsigned char *data;
+
+	switch (msgtype) {
+	case Q931_SETUP:
+	case Q931_CONNECT:
+		/*
+		 * Only keep the display message on SETUP and CONNECT messages
+		 * as the remote name.
+		 */
+		break;
+	default:
+		return 0;
+	}
 
 	call->remote_id.name.valid = 1;
 
@@ -3353,6 +3365,21 @@
 	return 0;
 }
 
+/*!
+ * \internal
+ * \brief Build and send the requested message.
+ *
+ * \param ctrl D channel controller.
+ * \param call Q.931 call leg
+ * \param msgtype Q.931 message type to build.
+ * \param ies List of ie's to put in the message.
+ *
+ * \note The ie's in the ie list must be in numerical order.
+ * See Q.931 section 4.5.1 coding rules.
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
 static int send_message(struct pri *ctrl, q931_call *call, int msgtype, int ies[])
 {
 	unsigned char buf[1024];
@@ -3540,7 +3567,7 @@
 #ifdef ALERTING_NO_PROGRESS
 static int call_progress_ies[] = { -1 };
 #else
-static int call_progress_with_cause_ies[] = { Q931_PROGRESS_INDICATOR, Q931_CAUSE, -1 };
+static int call_progress_with_cause_ies[] = { Q931_CAUSE, Q931_PROGRESS_INDICATOR, -1 };
 
 static int call_progress_ies[] = { Q931_PROGRESS_INDICATOR, -1 };
 #endif
@@ -3621,7 +3648,7 @@
 	return send_message(ctrl, c, Q931_CALL_PROCEEDING, call_proceeding_ies);
 }
 #ifndef ALERTING_NO_PROGRESS
-static int alerting_ies[] = { Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, Q931_IE_FACILITY, -1 };
+static int alerting_ies[] = { Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_IE_USER_USER, -1 };
 #else
 static int alerting_ies[] = { Q931_IE_FACILITY, -1 };
 #endif
@@ -3654,7 +3681,7 @@
 	return send_message(ctrl, c, Q931_ALERTING, alerting_ies);
 }
 
-static int connect_ies[] = {  Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, Q931_IE_CONNECTED_NUM, Q931_IE_FACILITY, -1 };
+static int setup_ack_ies[] = { Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_IE_CONNECTED_NUM, -1 };
  
 int q931_setup_ack(struct pri *ctrl, q931_call *c, int channel, int nonisdn)
 {
@@ -3674,7 +3701,7 @@
 	UPDATE_OURCALLSTATE(ctrl, c, Q931_CALL_STATE_OVERLAP_RECEIVING);
 	c->peercallstate = Q931_CALL_STATE_OVERLAP_SENDING;
 	c->alive = 1;
-	return send_message(ctrl, c, Q931_SETUP_ACKNOWLEDGE, connect_ies);
+	return send_message(ctrl, c, Q931_SETUP_ACKNOWLEDGE, setup_ack_ies);
 }
 
 /* T313 expiry, first time */
@@ -3747,6 +3774,8 @@
 	/* normal clear cause */
 	q931_hangup(ctrl, c, cause);
 }
+
+static int connect_ies[] = { Q931_CHANNEL_IDENT, Q931_IE_FACILITY, Q931_PROGRESS_INDICATOR, Q931_DISPLAY, Q931_IE_CONNECTED_NUM, -1 };
 
 int q931_connect(struct pri *ctrl, q931_call *c, int channel, int nonisdn)
 {
@@ -3801,7 +3830,7 @@
 	return send_message(ctrl, c, Q931_CONNECT, connect_ies);
 }
 
-static int release_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, Q931_IE_FACILITY, -1 };
+static int release_ies[] = { Q931_CAUSE, Q931_IE_FACILITY, Q931_IE_USER_USER, -1 };
 
 int q931_release(struct pri *ctrl, q931_call *c, int cause)
 {
@@ -3849,7 +3878,7 @@
 	return send_message(ctrl, c, Q931_RESTART, restart_ies);
 }
 
-static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_USER_USER, Q931_IE_FACILITY, -1 };
+static int disconnect_ies[] = { Q931_CAUSE, Q931_IE_FACILITY, Q931_IE_USER_USER, -1 };
 
 int q931_disconnect(struct pri *ctrl, q931_call *c, int cause)
 {
@@ -3964,7 +3993,7 @@
 	
 }
 
-static int release_complete_ies[] = { Q931_IE_USER_USER, Q931_IE_FACILITY, -1 };
+static int release_complete_ies[] = { Q931_IE_FACILITY, Q931_IE_USER_USER, -1 };
 
 static int q931_release_complete(struct pri *ctrl, q931_call *c, int cause)
 {




More information about the libpri-commits mailing list