Update of /usr/cvsroot/zaptel
In directory mongoose.digium.com:/tmp/cvs-serv8688

Modified Files:
        zaptel.c 
Log Message:
allow ZT_GETPARAMS to return the master channel number for a channel


Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- zaptel.c    26 Sep 2005 23:30:24 -0000      1.118
+++ zaptel.c    29 Sep 2005 01:19:59 -0000      1.119
@@ -2754,10 +2754,18 @@
        unsigned long flags;
 #endif 
        int i,j;
+       int return_master = 0;
 
        switch(cmd) {
        case ZT_GET_PARAMS: /* get channel timing parameters */
                copy_from_user(&stack.param,(struct zt_params 
*)data,sizeof(stack.param));
+
+               /* check to see if the caller wants to receive our master 
channel number */
+               if (stack.param.channo & 0x40000000) {
+                       return_master = 1;
+                       stack.param.channo &= ~0x40000000;
+               }
+
                /* Pick the right channo's */
                if (!stack.param.channo || unit) {
                        stack.param.channo = unit;
@@ -2766,7 +2774,11 @@
                VALID_CHANNEL(stack.param.channo);
                chan = chans[stack.param.channo];
 
-                 /* point to relevant structure */
+               /* if requested, put the master channel number in the top 16 
bits of the result */
+               if (return_master)
+                       stack.param.channo |= chan->master->channo << 16;
+
+               /* point to relevant structure */
                stack.param.sigtype = chan->sig;  /* get signalling type */
                /* return non-zero if rx not in idle state */
                if (chan->span) {

_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs

Reply via email to