Changeset 8792
- Timestamp:
- 02/08/10 20:50:52 (3 years ago)
- Files:
-
- modules/branches/2.7/iaxsettings/functions.inc.php (modified) (3 diffs)
- modules/branches/2.7/iaxsettings/install.php (modified) (1 diff)
- modules/branches/2.7/iaxsettings/module.xml (modified) (2 diffs)
- modules/branches/2.7/iaxsettings/page.iaxsettings.php (modified) (10 diffs)
- modules/branches/2.7/sipsettings/functions.inc.php (modified) (3 diffs)
- modules/branches/2.7/sipsettings/install.php (modified) (1 diff)
- modules/branches/2.7/sipsettings/module.xml (modified) (2 diffs)
- modules/branches/2.7/sipsettings/page.sipsettings.php (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.7/iaxsettings/functions.inc.php
r8275 r8792 146 146 $core_conf->addIaxGeneral('disallow','all'); 147 147 foreach ($codecs as $codec => $enabled) { 148 if ($enabled == '1') {148 if ($enabled != '') { 149 149 $core_conf->addIaxGeneral('allow',$codec); 150 150 } … … 154 154 if ($interim_settings['videosupport'] == 'yes') { 155 155 foreach ($video_codecs as $codec => $enabled) { 156 if ($enabled == '1') {156 if ($enabled != '') { 157 157 $core_conf->addIaxGeneral('allow',$codec); 158 158 } … … 221 221 $iax_settings['codecs'] = array( 222 222 'ulaw' => '1', 223 'alaw' => ' 1',223 'alaw' => '2', 224 224 'slin' => '', 225 225 'g726' => '', 226 'gsm' => ' 1',226 'gsm' => '3', 227 227 'g729' => '', 228 228 'ilbc' => '', modules/branches/2.7/iaxsettings/install.php
r8668 r8792 56 56 $sip_settings = array( 57 57 array('ulaw' ,'1', '0'), 58 array('alaw' ,' 1', '1'),58 array('alaw' ,'2', '1'), 59 59 array('slin' ,'' , '2'), 60 60 array('g726' ,'' , '3'), 61 array('gsm' ,' 1', '4'),61 array('gsm' ,'3', '4'), 62 62 array('g729' ,'' , '5'), 63 63 array('ilbc' ,'' , '6'), modules/branches/2.7/iaxsettings/module.xml
r8282 r8792 2 2 <rawname>iaxsettings</rawname> 3 3 <name>Asterisk IAX Settings</name> 4 <version>2. 6.0.5</version>4 <version>2.7.0.0</version> 5 5 <publisher>Bandwidth.com</publisher> 6 6 <license>AGPLv3</license> … … 14 14 </description> 15 15 <changelog> 16 *2.7.0.0* #3976 allows codec priorities 16 17 *2.6.0.5* #3866 17 18 *2.6.0.4* localizations, misc modules/branches/2.7/iaxsettings/page.iaxsettings.php
r8250 r8792 46 46 $codecs[$codec] = isset($_POST[$codec]) ? $_POST[$codec] : ''; 47 47 } 48 uasort($codecs, 'cmp'); 48 49 $iax_settings['codecs'] = $codecs; 49 50 … … 57 58 $video_codecs[$codec] = isset($_POST[$codec]) ? $_POST[$codec] : ''; 58 59 } 60 uasort($video_codecs, 'cmp'); 59 61 $iax_settings['codecpriority'] = isset($_POST['codecpriority']) ? $_POST['codecpriority'] : 'host'; 60 62 $iax_settings['bandwidth'] = isset($_POST['bandwidth']) ? $_POST['bandwidth'] : 'unset'; … … 86 88 $p_idx++; 87 89 } 90 function cmp($a, $b) { 91 if ($a == $b) { 92 return 0; 93 } 94 if ($a == '') { 95 return 1; 96 } elseif ($b == '') { 97 return -1; 98 } else { 99 return ($a > $b) ? 1 : -1; 100 } 101 } 88 102 89 103 switch ($action) { … … 114 128 */ 115 129 $codecs = $iax_settings['codecs']; 130 unset($iax_settings['codecs']); 131 uasort($codecs, 'cmp'); 132 116 133 $video_codecs = $iax_settings['video_codecs']; 117 unset($iax_settings['codecs']);118 134 unset($iax_settings['video_codecs']); 135 uasort($video_codecs, 'cmp'); 119 136 120 137 /* EXTRACT THE VARIABLE HERE - MAKE SURE THEY ARE ALL MASSAGED ABOVE */ … … 152 169 </tr> 153 170 <tr> 154 <td valign='top'><a href="#" class="info"><?php echo _("Codecs")?><span><?php echo _("Check the desired codecs, all others will be disabled unless explicitly enabled in a device or trunks configuration.") ?></span></a></td>171 <td valign='top'><a href="#" class="info"><?php echo _("Codecs")?><span><?php echo _("Check the desired codecs, all others will be disabled unless explicitly enabled in a device or trunks configuration.")._(" If you clear each codec and then add them one at a time, submitting with each addition, they will be added in order which will effect the codec priority.")?></span></a></td> 155 172 <td> 156 173 <table width="100%"> … … 158 175 <?php 159 176 $cols = $cols_per_row; 177 $seq = 1; 160 178 foreach ($codecs as $codec => $codec_state) { 161 179 if ($cols == 0) { … … 169 187 echo <<< END 170 188 <td width="$width%"> 171 <input type="checkbox" value=" 1" name="$codec" id="$codec" class="audio-codecs" tabindex="$tabindex" $codec_checked />189 <input type="checkbox" value="$seq" name="$codec" id="$codec" class="audio-codecs" tabindex="$tabindex" $codec_checked /> 172 190 <label for="$codec"> <small>$codec_trans</small> </label> 173 191 </td> 174 192 END; 193 $seq++; 175 194 } 176 195 ?> … … 242 261 <tr> 243 262 <td> 244 <a href="#" class="info"><?php echo _("Video Support")?><span><?php echo _("Check to enable and then choose allowed codecs.") ?></span></a>263 <a href="#" class="info"><?php echo _("Video Support")?><span><?php echo _("Check to enable and then choose allowed codecs.")._(" If you clear each codec and then add them one at a time, submitting with each addition, they will be added in order which will effect the codec priority.")?></span></a> 245 264 </td> 246 265 <td> … … 267 286 <?php 268 287 $cols = $cols_per_row; 288 $seq = 1; 269 289 foreach ($video_codecs as $codec => $codec_state) { 270 290 if ($cols == 0) { … … 278 298 echo <<< END 279 299 <td width="$width%"> 280 <input type="checkbox" value=" 1" name="$codec" id="$codec" class="video-codecs" tabindex="$tabindex" $codec_checked />300 <input type="checkbox" value="$seq" name="$codec" id="$codec" class="video-codecs" tabindex="$tabindex" $codec_checked /> 281 301 <label for="$codec"><small> $codec_trans </small></label> 282 302 </td> 283 303 END; 304 $seq++; 284 305 } 285 306 ?> modules/branches/2.7/sipsettings/functions.inc.php
r8275 r8792 147 147 $core_conf->addSipGeneral('disallow','all'); 148 148 foreach ($codecs as $codec => $enabled) { 149 if ($enabled == '1') {149 if ($enabled != '') { 150 150 $core_conf->addSipGeneral('allow',$codec); 151 151 } … … 155 155 if ($interim_settings['videosupport'] == 'yes') { 156 156 foreach ($video_codecs as $codec => $enabled) { 157 if ($enabled == '1') {157 if ($enabled != '') { 158 158 $core_conf->addSipGeneral('allow',$codec); 159 159 } … … 255 255 $sip_settings['codecs'] = array( 256 256 'ulaw' => '1', 257 'alaw' => ' 1',257 'alaw' => '2', 258 258 'slin' => '', 259 259 'g726' => '', 260 'gsm' => ' 1',260 'gsm' => '3', 261 261 'g729' => '', 262 262 'ilbc' => '', modules/branches/2.7/sipsettings/install.php
r8243 r8792 56 56 $sip_settings = array( 57 57 array('ulaw' ,'1', '0'), 58 array('alaw' ,' 1', '1'),58 array('alaw' ,'2', '1'), 59 59 array('slin' ,'' , '2'), 60 60 array('g726' ,'' , '3'), 61 array('gsm' ,' 1', '4'),61 array('gsm' ,'3', '4'), 62 62 array('g729' ,'' , '5'), 63 63 array('ilbc' ,'' , '6'), modules/branches/2.7/sipsettings/module.xml
r8285 r8792 2 2 <rawname>sipsettings</rawname> 3 3 <name>Asterisk SIP Settings</name> 4 <version>2. 6.0.7</version>4 <version>2.7.0.0</version> 5 5 <publisher>Bandwidth.com</publisher> 6 6 <license>AGPLv3</license> … … 14 14 </description> 15 15 <changelog> 16 *2.7.0.0* #3976 allows codec priorities 16 17 *2.6.0.7* #3866 17 18 *2.6.0.6* #3722, localizations modules/branches/2.7/sipsettings/page.sipsettings.php
r8244 r8792 43 43 } 44 44 $p_idx++; 45 } 46 function cmp($a, $b) { 47 if ($a == $b) { 48 return 0; 49 } 50 if ($a == '') { 51 return 1; 52 } elseif ($b == '') { 53 return -1; 54 } else { 55 return ($a > $b) ? 1 : -1; 56 } 45 57 } 46 58 … … 63 75 $codecs[$codec] = isset($_POST[$codec]) ? $_POST[$codec] : ''; 64 76 } 77 uasort($codecs, 'cmp'); 65 78 $sip_settings['codecs'] = $codecs; 66 79 $sip_settings['g726nonstandard'] = isset($_POST['g726nonstandard']) ? $_POST['g726nonstandard'] : 'no'; … … 76 89 $video_codecs[$codec] = isset($_POST[$codec]) ? $_POST[$codec] : ''; 77 90 } 91 uasort($video_codecs, 'cmp'); 78 92 $sip_settings['video_codecs'] = $video_codecs; 79 93 $sip_settings['videosupport'] = isset($_POST['videosupport']) ? $_POST['videosupport'] : 'no'; … … 147 161 */ 148 162 $codecs = $sip_settings['codecs']; 163 unset($sip_settings['codecs']); 164 uasort($codecs, 'cmp'); 165 149 166 $video_codecs = $sip_settings['video_codecs']; 150 unset($sip_settings['codecs']);151 167 unset($sip_settings['video_codecs']); 168 uasort($video_codecs, 'cmp'); 152 169 153 170 /* EXTRACT THE VARIABLE HERE - MAKE SURE THEY ARE ALL MASSAGED ABOVE */ … … 300 317 </tr> 301 318 <tr> 302 <td valign='top'><a href="#" class="info"><?php echo _("Codecs")?><span><?php echo _("Check the desired codecs, all others will be disabled unless explicitly enabled in a device or trunks configuration.") ?></span></a></td>319 <td valign='top'><a href="#" class="info"><?php echo _("Codecs")?><span><?php echo _("Check the desired codecs, all others will be disabled unless explicitly enabled in a device or trunks configuration.")._(" If you clear each codec and then add them one at a time, submitting with each addition, they will be added in order which will effect the codec priority.")?></span></a></td> 303 320 <td> 304 321 <table width="100%"> … … 306 323 <?php 307 324 $cols = $cols_per_row; 325 $seq = 1; 308 326 foreach ($codecs as $codec => $codec_state) { 309 327 if ($cols == 0) { … … 317 335 echo <<< END 318 336 <td width="$width%"> 319 <input type="checkbox" value=" 1" name="$codec" id="$codec" class="audio-codecs" tabindex="$tabindex" $codec_checked />337 <input type="checkbox" value="$seq" name="$codec" id="$codec" class="audio-codecs" tabindex="$tabindex" $codec_checked /> 320 338 <label for="$codec"> <small>$codec_trans</small> </label> 321 339 </td> 322 340 END; 341 $seq++; 323 342 } 324 343 ?> … … 376 395 <tr> 377 396 <td> 378 <a href="#" class="info"><?php echo _("Video Support")?><span><?php echo _("Check to enable and then choose allowed codecs.") ?></span></a>397 <a href="#" class="info"><?php echo _("Video Support")?><span><?php echo _("Check to enable and then choose allowed codecs.")._(" If you clear each codec and then add them one at a time, submitting with each addition, they will be added in order which will effect the codec priority.")?></span></a> 379 398 </td> 380 399 <td> … … 401 420 <?php 402 421 $cols = $cols_per_row; 422 $seq = 1; 403 423 foreach ($video_codecs as $codec => $codec_state) { 404 424 if ($cols == 0) { … … 412 432 echo <<< END 413 433 <td width="$width%"> 414 <input type="checkbox" value=" 1" name="$codec" id="$codec" class="video-codecs" tabindex="$tabindex" $codec_checked />434 <input type="checkbox" value="$seq" name="$codec" id="$codec" class="video-codecs" tabindex="$tabindex" $codec_checked /> 415 435 <label for="$codec"><small> $codec_trans </small></label> 416 436 </td> 417 437 END; 438 $seq++; 418 439 } 419 440 ?>
