
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Emergency Dispatch/911
|
353
The second priority in this example hangs up the channel, while the third priority
places a call to the local public safety answering point, whose phone number has
been stored in
${LocalPSAP} with a SetVar command in priority 1.
This is fine when you have only one SIP trunk channel at your disposal for 911 calls,
but if you have more than one, you wouldn’t want to automatically hang up a chan-
nel based on some proprietary setting in the dial-plan. The ChanIsAvail( ) command
will help us determine which of several SIP trunk channels can be used to place the
call—kind of like an outbound hunt group. Consider this dial-plan snippet:
exten => 911,1,ChanIsAvail(SIP/VOICEPULSE1&SIP/VOICEPULSE2)
exten => 911,2,SetVar(LocalPSAP=440-361-9000)
exten => 911,3,Dial(${AVAILCHAN}/${LocalPSAP})
exten => 911,4,Hangup( )
exten => 911,102,SoftHangup(SIP/VOICEPULSE1)
exten => 911,103,Dial(SIP/VOICEPULSE1/${LocalPSAP})
In this example, priority 1 checks to see if either of the two named SIP channels is
available (these correspond to SIP peers in sip.conf). If one is available, its channel
name is stored in
${AVAILCHAN} and processing continues at the next priority, 2.
Priority 2 sets the phone number of the public safety dispatcher as in the previous
example. Priority 3 dials that ...