Changeset 7783
- Timestamp:
- 05/31/09 12:31:28 (3 years ago)
- Files:
-
- modules/branches/2.6/core/functions.inc.php (modified) (5 diffs)
- modules/branches/2.6/core/module.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.6/core/functions.inc.php
r7759 r7783 247 247 unset($results2_pre); 248 248 249 $context=''; 249 250 foreach ($results2 as $result2) { 250 $option = $result2['data'];251 $option = strtolower($result2['data']); 251 252 if ($ver12) { 252 $output .= $result2['keyword']."=$option\n"; 253 switch (strtolower($result2['keyword'])) { 254 case 'context': 255 $context = $option; 256 //fall-through 257 default: 258 $output .= $result2['keyword']."=".$result2['data']."\n"; 259 } 253 260 } else { 254 261 switch (strtolower($result2['keyword'])) { … … 259 266 $output .= "insecure=port\n"; 260 267 else 261 $output .= $result2['keyword']."= $option\n";268 $output .= $result2['keyword']."=".$result2['data']."\n"; 262 269 break; 263 270 case 'allow': 264 271 case 'disallow': 265 272 if ($option != '') 266 $output .= $result2['keyword']."= $option\n";273 $output .= $result2['keyword']."=".$result2['data']."\n"; 267 274 break; 268 275 case 'record_in': 269 276 case 'record_out': 270 277 break; 278 case 'context': 279 $context = $result2['data']; 280 //fall-through 271 281 default: 272 $output .= $result2['keyword']."= $option\n";282 $output .= $result2['keyword']."=".$result2['data']."\n"; 273 283 } 274 284 } 275 285 } 276 if ($call_limit && (!preg_match('/^tr-peer-*|^tr-user-*|^tr-reg-*/',$id))) { 277 $output .= $call_limit; 286 switch (substr($id,0,8)) { 287 case 'tr-peer-': 288 if ($context == '') { 289 $output .= "context=from-trunk-sip-$account\n"; 290 } 291 break; 292 case 'tr-user-': 293 if ($context == '') { 294 $tn = substr($id, 8); 295 // this is a 'user' trunk, we need to get the name of the corresponding 'peer' 296 // trunk so we can set the context appropriately for the group count 297 // 298 $td = core_trunks_getDetails($tn); 299 if (isset($td['channelid'])) { 300 $output .= "context=from-trunk-sip-".$td['channelid']."\n"; 301 } 302 } 303 break; 304 default: 305 if ($call_limit) { 306 $output .= $call_limit; 307 } 278 308 } 279 309 $output .= $additional."\n"; … … 375 405 unset($results2_pre); 376 406 407 $context=''; 377 408 foreach ($results2 as $result2) { 378 $option = $result2['data'];409 $option = strtolower($result2['data']); 379 410 if ($ver12) { 380 $output .= $result2['keyword']."=$option\n"; 411 switch (strtolower($result2['keyword'])) { 412 case 'context': 413 $context = $result2['data']; 414 //fall-through 415 default: 416 $output .= $result2['keyword']."=".$result2['data']."\n"; 417 } 381 418 } else { 382 419 switch ($result2['keyword']) { … … 389 426 $output .= "transfer=mediaonly\n"; 390 427 } else { 391 $output .= $result2['keyword']."= $option\n";428 $output .= $result2['keyword']."=".$result2['data']."\n"; 392 429 } 393 430 break; … … 395 432 case 'disallow': 396 433 if ($option != '') 397 $output .= $result2['keyword']."= $option\n";434 $output .= $result2['keyword']."=".$result2['data']."\n"; 398 435 break; 399 436 case 'record_in': 400 437 case 'record_out': 401 438 break; 439 case 'context': 440 $context = $option; 441 //fall-through 402 442 default: 403 $output .= $result2['keyword']."= $option\n";443 $output .= $result2['keyword']."=".$result2['data']."\n"; 404 444 } 405 445 } 446 } 447 switch (substr($id,0,8)) { 448 case 'tr-peer-': 449 if ($context == '') { 450 $output .= "context=from-trunk-iax2-$account\n"; 451 } 452 break; 453 case 'tr-user-': 454 if ($context == '') { 455 $tn = substr($id, 8); 456 // this is a 'user' trunk, we need to get the name of the corresponding 'peer' 457 // trunk so we can set the context appropriately for the group count 458 // 459 $td = core_trunks_getDetails($tn); 460 if (isset($td['channelid'])) { 461 $output .= "context=from-trunk-iax2-".$td['channelid']."\n"; 462 } 463 } 464 break; 465 default: 466 if ($call_limit) { 467 $output .= $call_limit; 468 } 406 469 } 407 470 $output .= $additional."\n"; modules/branches/2.6/core/module.xml
r7760 r7783 8 8 <canuninstall>no</canuninstall> 9 9 <changelog> 10 *2.6.0beta1.1* #3696 (needs framework updated)10 *2.6.0beta1.1* #3696, (needs framework updated), #3702 11 11 *2.6.0beta1.0* #3478, #3423, #3648, #3685, #3686, #1380 12 12 *2.6.0alpha1.4* fixes re #3649
