added notifications
added freepbx integration as notification source
This commit is contained in:
24
freepbx.py
Normal file
24
freepbx.py
Normal 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)
|
||||
Reference in New Issue
Block a user