Flood Emergency System for Indigenous Communities with Asterisk?

Hi there!

I work for an NGO in Bolivia and I want to develop a flood emergency system to alert vulnerable indigenous communities In the area where this would be deployed the majority of the peasants don’t own smartphones, have trouble communicating through SMS and have little resources to pay for minutes.

I would like to implement a system in which a cell phone number is called, it subsequently hangs up on the caller so no minutes on the side of the caller are spent, but it triggers a new call to a contact associated with the first caller and then plays an audio message.

Is this something that Asterisk can do using a GSM gateway?

I am a complete noob with Asterisk but if the idea for the system is feasible, are there any resources that you can point me out so I can pull this off?

If I understand you correctly
user call your number, and you call the user back and play a message

this is just a quick and dirty and and unteste code that I have bashed together
when the user call in they will get disconnected and after 5s receive a call that will play CurrentWeather
if the user call in with unknown number or from an international number we will answer the call and play the message

;FloodEmergencyNumber = 1234
[incoming|
exten => 1234,1,Goto(FloodEmergency,s,1)

[FloodEmergency]
exten => s/_[6,7]XXXXXX,1,NoOp(Mobile ${CALLERID(num)}) ;callback allowed
exten => s/_[2-4]XXXXXX,1,NoOp(Province ${CALLERID(num)});callback allowed
exten => s/_5XXXXXX,1,NoOp(National ${CALLERID(num)});callback allowed
exten => s/_+591Z!,1,Set(CALLERID(num)=${CALLERID(num):4}) ; Bolivia E164 (strip +591);callback allowed
exten => s/_+Z!,1,Goto(FloodEmergencyAlert,s,1) ;no call back
exten => s/_00Z!,1,Goto(FloodEmergencyAlert,s,1) ;no call back
exten => s,1,Goto(FloodEmergencyAlert,s,1) ;no call back
same => n,Originate(Local/${CALLERID(num)}@FloodEmergencyCallBack,exten,FloodEmergencyAlert,s,1)
same => n,Hangup(16) ;16=normal call clearing

[FloodEmergencyCallBack]
exten => _X!,1,Wait(5) ; allow the calls channel to normalize
same => n,Dial(PJSIP/${EXTEN}@OutgoingProvider)

[FloodEmergencyAlert]
exten => s,1,Answer()
same => n,Playback(CurrentWeather)
same => n,Hangup(16) ;16=normal call clearing
; if need you can change this section to an IVR and let the user hear different messages

hmm I may have misunderstood you
try 2

[incoming|
exten => 1234,1,Goto(FloodEmergency,s,1)

[FloodEmergency]
exten => s/_X!,1,NoOp( ${CALLERID(num)}) ;callback allowed
exten => s/_+Z!,1,NoOp( ${CALLERID(num)}) ;callback allowed
exten => s,1,Goto(FloodEmergencyAlert,s,1) ;no call back call agent direct
same => n,Originate(Local/s@FloodEmergencyAgent,exten,FloodEmergencyAlert,${CALLERID(num)},1)
same => n,Hangup(16) ;16=normal call clearing

[FloodEmergencyAgent]
exten s,1,Dial(PJSIP/333444555@Trunk&PJSIP/222333444@Trunk)
same => n,Hangup()

[FloodEmergencyAlert]
exten => _X!,1,Answer()
same => n,Playback(PleaseCall)
same => n,SayNumber(${EXTEN})
;same => ,n,Dial(PJSIP/${EXTEN}@Trunk) ; or just call the number for them
same => n,Hangup(16) ;16=normal call clearing

I don’t think the OP wants a globally fixed number to be called, although the specification suffers a bit from a lack a clear statement of goals as against implementation. I’m not clear if the message is “get to high ground”, or “I’m safe”. It is pretty clear that the callee depends on the caller, so a database is going to need to be consulted (assuming large numbers of users, otherwise the dialplan itself could do the translation from caller ID to called number).

I definitely didn’t get the idea that they wanted the caller to be called back.

The Answer’s in your dialplan serve no useful purpose as you cannot answer an outgoing call from the originating side, and, in fact, the called side has already answered at that point in the Originate processing.

On the other hand, I’d suggest that answering would be desirable for the initiating call, even though the caller will get charged at least the minimum call charge. That is because, otherwise, the alerts can be triggered by phone spam, or would even be easy game for someone up to mischief. Also the network operator may not like people signalling information using non-chargeable calls (I believe some VoIP service even surcharge very short calls to the callee, for this reason). (I would note that the original posting said “hang up”, but that is only possible if the call is answered, although it may be possible to reject the call.)

If this is an “I’m OK” system, it may be less important to verify the incoming call, as the system need only be enabled when there was an emergency.

Originate has the disadvantage that only one attempt is made. Call files would be a better approach, if there is a requirement to persist in getting the message through.

Generally, I’d say it is something that Asterisk can do, but it needs more work on the requirements.

Perhaps I’m the only one that is getting what the ask is for this because I actually have a customer that does this in the US and is tied into the National Weather System for alerts. It’s pretty simple:

  1. Flood warning comes in.
  2. Asterisk starts dialing those on the list for alerts.
  3. Call is answered, alert is played back. Callee gives response.
  4. Call is hungup.

That’s it, that the basics. Now in my use case if the call is answered by voicemail, the message is still sent but will repeat to make sure the voicemail catches it all. It will also still accept input from the callee just in case they pickup still (people still have answering machines). Using Local channels changes the outbound leg to an inbound leg when the call is answered so that input can be accepted.

What is the confusing part here is the OP wants to have a list of numbers that they call and then hang up on so the poor end user doesn’t have to spend that much money. Now are they hanging up upon answer or waiting for a timeout to cancel the dial before answer don’t know. But after that hangup happens they want to call another contact preferably someone with minutes on their phones and could answer the call and listen to the message.

I’m not sure why those aren’t just being called to being with. But what the OP wants to do is simple and easy they just need to have a little more clarity in the actual execution.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.