ARI: Add events for Contact and Peer Status changes

This patch adds support for receiving events regarding Peer status changes
and Contact status changes. This is particularly useful in scenarios where
we are subscribed to all endpoints and channels, where we often want to know
more about the state of channel technology specific items than a single
endpoint's state.

ASTERISK-24870

Change-Id: I6137459cdc25ce27efc134ad58abf065653da4e9
This commit is contained in:
Matt Jordan
2015-09-03 21:19:21 -05:00
parent 5541c6de6e
commit 5206aa9d30
6 changed files with 641 additions and 12 deletions

View File

@@ -163,14 +163,83 @@
"ChannelTalkingFinished",
"ChannelHold",
"ChannelUnhold",
"ContactStatusChange",
"EndpointStateChange",
"Dial",
"StasisEnd",
"StasisStart",
"TextMessageReceived",
"ChannelConnectedLine"
"ChannelConnectedLine",
"PeerStatusChange"
]
},
"ContactInfo": {
"id": "ContactInfo",
"description": "Detailed information about a contact on an endpoint.",
"properties": {
"uri": {
"type": "string",
"description": "The location of the contact.",
"required": true
},
"contact_status": {
"type": "string",
"description": "The current status of the contact.",
"required": true,
"allowableValues": {
"valueType": "LIST",
"values": [
"Unreachable",
"Reachable",
"Unknown",
"Created",
"Removed"
]
}
},
"aor": {
"type": "string",
"description": "The Address of Record this contact belongs to.",
"required": true
},
"roundtrip_usec": {
"type": "string",
"description": "Current round trip time, in microseconds, for the contact.",
"required": false
}
}
},
"Peer": {
"id": "Peer",
"description": "Detailed information about a remote peer that communicates with Asterisk.",
"properties": {
"peer_status": {
"type": "string",
"description": "The current state of the peer. Note that the values of the status are dependent on the underlying peer technology.",
"required": true
},
"cause": {
"type": "string",
"description": "An optional reason associated with the change in peer_status.",
"required": false
},
"address": {
"type": "string",
"description": "The IP address of the peer.",
"required": false
},
"port": {
"type": "string",
"description": "The port of the peer.",
"required": false
},
"time": {
"type": "string",
"description": "The last known time the peer was contacted.",
"required": false
}
}
},
"DeviceStateChanged": {
"id": "DeviceStateChanged",
"description": "Notification that a device state has changed.",
@@ -654,6 +723,34 @@
}
}
},
"ContactStatusChange": {
"id": "ContactStatusChange",
"description": "The state of a contact on an endpoint has changed.",
"properties": {
"endpoint": {
"required": true,
"type": "Endpoint"
},
"contact_info": {
"required": true,
"type": "ContactInfo"
}
}
},
"PeerStatusChange": {
"id": "PeerStatusChange",
"description": "The state of a peer associated with an endpoint has changed.",
"properties": {
"endpoint": {
"required": true,
"type": "Endpoint"
},
"peer": {
"required": true,
"type": "Peer"
}
}
},
"EndpointStateChange": {
"id": "EndpointStateChange",
"description": "Endpoint state changed.",