added notifications

added freepbx integration as notification source
This commit is contained in:
Brandon4466
2023-08-11 02:17:41 -07:00
parent 0039308633
commit 4467115135
9 changed files with 91 additions and 23 deletions

24
freepbx.py Normal file
View File

@@ -0,0 +1,24 @@
from flask import Flask, request
import threading
from _notify import draw
app = Flask(__name__)
@app.route('/hook', methods=['GET'])
def wait_for_call():
# Get information from URL variables
num = request.args.get('num')
cid = request.args.get('CID')
img = "phone.png"
# Process the received information (you can customize this part)
print(f"Received param1: {num}")
print(f"Received param2: {cid}")
# Add more processing logic as needed
threading.Thread(target=draw, args=(cid, num, img)).start()
# Respond to the webhook request (optional)
return 'Webhook received successfully!', 200
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)