Create and manage anonymous calling sessions between two parties using virtual phone numbers
Number masking sessions establish anonymous connections between two phone numbers. When a session is created, Plivo assigns a virtual number that either party can call to connect to the other without revealing their actual phone numbers.API Endpoint
The Interaction object is nested within a session. A masking session can contain multiple interactions. Each interaction within a session has a maximum of two communication legs, regardless of the direction of the call.
Attributes
string
URL of the call-leg resource created for the first party. This field is null if a call is exchanged between the Plivo virtual number and the second party but has not yet been initiated for the first party.
string
URL of the call-leg resource created for the second party. This field is null if a call is exchanged between the Plivo virtual number and the first party but has not yet been initiated for the second party.
string
URL of the recording resource for the interaction. This field will be null when one of the participants didn’t pick up the call.
Create a Session
Create a number masking session using the real phone numbers of two parties. Plivo returns a virtual number from your account that either party can call to connect anonymously.
POST https://api.plivo.com/v1/Account/{auth_id}/Masking/Session
Arguments
string
required
The actual phone number of the first party.
string
required
The actual phone number of the second party.
boolean
Specifies if the country of the virtual number must match the first_party number. Default: true.
string
Specifies the sub-account auth ID for which the session is created.
integer
Time in seconds after which session mapping ends. Default: 3600.
integer
Time in seconds after which the call disconnects. Default: 3600.
integer
Time in seconds after which ringing stops. Default: 120.
boolean
If true, Plivo calls first party immediately and bridges to second party. Default: false.
string
URL to receive session events and status updates.
string
HTTP method to invoke callback_url. Values: GET, POST. Default: POST.
boolean
Call recording status. Default: false. If true, recording starts after both parties answer.
string
URL where call recordings are sent.
string
Audio format for recording. Values: mp3, wav. Default: mp3.
string
HTTP method to invoke recording_callback_url. Values: GET, POST. Default: POST.
string
URL to .mp3 or .wav file played to first party before connecting.
string
URL to .mp3 or .wav file played to second party before connecting.
boolean
Specifies whether PIN authentication is necessary for unidentified callers. Default: false.
boolean
Indicates if Plivo generates the PIN. Only when is_pin_authentication_required is true. Default: false.
integer
Length of the PIN to be generated. Applicable when generate_pin is true. Default: 4, Min: 4, Max: 15.
string
The PIN for the first party. Must differ from second_party_pin. Length: 4-15 digits.
string
The PIN for the second party. Must differ from first_party_pin. Length: 4-15 digits.
string
URL for playback prompting PIN entry. Required when PIN is activated. Must be .mp3 or .wav.
integer
Number of PIN retries allowed. Values: 0-5. Default: 1.
integer
Wait time in seconds before retrying PIN. Default: 5, Min: 5, Max: 10.
string
URL for playback when incorrect PIN entered. Must be .mp3 or .wav.
string
URL for playback when unknown caller calls the virtual number. Must be .mp3 or .wav.
boolean
Requires PIN even for registered numbers. Only applies if PIN authentication is required. Default: false.
boolean
Allows session creation with only one party. Default: false.
integer
Cool-off period in seconds before the virtual number can be reused. Default: 0, Max: 3600.
The following parameters cannot be updated during an active session:
using Plivo;var api = new PlivoApi("<auth_id>", "<auth_token>");var response = api.MaskingSession.Create( firstParty: "+12025550000", secondParty: "+12025551111");Console.WriteLine(response);
using Plivo;var api = new PlivoApi("<auth_id>", "<auth_token>");var response = api.MaskingSession.Get(sessionUuid: "<session_uuid>");Console.WriteLine(response);
Object containing pagination metadata (meta: limit, offset, total_count, and next/previous page URLs) and an objects array of session objects — see The Session Object.
using Plivo;var api = new PlivoApi("<auth_id>", "<auth_token>");var response = api.MaskingSession.Update( sessionUuid: "<session_uuid>", sessionExpiry: 6000);Console.WriteLine(response);
using Plivo;var api = new PlivoApi("<auth_id>", "<auth_token>");var response = api.MaskingSession.Delete(sessionUuid: "<session_uuid>");Console.WriteLine(response);