[svn-commits] seanbright: trunk r147388 - in /trunk: apps/ channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Oct 7 16:34:44 CDT 2008


Author: seanbright
Date: Tue Oct  7 16:34:44 2008
New Revision: 147388

URL: http://svn.digium.com/view/asterisk?view=rev&rev=147388
Log:
Move the DAHDI-to-DAHDI operator mode check from app_dial into chan_dahdi
so we don't have to hardcode anything.

(closes issue #13636)
Reported by: seanbright
Patches:
      13636.diff uploaded by seanbright (license 71)
Reviewed by: russellb, putnopvut

Modified:
    trunk/apps/app_dial.c
    trunk/channels/chan_dahdi.c
    trunk/channels/chan_iax2.c

Modified: trunk/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_dial.c?view=diff&rev=147388&r1=147387&r2=147388
==============================================================================
--- trunk/apps/app_dial.c (original)
+++ trunk/apps/app_dial.c Tue Oct  7 16:34:44 2008
@@ -1926,11 +1926,7 @@
 				res = -1;
 				goto done;
 			}
-			if (opermode && !strncmp(chan->tech->type, "DAHDI", 5) && !strncmp(peer->name, "DAHDI", 5)) {
-				/* what's this special handling for dahdi <-> dahdi ?
-				 * A: dahdi to dahdi calls are natively bridged at the kernel driver
-				 * level, so we need to ensure that this mode gets propagated
-				 * all the way down. */
+			if (opermode) {
 				struct oprmode oprmode;
 
 				oprmode.peer = peer;

Modified: trunk/channels/chan_dahdi.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_dahdi.c?view=diff&rev=147388&r1=147387&r2=147388
==============================================================================
--- trunk/channels/chan_dahdi.c (original)
+++ trunk/channels/chan_dahdi.c Tue Oct  7 16:34:44 2008
@@ -3638,6 +3638,13 @@
 		break;
 	case AST_OPTION_OPRMODE:  /* Operator services mode */
 		oprmode = (struct oprmode *) data;
+		/* We don't support operator mode across technologies */
+		if (strcasecmp(chan->tech->type, oprmode->peer->tech->type)) {
+			ast_log(LOG_NOTICE, "Operator mode not supported on %s to %s calls.\n",
+					chan->tech->type, oprmode->peer->tech->type);
+			errno = EINVAL;
+			return -1;
+		}
 		pp = oprmode->peer->tech_pvt;
 		p->oprmode = pp->oprmode = 0;
 		/* setup peers */

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=147388&r1=147387&r2=147388
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Tue Oct  7 16:34:44 2008
@@ -3822,6 +3822,9 @@
 	case AST_OPTION_RXGAIN:
 		/* these two cannot be sent, because they require a result */
 		errno = ENOSYS;
+		return -1;
+	case AST_OPTION_OPRMODE:
+		errno = EINVAL;
 		return -1;
 	default:
 		if (!(h = ast_malloc(datalen + sizeof(*h))))




More information about the svn-commits mailing list