[asterisk-users] Calling out on a group of DAHDI lines

Mitch Claborn mitch_ml at claborn.net
Tue Oct 9 16:02:10 CDT 2012


Here's what I came up with. Works find with the simulated DAHDI dynamic 
local channels. I'll find out later in the week how it works with real 
hardware.

[emergency-services]
exten =>911,1,Goto(dialpsap,1)
exten =>9911,1,Goto(dialpsap,1) ;
exten =>999,1,Goto(dialpsap,1)
exten =>112,1,Goto(dialpsap,1)

exten =>dialpsap,1,Verbose(1,Call initiated to PSAP!)
   same =>n(dialit),Dial(${LOCAL}/${EMERGENCY},30)
   same =>n,Verbose(2,DIALSTATUS=${DIALSTATUS})
   same =>n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?good)
   same =>n(hu),SoftHangup(${EMERGENCY_CHANNEL},a)
   same =>n,Wait(2)
   same =>n,Goto(dialit)
   same =>n(good),NoOp(call good)
   same =>n,Hangup()



Mitch

On 10/09/2012 10:48 AM, Richard Mudgett wrote:
>> Asterisk 1.8
>>
>> (a) We will have a group of 4 analog lines into a Digium card that
>> will
>> be used for local calls.  What is the best way to use those lines as
>> a
>> pool for outbound calls?  Can I use ChanIsAvail(), listing those 4
>> channels, and then use the first one returned?
>
> There are lots of things documented in chan_dahdi.conf.sample.  The
> following option will assign channels 1-4 to group 1.
>
> ; Logical groups can be assigned to allow outgoing roll-over.  Groups range
> ; from 0 to 63, and multiple groups can be specified. By default the
> ; channel is not a member of any group.
> ;
> ; Note that an explicit empty value for 'group' is invalid, and will not
> ; override a previous non-empty one. The same applies to callgroup and
> ; pickupgroup as well.
> ;
> group=1
> channel = 1-4
>
> Then you can dial from that group of channels:
>
> same => n,Dial(DAHDI/g1/5551212)
>
> 	/*
> 	 * data is ---v
> 	 * Dial(DAHDI/pseudo[/extension[/options]])
> 	 * Dial(DAHDI/<channel#>[c|r<cadance#>|d][/extension[/options]])
> 	 * Dial(DAHDI/<subdir>!<channel#>[c|r<cadance#>|d][/extension[/options]])
> 	 * Dial(DAHDI/i<span>[/extension[/options]])
> 	 * Dial(DAHDI/[i<span>-](g|G|r|R)<group#(0-63)>[c|r<cadance#>|d][/extension[/options]])
> 	 *
> 	 * i - ISDN span channel restriction.
> 	 *     Used by CC to ensure that the CC recall goes out the same span.
> 	 *     Also to make ISDN channel names dialable when the sequence number
> 	 *     is stripped off.  (Used by DTMF attended transfer feature.)
> 	 *
> 	 * g - channel group allocation search forward
> 	 * G - channel group allocation search backward
> 	 * r - channel group allocation round robin search forward
> 	 * R - channel group allocation round robin search backward
> 	 *
> 	 * c - Wait for DTMF digit to confirm answer
> 	 * r<cadance#> - Set distintive ring cadance number
> 	 * d - Force bearer capability for ISDN/SS7 call to digital.
> 	 */
>
>> (b) For emergency calls, I want to be able to force one of these
>> lines
>> available if all are in use.  Will SoftHangup() do that?  If so, do I
>> need to Wait() after a SoftHangup() before trying to use it?
>
> SoftHangup() should do what you want for this.  You need to have a wait
> so the soft hangup will have a chance to be recognized.
>
> I would also suggest that if you use g1 in your normal dial, you should use the
> highest channel as your emergency line.  That channel will be the last used
> by the group so an emergency call will be least likely to kick off an established
> call.
>
> Another approach is to attempt to dial the emergency call normally.  If the first
> attempt fails, then kick an established call.
>
> Richard
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>                 http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>     http://lists.digium.com/mailman/listinfo/asterisk-users
>



More information about the asterisk-users mailing list