[asterisk-users] Paging in waves.

John Kiniston johnkiniston at gmail.com
Thu Dec 5 18:36:07 CST 2013


I've been working on writing a subroutine to page groups of phones at once
and I'm having some difficulty.

My goal is to have a user call an extension, I record the page they wish to
play, I then page out that recorded file to the phones in groups.



[sub-masspage]
exten => s,1,NoOP
same  =>   n,Answer
same  =>   n,Set(filename=$PAGE)
same  =>   n,Wait(1)
same  =>   n,Record(pagequeue/${filename}%d.gsm,0,30,yk)
same  =>
n,Set(DURATION=$[CEIL(${STAT(s,/var/lib/asterisk/sounds/${RECORDED_FILE}.gsm)}
/ 1650)])
same  =>   n,Playback(one-moment-please)
same  =>   n,Set(MUTEAUDIO(all)=on)
same  =>   n,SIPAddHeader(Alert-Info: RingAnswer)
same  =>   n,SipAddHeader(Call-Info: <uri>\;answer-after=0)
;same  =>   n,Set(TIMEOUT(absolute)=${DURATION})
same  =>
n,ExecIf($[${ISNULL(${ARG1})}=0]?Page(${ARG1},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG2})}=0]?Page(${ARG2},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG3})}=0]?Page(${ARG3},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG4})}=0]?Page(${ARG4},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG5})}=0]?Page(${ARG5},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG6})}=0]?Page(${ARG6},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG7})}=0]?Page(${ARG7},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG8})}=0]?Page(${ARG8},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG9})}=0]?Page(${ARG9},n(${RECORDED_FILE})is),10)
same  =>
n,ExecIf($[${ISNULL(${ARG10})}=0]?Page(${ARG10},n(${RECORDED_FILE})is)10)
same  =>   n,Set(MUTEAUDIO(all)=off)
same  =>   n,Playback(goodbye)
same  =>   n,TrySystem(rm -f /var/lib/asterisk/sounds/${RECORDED_FILE}.gsm)
same  =>   n,Hangup
;end sub-masspage

The issue I'm having is the Page command is putting the phone that's doing
the paging into the meetme bridge it's creating and the dialplan stops at
the first Page command.


While I was testing it with a single phone I was using Dial instead of Page

same  =>
n,ExecIf($[${ISNULL(${ARG1})}=0]?Dial(${ARG1},15,A(${RECORDED_FILE})S(${DURATION})mg)
))
same  =>
n,ExecIf($[${ISNULL(${ARG2})}=0]?Dial(${ARG2},15,A(${RECORDED_FILE})S(${DURATION})mg)))

Which worked great when I sent it one phone in each argument.. Didn't think
about the fact that the first phone that answers is the only phone that
answers till I got deeper into writing it... (It's been a long day)

So I'm at a loss as what to do here, Dial almost does what I need other
than the fact that the first phone that answers is the only phone that
bridges, and Page almost does what I need other than my dialplan execution
stops after the first Page command and it's trying to include the phone I'm
calling from as one of the phones it's paging.

I'm using 1.8 so I've got Meetme and Confbridge available but I'm not sure
what to do unless I start playing with LOCAL channels. Maybe I could have
PAGE call Local Channels that have the TIMEOUT set but then I'd need a way
to pass which phones to dial in somehow.

Suggestions?


-- 
A human being should be able to change a diaper, plan an invasion, butcher
a hog, conn a ship, design a building, write a sonnet, balance accounts,
build a wall, set a bone, comfort the dying, take orders, give orders,
cooperate, act alone, solve equations, analyze a new problem, pitch manure,
program a computer, cook a tasty meal, fight efficiently, die gallantly.
Specialization is for insects.
---Heinlein
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20131205/09feb881/attachment.html>


More information about the asterisk-users mailing list