[Asterisk-cvs] asterisk/channels chan_vpb.c,1.10,1.11

markster at lists.digium.com markster at lists.digium.com
Tue Nov 18 08:47:22 CST 2003


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv11587/channels

Modified Files:
	chan_vpb.c 
Log Message:
More VPB updates from Paul


Index: chan_vpb.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vpb.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- chan_vpb.c	13 Nov 2003 01:25:34 -0000	1.10
+++ chan_vpb.c	18 Nov 2003 15:13:38 -0000	1.11
@@ -97,10 +97,9 @@
 #define MODE_FXO	3
 
 
-static VPB_TONE Dialtone     = {440, 440, 440, -10,  -100, -100, 5000, 0   };
-static VPB_TONE Busytone     = {440,   0,   0, -10,  -100, -100,   500,  500};
-static VPB_TONE Ringbacktone = {440,   0,   0, -10,  -100, -100,  100, 100};
-
+static VPB_TONE Dialtone     = {440, 440, 440, 0,  0, 0, 5000, 0   };
+static VPB_TONE Busytone     = {440,   0,   0, 0,  -100, -100,   500, 500};
+static VPB_TONE Ringbacktone = {440,   0,   0, 0,  -100, -100,  100, 100};
 
 
 #define VPB_MAX_BRIDGES 128 
@@ -390,14 +389,21 @@
 	  break;
 
      case VPB_STATION_ONHOOK: /*, clear ext */
-	  vpb_tone_terminate(p->handle);
+           while (vpb_playtone_state(p->handle) != 0){
+                 vpb_tone_terminate(p->handle);
+                 vpb_sleep(10);
+             }
 	  p->wantdtmf = 1;
 	  p->ext[0] = 0;
 	  break;
 
      case VPB_DTMF:
 	  if (p->wantdtmf == 1) {
-	       vpb_tone_terminate(p->handle);
+           while (vpb_playtone_state(p->handle) != 0){
+                 vpb_tone_terminate(p->handle);
+                 vpb_sleep(10);
+             }
+
 	       p->wantdtmf = 0;
 	  }
 	  s[0] = e->data;
@@ -609,16 +615,32 @@
     switch(condition) {
 	case AST_CONTROL_BUSY:
 	case AST_CONTROL_CONGESTION:
+          while (vpb_playtone_state(p->handle) != 0){
+                res = vpb_tone_terminate(p->handle);
+                vpb_sleep(10);
+            }
 	    res = vpb_playtone_async(p->handle, &Busytone);
 	    break;
 	case AST_CONTROL_RINGING:
+          while (vpb_playtone_state(p->handle) != 0){
+                res = vpb_tone_terminate(p->handle);
+                vpb_sleep(10);
+            }
 	    res = vpb_playtone_async(p->handle, &Ringbacktone);
 	    break;	    
 	case AST_CONTROL_ANSWER:
 	case -1: /* -1 means stop playing? */
-	    res = vpb_tone_terminate(p->handle);
+           while (vpb_playtone_state(p->handle) != 0){
+                 res = vpb_tone_terminate(p->handle);
+                 vpb_sleep(10);
+	   }
+
 	    break;
 	case AST_CONTROL_HANGUP:
+          while (vpb_playtone_state(p->handle) != 0){
+                res = vpb_tone_terminate(p->handle);
+                vpb_sleep(10);
+            }
 	    res = vpb_playtone_async(p->handle, &Busytone);
 	    break;
 	    




More information about the svn-commits mailing list