FreePBX | Register | Issues | Wiki | Portal | Support

Agi-mqtt with FREEPBX not just Asterisk?


#22

tcpdump -vv port 1883

If the host is 127.0.0.1

tcpdump -i lo port 1883

and

lsof -i :1883


(D E) #23

The broker is hosted on another Raspberry Pi, so I don’t know if this is the right approach, but I installed Wireshark, set the MQTT script IP to my MacBook’s and tried to trigger the script with an inbound call. Nothing. So I don’t THINK the script is actually ‘working’. Yeah, great technical term there, dan_ce! What I mean is, I don’t think the script execution is proceeding to the point where it attempts to make a TCP/IP connection. Hmmm. I wish I could just call the script (with the same arguments) directly from bash because then maybe it would print some useful diagonistic info back.


#24

If you are out of your depth, then perhaps

might be simpler to debug, it uses mosquitto_pub to connect to your broker, not a long unsupported library from somewhere. It also runs well on a raspberry.


(D E) #25

I’m definitely out of my depth. I also think I’ve answered @jfinstrom, the script I think is broken with current version of python.

When I run it, I get “ImportError: No module named mosquitto”. I think I need to attempt to move the script over to Paho


#26

Possibly an even bigger “over my head” there migrating a python script, how comfortable are you with python?

In bash
mosquitto_clients (mosquitto_pub/sub)

are all you need to make sure you you can see, publish and subscribe to your broker’s available topics , until facile with all that then I think you will find it all a long row to hoe.


(D E) #27

Thanks, Dicko. I really appreciate your help today. I’ll see how I get on. At the moment I’m playing with your most recent suggestion. :slight_smile:


(D E) #28

WAS JUST ABOUT TO GIVE UP AND GOT IT WORKING!! THANKS @DICKO!!
(sorry to shout).

COOL!!!

By the way, it = your simpler mosquitto method - I had to tweak the code slightly but all good!!


#29

Please elucidate, We always appreciate peer review . .


(D E) #30
[from-trunk]
exten => _X.,1,trysystem(mosquitto_pub -h 192.168.2.11 -t 'calls/in/${EXTEN}' -m  '${CALLERID(num)}' )
exten=> _X.,n,Goto(from-pstn,${EXTEN},1)
[your-custom-mqtt-inbound]
exten => s,1,trysystem(mosquitto_pub -h your.mqtt.broker -t 'your/topic/${EXTEN}' -m ${CallerID(number)} )
exten=> s,n, goto(from-pstn,${EXTEN},1)

The main change was to the capitalisation of the CallerID/CALLERID (it seemed to matter!).
Thank you! So happy to get this working.


(Itzik) #31

Just fyi, this is probably the reason pastebin didn’t work. I assume it’s a distro feature.


(system) closed #32

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