Asterisk + Mongodb + call next if no answer

Hi sorry if I put this in the wrong section,however I need to know if there is any documentation on how to connect mnongodb database or when a user rings 1800NUMBER ext 152 it runs a json script to get emergency numbers.

Let me try a break this down.

Let say your a mum and you have a kid with a disability who tends to run off when your not looking.

However this parent has registered there kid with a special kidQR code, when a stranger scans that QR they are given a 1800 number (which is standard) and an extension which must also be dialed (which we have an app programmed for that) but what I need to now do it fetch from the mongodb cloud server the emergency contacts for that ext.

First asterisk should try ringing the mum and dad, if no answer then I need asterisk to say “KidQR is trying to get in contact with an emergency contact person please hold” and it dials the next contact number.

All the way to the 5th contact if at that stage no one has picked up then it asks the person to leave a message and we email that to the mother and father.

Now I also need the system to recognize voicemail systems and dial the next contact.

I understand that it will not be full proof but just need to have a concept and an idea on what my next move should be.

Any advice would be helpful.

ARI or AGI would be the two options. There’s descriptions of them on the wiki[1] along with more documentation. It can be done with both.

[1] https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=29395573

If the DB was MYSQL it would be extremely easy to do it using AGI + PHPAGI class, I just dont know nothing about Mongodb