24 lines
710 B
Python
24 lines
710 B
Python
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) |