[asterisk-users] Find me macro - calling multiple people to get a hold of one

Wiebe Cazemier wiebe at halfgaar.net
Wed Nov 4 10:24:38 CST 2015

Hi list,

We're trying to set up a phone number that customers can call to get a hold of anyone of a group of sysadmins (and not their voice mails!). We found the findme example ([1]) that makes the callees press 1 to accept the call. It almost works, but it doesn't work correctly when one of the callees, the sysadmins, hangs up after accepting the call.

We're using this 'screen' macro:

exten => _9999XXXXXXXXXX,1,Dial(SIP/bla/${EXTEN:4},40,M(screen))
exten => _9999XXXXXXXXXX,2,Hangup

exten => s,1,Wait(1)
exten => s,n,Background(press-1)
exten => s,n,WaitExten(10) ; the value is the Wait time before we assume the call is not accepted
exten => 1,1,NoOp(Caller accepted) ; Do not set MACRO_RESULT to anything to connect the caller 
exten => t,1,Playback(weasels-eaten-phonesys) ; if you're too late with pressing 1

exten =>  s,1,Set(CALLERID(all)="Alarm" <911>)
same  =>   n,Playback(please-wait-connect-oncall-eng)
same  =>   n,Dial(LOCAL/9999${WIEBE_MOBILE})
same  =>   n,Playback(vm-nobodyavail)
exten  =>  t,1,Playback(vm-nobodyavail)

First of all, what is MACRO_RESULT? I can't seem to find anything about that. Googling for it yields basically nothing.

But the biggest problem is when the callee answers, then hangs up. The person calling is connected to the phone that hangs up, instead of hearing 'vm-nobodyavail'. This seems to be because there is nothing that sets MACRO_RESULT in that event (it's only set on 't', timeout).

I tried adding:

exten => h,1,Verbose(0,"The callee hung up")    

to handle the hangup (h), but it's not doing that.

WaitExten() pushes the result back on the stack and restarts the context, right? So what is the result when the person hangs up?



[1] http://www.voip-info.org/wiki/view/Asterisk+tips+findme

More information about the asterisk-users mailing list