summaryrefslogtreecommitdiff
path: root/packages/mgetty/mgetty-1.1.30/50-pending-voice-zoom-2949l-c
blob: 1edfe3fd65d90f0b17211200bc80979f451de1fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
--- mgetty-1.1.30.orig/voice/libvoice/Lucent.c	2001-04-13 04:01:44.000000000 -0700
+++ mgetty-1.1.30/voice/libvoice/Lucent.c	2003-09-07 14:58:41.000000000 -0700
@@ -66,6 +66,7 @@
 
 static int Lucent_set_compression (int *compression, int *speed, int *bits)
      {
+     char buffer[VOICE_BUF_LEN];
      reset_watchdog();
 
      if (*compression == 0)
@@ -86,7 +87,8 @@
 			  return(FAIL); 
 		 }
 
-               if (voice_command("AT+VSM=128", "OK") != VMA_USER_1)
+	       sprintf(buffer, "AT+VSM=128,%d", *speed);
+               if (voice_command(buffer, "OK") != VMA_USER_1)
                     return(FAIL);
 
                break;
@@ -100,8 +102,8 @@
 			  return(FAIL); 
 		 }
 	       
-
-               if (voice_command("AT+VSM=129", "OK") != VMA_USER_1)
+	       sprintf(buffer, "AT+VSM=129,%d", *speed);
+               if (voice_command(buffer, "OK") != VMA_USER_1)
                     return(FAIL);
 
                break;
@@ -115,8 +117,8 @@
 			  return(FAIL); 
 		 }
 
-
-               if (voice_command("AT+VSM=130,8000", "OK") != VMA_USER_1)
+	       sprintf(buffer, "AT+VSM=130,%d", *speed);
+               if (voice_command(buffer, "OK") != VMA_USER_1)
                     return(FAIL);
 
                break;
@@ -130,24 +132,27 @@
 				  voice_modem_name, *speed);
 		return(FAIL); 
 	      }
-               if (voice_command("AT+VSM=131,8000", "OK") != VMA_USER_1)
-                    return(FAIL);
-
-               break;
+	    sprintf(buffer, "AT+VSM=131,%d", *speed);
+	    if (voice_command(buffer, "OK") != VMA_USER_1)
+	      return(FAIL);
+	    
+	    break;
 
 	  case 5:
 	    *bits = 4;
 
-	    if ( *speed != 8000 )
+	    if ((*speed != 8000) && (*speed != 7200) && (*speed != 11025))
 	      {
 		lprintf(L_WARN, "%s: Illegal sample rate (%d)", 
 				  voice_modem_name, *speed);
 		return(FAIL); 
 	      }
-               if (voice_command("AT+VSM=132,8000", "OK") != VMA_USER_1)
-                    return(FAIL);
 
-               break;
+	    sprintf(buffer, "AT+VSM=132,%d", *speed);
+	    if (voice_command(buffer, "OK") != VMA_USER_1)
+	      return(FAIL);
+	    
+	    break;
 
           default:
                lprintf(L_WARN, "%s: Illegal voice compression method (%d)",
--- mgetty-1.1.30.orig/voice/pvftools/pvftormd.c	2002-11-19 07:39:34.000000000 -0800
+++ mgetty-1.1.30/voice/pvftools/pvftormd.c	2003-09-07 14:11:26.000000000 -0700
@@ -535,12 +535,13 @@
           {
           header_out.bits = 4;
 
-          if (header_in.speed != 8000) 
+	  if ((header_in.speed != 7200)  && (header_in.speed != 8000) &&
+	      (header_in.speed != 11025))
              {
                 fprintf(stderr, "%s: Unsupported sample speed (%d)\n",
                  program_name, header_in.speed);
                 fprintf(stderr,
-                 "%s: The Lucent only supports 8000 samples/second\n",
+		 "%s: The Lucent only supports 7.2k, 8k and 11.025k samples/second\n",
                  program_name);
                 fclose(fd_out);

--- mgetty-1.1.30.orig/voice/libvoice/V253modem.c	2002-11-25 13:14:51.000000000 -0800
+++ mgetty-1.1.30/voice/libvoice/V253modem.c	2003-09-11 08:40:51.000000000 -0700
@@ -177,26 +177,26 @@
        case 2:       /*  2bit ADPCM for some ELSA-modems */
        {
          *bits = 2;
-         if (voice_command("AT+VSM=140,7200", "OK")!= VMA_USER_1)
-         {
+	 sprintf(buffer, "AT+VSM=140,%d", *speed);
+	 if (voice_command(buffer, "OK") != VMA_USER_1)
+	 {
          /* there are two diffrent implementations trying one first,
             if this fails we try the other one later */
-           Kompressionmethod = 129;
-         }
-         else
-         {
-           Kompressionmethod = 140;
-         }
-         *speed=7200;
+	   Kompressionmethod = 129;
+	 }
+	 else
+	 {
+	   Kompressionmethod = 140;
+	 }
          break;
         }
        case 4:           /* 4bit ADPCM for some ELSA-modems */
        {
-         if (voice_command("AT+VSM=141,7200", "OK")!= VMA_USER_1)
+	 sprintf(buffer, "AT+VSM=141,%d", *speed);
+         if (voice_command(buffer, "OK")!= VMA_USER_1)
          {
          /* there are two diffrent implementations trying one first,
             if this fails we try the other one later */
-
            Kompressionmethod = 131;
          }
          else
@@ -204,7 +204,6 @@
            Kompressionmethod = 141;
          }
          *bits=4;
-         *speed=7200;
          break;
        }
        case 5: