import plivo

client = plivo.RestClient(auth_id='<auth_id>', auth_token='<auth_token>')
response = client.masking_sessions.delete_masking_session("session_uuid")
print(response)

Session status callback

Configure the “callback_url” with your web server URL to receive important session events and status updates. Plivo passes these events to the callback URL.

Attributes

NameTypeDescription
SessionFirstPartyAnswereventTriggered when the first party answers the call.
SessionSecondPartyRingeventTriggered when the second party’s phone starts ringing.
SessionSecondPartyAnswereventTriggered when the second party answers the call.
SessionSecondPartyHangupeventTriggered when the second party disconnects the call.
SessionFirstPartyHangupeventTriggered when the first party disconnects the call.
SessionPinAuthenticationStatuseventTriggered when the PIN authentication status is success, failed, or if the call is from an authorised caller.
SessionTimeouteventTriggered when the session expires.
SessionVirtualNumberReplacedeventTriggered when the number in the session is sub-optimal and replaced by a temporary, functional one. Update the virtual number accordingly.

Callback attributes

For each event, the below attributes will be posted to your web server.

NameTypeDescription
EventNamestringEvent that triggered this callback. This parameter will have one of the values from the list of events above.
EventTimestampstringTimestamp in UTC at which the event occurred.
SessionUUIDstringUnique ID of the masking session for which callback is sent. (Note: This field was repeated in the original table)
FromstringActual from number used to interact with the virtual number.
TostringActual to number dialing out from the virtual number.
PinAuthenticationStatusstringStatus of the PIN authentication during the interaction.
Possible values: success, failed, AuthorizedCaller
Success: When the PIN authentication is successful for either A-party or B-party.
Failed: When the PIN authentication failed (incorrect PIN or no input).
AuthorizedCaller: When the virtual number is dialed using an authorized caller.
PinRetryCounterintegerIndicates the PIN retry counter due to incorrect PIN input.
VirtualNumberstringThe virtual number used in the session.
AmountstringTotal amount incurred for the call.
BilledDurationstringDuration in seconds for which the call was billed.
DurationstringActual duration of the call in seconds.
PlivoHangupCausestringReason for the call termination.
PlivoHangupCauseCodeintegerA unique integer code for the termination cause.
SequenceNumberstringIndicates the sequence of the callback. Helpful for sorting events posted to the recording_callback_url.
null for events: SessionParamUpdate, SessionTimeout, SessionPinAuthenticationStatus.
import plivo

client = plivo.RestClient(auth_id='<auth_id>', auth_token='<auth_token>')
response = client.masking_sessions.delete_masking_session("session_uuid")
print(response)