[asterisk-users] Re: Paging

Yuan LIU yliu11 at hotmail.com
Sat Mar 31 23:18:38 MST 2007


>From: "Forrest Beck" <jonforrest.beck at gmail.com>
>Date: Fri, 30 Mar 2007 16:52:39 -0400
>
>Forgot to mention.
>
>We are using Polycom phones on asterisk 1.4.2
>
>I tried the allpage agi, but it checks for all SIP peers connected to
>the server.
>
>On 3/30/07, Forrest Beck <jonforrest.beck at gmail.com> wrote:
>>First off, A lot of thanks to this list.  I have learned ton from
>>reading through the posts this past year.
>>
>>
>>I need some advise.
>>
>>I have two group of phones connected to a single server.
>>
>>Group1= SIP/2503&SIP/2504
>>Group2=SIP/3501&SIP/3502
>>
>>I'd like to be able to dial an extension and page a certain group of
>>phones only if ChanIsAvail returns 1.
>>
>>I am not sure how to go about programming this.  I though to write a
>>AGI script that reads a list of phones (one list per group), checks
>>ChanIsAvail then Pages the phone.  I  will have about 60 extensions
>>per group to Page.  Will there be lag until all the phones get paged
>>and the script finishes?

The lag shouldn't be too large.  Yet you don't have to use AGI to build a 
list, and you don't even have to wait for all channels to be checked if I 
understand the objective correctly.  For example (untested),

exten => _Z.,1,ChanIsAvail(SIP/${EXTEN},j)
exten => _Z.,n,Dial(SIP/${EXTEN})
exten => 
_Z.,101,Set(group=$[$[${GROUP1}=~SIP/${EXTEN}]?${GROUP1}::${GROUP2}])
exten => _Z.,n,While(${group})
exten => _Z.,n(check),ChanIsAvail(${group},j)
exten => _Z.,n,Set(page=${${page}&${AVAILORIGCHAN}}); tweak if empty & not 
acceptable
exten => _Z.,n,Dial(${page}); start dialing before list completes
exten => _Z.,n,Set(group=$[${group}=~${AVAILORIGCHAN}&*(.*)])
exten => _Z.,n,Endwhile
exten => _Z.,check+101,Congestion; or however way you want to handle no 
channel available

You may need to tweak a bit to get it working but that's the spirit.  Hope 
this helps.

Yuan Liu

>>Then I thought maybe a Macro in the dialplan to dial a global var of
>>the group of phones, but that won't work.  If phone isn't available,
>>none will get paged.

>>Has anyone done this before?  I just don't know where to start.
>>
>>Thanks
>>
>>--
>>***
>>Forrest Beck
>>IAXTEL: 17002871718
>>jonforrest.beck at gmail.com




More information about the asterisk-users mailing list