Context for scripts (incoming calls)

(Lorne Gaetz) #41

For your next adventure: Fun with AMI (node-red)

(O T To001) #42

hm. could possibly be. but AMI is a polling thing, isnt it?
actually with mqtt I am on a rather pushing setup.
my goal is to have my home automation (fhem) know the states of the telephony.
maybe in the future I also will have to push things to asterisk (eg: nobody at home --> forward calls to cell phones or something)…


when you have both python2 and python3 available you need to expressly call pip2 or pip3 to avoid confusiob

(O T To001) #44

thank you!
yes, I did…


install mosquitto-utils and let them to the grunt work, both pub and sub, then its just a system call

(O T To001) #46

thank you! I know, this is not the problem. I know mosquitto_pub, but for several reasons I did not want just a mosquitto_pub call here…
The python script is working fine - so is everything else right now. Until I start the next change with asterisk :wink:


No, AMI and the better written ARI does not ‘poll’ . write it properly (in PHP, Ruby, Go, bash whatever) and you can follow every event on an opened tcp/5038 connection , then publish mqtt pubs as appropriate, conversely instigate asterisk ‘actions’ as a result of mqtt subs , forwarding, redirecting, transferring,DND, call files whatever all best done outside a limited php wrapper library, integrate with homeassistant,fhem whatever and ‘Bob’s your uncle’

Maybe a ‘next step’


(O T To001) #48

Wow, wow, wow!
I think I have to take a closer look at that stuff
Thanks for the hint!

(O T To001) #49

Hm. Just played around a little bit with ARI and AMI.
As far as I have seen, ARI needs modifications of dialplanes and/or extensions (what is still a little bit dangerous for me)
But I have run a demo-script for event-listening with python. And man, this gives TONS of output. I think, this could be a source of lots of fun ^^

(Lorne Gaetz) #50

It is fun. Please share your progress in a new thread when you get there.

(O T To001) #51

I will. But it will take some time. Have plenty of other stuff to do (like we all have)

(Lorne Gaetz) #52

We have a contribution out of the blue on Github from Udo Hartmann that adds MQTT support to Superfecta. I am unable to test, so if anyone has MQTT running and is willing to give it a spin, the pull request is here:

To give it a spin, you’ll need to install mosquitto, which on the Distro should just be yum install mosquitto. Then you need to download the Superfecta module:

cd /var/www/html/admin/modules/superfecta/sources
chown asterisk:asterisk source-Send_to_MQTT.module

Then browse to Superfecta, configure and test.

Dialplan hook following execution of caller id superfecta for caller id name announcment
(O T To001) #53

looks promising - but I do not know Superfecta yet. Isnt this only for incoming calls?

(Dave Burgess) #54

Kind of. It’s a destination in the selector, so you can use it lots of places, but the one that makes the most sense is on an Incoming Call.

(system) closed #55

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