[svn-commits] dvossel: branch dvossel/aoc_send r1575 - /team/dvossel/aoc_send/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Apr 8 16:18:08 CDT 2010


Author: dvossel
Date: Thu Apr  8 16:18:06 2010
New Revision: 1575

URL: http://svnview.digium.com/svn/libpri?view=rev&rev=1575
Log:
send AOC-E only on disconnect or release

Modified:
    team/dvossel/aoc_send/libpri.h
    team/dvossel/aoc_send/pri_aoc.c

Modified: team/dvossel/aoc_send/libpri.h
URL: http://svnview.digium.com/svn/libpri/team/dvossel/aoc_send/libpri.h?view=diff&rev=1575&r1=1574&r2=1575
==============================================================================
--- team/dvossel/aoc_send/libpri.h (original)
+++ team/dvossel/aoc_send/libpri.h Thu Apr  8 16:18:06 2010
@@ -1536,8 +1536,8 @@
 /* Send AOC-D message */
 int pri_aoc_d_send(struct pri *ctrl, q931_call *c, const struct pri_subcmd_aoc_d *aoc_d);
 
-/* Send AOC-E message */
-int pri_aoc_e_send(struct pri *ctrl, q931_call *c, const struct pri_subcmd_aoc_e *aoc_e);
+/* Send AOC-E message. set on_release to queue on Q931 Release msg, other wise it is queued on Q931 Disconnect */
+int pri_aoc_e_send(struct pri *ctrl, q931_call *c, const struct pri_subcmd_aoc_e *aoc_e, int on_release);
 
 #define PRI_GR303_SUPPORT
 #define PRI_ENSLAVE_SUPPORT

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=1575&r1=1574&r2=1575
==============================================================================
--- team/dvossel/aoc_send/pri_aoc.c (original)
+++ team/dvossel/aoc_send/pri_aoc.c Thu Apr  8 16:18:06 2010
@@ -1483,7 +1483,7 @@
  * \retval 0 on success.
  * \retval -1 on error.
  */
-static int aoc_aoce_encode(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_e *aoc_e)
+static int aoc_aoce_encode(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_e *aoc_e, int msgtype)
 {
 	unsigned char buffer[255];
 	unsigned char *end = 0;
@@ -1504,10 +1504,7 @@
 		return -1;
 	}
 
-	/* Remember that if we queue a facility IE for a facility message we
-	 * have to explicitly send the facility message ourselves */
-	if (pri_call_apdu_queue(call, Q931_FACILITY, buffer, end - buffer, NULL)
-		|| q931_facility(call->pri, call)) {
+	if (pri_call_apdu_queue(call, msgtype, buffer, end - buffer, NULL)) {
 		pri_message(ctrl, "Could not schedule aoc-e facility message for call %d\n", call->cr);
 		return -1;
 	}
@@ -1598,7 +1595,7 @@
 	return 0;
 }
 
-int pri_aoc_e_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_e *aoc_e)
+int pri_aoc_e_send(struct pri *ctrl, q931_call *call, const struct pri_subcmd_aoc_e *aoc_e, int on_release)
 {
 	if (!ctrl || !call)
 		return -1;
@@ -1606,7 +1603,7 @@
 	switch (ctrl->switchtype) {
 	case PRI_SWITCH_EUROISDN_E1:
 	case PRI_SWITCH_EUROISDN_T1:
-		return aoc_aoce_encode(ctrl, call, aoc_e);
+		return aoc_aoce_encode(ctrl, call, aoc_e, on_release ? Q931_RELEASE : Q931_DISCONNECT);
 	case PRI_SWITCH_QSIG:
 		break;
 	default:




More information about the svn-commits mailing list