Changeset 5091

Show
Ignore:
Timestamp:
10/02/07 16:25:00 (1 year ago)
Author:
p_lindheimer
Message:

Merged revisions 5090 via svnmerge from
http://svn.freepbx.org/modules/branches/2.4

........

r5090 | p_lindheimer | 2007-10-02 16:22:26 -0700 (Tue, 02 Oct 2007) | 1 line


add pre-dial-hook to macro-dialout-trunk and create from-trunk context to use for inbound calls to count towards trunk max

........

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.3

    • Property svnmerge-integrated changed from /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702,3706,3710,3716,3758,3760,3762-3765,3767-3785,3787-3789,3801,3810,3828,3831,3839,3860,3866,3875,3877,3887,3899,3911,3913,3943,3982-3983,3990,3998,4007,4022-4023,4089,4092,4098,4265,4285 /modules/branches/2.4:1-5079 to /modules/branches/2.2:1-3588,3615-3635,3637-3638,3640,3674,3680,3686,3692,3702,3706,3710,3716,3758,3760,3762-3765,3767-3785,3787-3789,3801,3810,3828,3831,3839,3860,3866,3875,3877,3887,3899,3911,3913,3943,3982-3983,3990,3998,4007,4022-4023,4089,4092,4098,4265,4285 /modules/branches/2.4:1-5079,5090
  • modules/branches/2.3/core/etc/extensions.conf

    r4905 r5091  
    635635exten => s,105,Macro(outisbusy) 
    636636 
     637[macro-dialout-trunk-predial-hook] 
     638; this macro intentially left blank so it may be safely overwritten for any custom 
     639; requirements that an installatin may have. 
     640 
     641 
    637642; dialout using a trunk, using pattern matching (don't strip any prefix) 
    638643; arg1 = trunk number, arg2 = number, arg3 = route password 
     
    677682exten => s,n,GotoIf($[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]?gocall) ; Set to YES if we should pump silence 
    678683exten => s,n,Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})       ; set MoH or off 
     684 
     685; This macro call will always be blank and is provided as a hook for customization required prior to making a call 
     686; such as adding SIP header information or other requirements. All the channel variables from above are present 
     687; 
     688exten => s,n,Macro(dialout-trunk-predial-hook) 
    679689 
    680690exten => s,n(gocall),GotoIf($["${custom}" = "AMP"]?customtrunk) 
  • modules/branches/2.3/core/functions.inc.php

    r5045 r5091  
    402402                                } 
    403403                        } 
    404                          
     404 
     405                        // create from-trunk context for each trunk that adds counts to channels 
     406                        // 
     407                        $trunklist = core_trunks_list(true); 
     408                        if (is_array($trunklist)) { 
     409                                foreach ($trunklist as $trunkprops) { 
     410                                        if (trim($trunkprops['value']) == 'on') { 
     411                                                // value of on is disabled and for zap we don't create a context 
     412                                                continue; 
     413                                        } 
     414                                        switch ($trunkprops['tech']) { 
     415                                                case 'IAX': 
     416                                                case 'IAX2': 
     417                                                case 'SIP': 
     418                                                        $trunkgroup = $trunkprops['globalvar']; 
     419                                                        $trunkcontext  = "from-trunk-".$trunkprops['name']; 
     420                                                        $ext->add($trunkcontext, '_.', '', new ext_setvar('GROUP()',$trunkgroup)); 
     421                                                        $ext->add($trunkcontext, '_.', '', new ext_goto('1','${EXTEN}','from-trunk')); 
     422                                                        break; 
     423                                                default: 
     424                                        } 
     425                                } 
     426                        } 
     427 
    405428                        /* dialplan globals */ 
    406429                        // modules should NOT use the globals table to store anything! 
  • modules/branches/2.3/core/page.trunks.php

    r5044 r5091  
    344344                        <tr> 
    345345                                <td> 
     346<?php 
     347        if ($tech == "sip" || substr($tech,0,3) == "iax") { 
     348?> 
     349                                        <a href=# class="info"><?php echo _("Maximum channels")?><span><?php echo sprintf(_("Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. To count inbound calls against this maximum, use the auto-generated context: %s as the inbound trunk's context. (see extensions_additional.conf) Leave blank to specify no maximum."),((isset($channelid) && trim($channelid)!="")?"from-trunk-$channelid":"from-trunk-[trunkname]"))?></span></a>:  
     350<?php 
     351        } else { 
     352?> 
    346353                                        <a href=# class="info"><?php echo _("Maximum channels")?><span><?php echo _("Controls the maximum number of outbound channels (simultaneous calls) that can be used on this trunk. Inbound calls are not counted against the maximum. Leave blank to specify no maximum.")?></span></a>:  
     354<?php 
     355        } 
     356?> 
    347357                                </td><td> 
    348358                                        <input type="text" size="3" name="maxchans" value="<?php echo htmlspecialchars($maxchans); ?>"/> 
     
    773783        <?php } ?> 
    774784 
    775         <?php if ($tech == "sip" || $tech == "iax2") { ?> 
     785        <?php if ($tech == "sip" || substr($tech,0,3) == "iax") { ?> 
    776786        if ((isEmpty(theForm.usercontext.value) || isWhitespace(theForm.usercontext.value)) &&  
    777787                (!isEmpty(theForm.userconfig.value) && !isWhitespace(theForm.userconfig.value)) &&