Problems implementing an alert system

Hi all,

I am trying to implement an alert system, which should call a couple of phones as long as somebody accepts the alert (e.g. by entering # or something along these lines).

I tried the following setup:

  • I created a call file and put it in the outgoing spool directory:

Channel: Local/s@alert
Callerid: Nagios
MaxRetries: 10
RetryTime: 60
WaitTime: 600
Extension: s

  • the alert context in extensions will put the call into the alert_queue

[alert]
exten => s,1,Queue(alert_queue|tr|||600)
exten => s,2,Hangup-
exten => t,1,Playback(vm-goodbye)
exten => t,2,Hangup

  • the alert queue ist setup like this:

[alert_queue]
music = default
strategy = rrmemory
;announce = queue-alert-info ; tells the member how to acknowlege the call
timeout = 90
wrapuptime=30
announce-frequency = 0
announce-holdtime = no
joinempty = yes
member => local/s@alert_member

For testing purpouses there is only one member right now, but obviously in deployment there will be more

The call will then be handed to the alert_member context, this should provide the acknowledge functionality. Numbers are hard coded etc, this sill needs work.

[alert_member]

exten => s,1,Dial(sip/sipgate/12345678)
exten => s,2,Playback(tt-somethingwrong)
exten => s,3,Background(for-yes-press)
exten => s,4,SayDigits(2)
exten => 1,1,Goto(s,2)
exten => 2,1,Goto(alertack,s,1)
exten => t,1,Goto(alert,t,1)

[alertack]
exten => s,1,Playback(thank-you-cooperation)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup

When I put the call file into the outgoing queue, I get the following console output:

Attempting call on Local/s@alert for s@:1 (Retry 1)
– Executing Queue(“Local/s@alert-8a1b,2”, “alert_queue|tr|||600”) in new stack
– Called local/s@alert_member
– Executing Dial(“Local/s@alert_member-8b01,2”, “sip/sipgate/12345678”) in new stack
– Called sipgate/12345678
– SIP/sipgate-e656 is making progress passing it to Local/s@alert_member-8b01,2
– SIP/sipgate-e656 answered Local/s@alert_member-8b01,2
– Local/s@alert_member-8b01,1 answered Local/s@alert-8a1b,2
> Channel Local/s@alert-8a1b,1 was answered.
– Executing Queue(“Local/s@alert-8a1b,1”, “alert_queue|tr|||600”) in new stack
– Called local/s@alert_member
– Executing Dial(“Local/s@alert_member-f1b0,2”, “sip/sipgate/12345678”) in new stack
– Called sipgate/12345678
– SIP/sipgate-75e4 is making progress passing it to Local/s@alert_member-f1b0,2
– Got SIP response 486 “Busy” back from 217.10.79.9
– SIP/sipgate-75e4 is busy
== Everyone is busy/congested at this time
– Executing Playback(“Local/s@alert_member-f1b0,2”, “tt-somethingwrong”) in new stack
– Local/s@alert_member-f1b0,1 answered Local/s@alert-8a1b,1
– Playing ‘tt-somethingwrong’ (language ‘en’)
== Spawn extension (alert, s, 1) exited non-zero on ‘Local/s@alert-8a1b,2’
== Spawn extension (alert_member, s, 1) exited non-zero on ‘Local/s@alert_member-8b01,2’
– Executing BackGround(“Local/s@alert_member-f1b0,2”, “for-yes-press”) in new stack
– Playing ‘for-yes-press’ (language ‘en’)
– Executing SayDigits(“Local/s@alert_member-f1b0,2”, “2”) in new stack
– Playing ‘digits/2’ (language ‘en’)
== CDR updated on Local/s@alert_member-f1b0,2

The flow works as expected, but even if I pick up the phone asterisk keeps on trying to call the member. Why would it do that?

I don’t understand a couple of things:

  • when will the call file be cleared? Once I put it into the Queue? Or do I need to call Answer before? (I tried this, but still multiple calls will be made)

  • how does the queue command work? I don’t know where the control flow goes once I called queue. I sort of circumvented this by explictly calling the local/alert_member context from the queue.

Maybe there is a better / easier way to achieve what I want to do.

Any help is very much appreciated.

Thanks

Dominik