Outbound Ringing
Our PIOPIY platform will notify the following sample JSON live event to your web server POST method URL, when an outbound call is ringing.
Implementation
PIOPIY webhooks implementation in different languages.
- Python
- Node.js
- PHP
- Java
from flask import Flask,requestapp = Flask(__name__)# Receive webhooks from PIOPIY platform when call receive or make@app.route("/webhook/cdr",methods=['POST'])def hello():# Received JSON CDR from PIOPIY Platformcdr = request.get_json()print(cdr)return "got it"if __name__ == "__main__":app.run(debug=True, port=5000)
To know more about testing webhooks for local development purposes, go to examples.
Sample event response
This is the sample JSON live event, where the PIOPIY platform will notify your web server POST method URL.
- Leg A
- Leg B
{"type": "event","leg": "a","conversation_uuid": "f1151c8f-db36-4818-b5b1-436beec52bfd","time": 1571044224000,"to": 9100000000,"from": 4471000000,"cmiuuid": "f1151c8f-db36-4818-b5b1-436beec52bfd","direction": "outbound","appid": 2222226,"callerid": 04471000000,"vn": 4471000000,"status": "ringing"}
The above sample JSON live event consists of several properties. Each property has a description and take a look at it.
Properties
These are the list of properties and its description
Property | Type | Description |
---|---|---|
type | string | Type of notification from PIOPIY platform it may be cdr or event |
leg | string | Define the leg of the call either a or b |
conversation_uuid | string | A unique identifier of this conversation |
time | number | Timestamp of this call |
to | number | The number the call was made to |
from | number | Your default DID Number |
cmiuuid | string | A unique identifier of this call |
direction | string | Direction of this call |
app_id | number | Your app id |
callerid | number | The incoming DID number |
vn | number | Your default DID Number |
status | string | Status of this call |