Session Object
Number Masking
Create a number masking session
You create a number masking session using the real phone numbers of the two parties that need to be connected. Plivo returns a virtual number from your account in response to the API request.
- If one party makes a call to the virtual number, the call is connected to the other party.
- The caller ID of the outbound call to the second party is the Plivo virtual number.
This method creates a session to anonymously connect two participants.
POST
Attributes
Name | Type | Description |
---|---|---|
first_party | string (Required) | The actual phone number of the first party. |
second_party | string (Required) | The actual phone number of the second party. |
geomatch | Boolean (Optional) | Specifies if the country of the virtual number used for session allocation must match the first_party number. Default: true. |
is_pin_authentication_required | boolean | Specifies whether PIN authentication is necessary when the call originates from an unidentified caller. Default: false. |
generate_pin | boolean (Conditional) | Indicates if Plivo has to generate the PIN for the session. Only when is_pin_authentication_required is true. Default: false. |
generate_pin_length | int (Conditional) | Length of the PIN to be generated by Plivo. Applicable when generate_pin is true.Default: 4, Min: 4, Max: 15. |
first_party_pin | string | The PIN for the first party when using a secondary number. Must differ from second_party_pin .Length: 4-15 digits. |
second_party_pin | string | The PIN for the second party when using a secondary number. Must differ from first_party_pin .Length: 4-15 digits. |
subaccount | String (Optional) | Specifies the sub-account auth ID for which the session is created. |
pin_prompt_play | string | URL for playback prompting PIN entry. Required when PIN is activated. Must be .mp3 or .wav file. |
pin_retry | integer | Number of PIN retries allowed. Allowed: 0-5. Default: 1. |
pin_retry_wait | integer | Wait time in seconds before retrying PIN. Default: 5, Min: 5, Max: 10. |
incorrect_pin_play | string | URL for playback when incorrect PIN entered. Must be .mp3 or .wav file. |
unknown_caller_play | string | URL for playback when unknown caller calls the virtual number. Must be .mp3 or .wav file. |
record | boolean | Call recording status. Default: false. If true, recording starts after both parties answer. |
recording_callback_url | string | URL where call recordings are sent. |
record_file_format | string | Audio format for recording. Allowed: mp3, wav. Default: mp3. |
recording_callback_method | string | HTTP method to invoke recording_callback_url. Allowed: GET, POST. Default: POST. |
session_expiry | integer | Time in seconds after which session mapping ends. Default: 3600. |
call_time_limit | integer | Time in seconds after which the call disconnects. Default: 3600. |
initiate_call_to_first_party | boolean | If true, Plivo calls first party immediately and bridges to second party. Default: false. |
callback_url | string | URL to receive session events and status updates. |
callback_method | string | HTTP method to invoke callback_url. Allowed: GET, POST. Default: POST. |
ring_timeout | integer | Time in seconds after which ringing stops. Default: 120. |
first_party_play_url | string | URL to .mp3 or .wav file played to first party before connecting second party. |
second_party_play_url | string | URL to .mp3 or .wav file played to second party before connecting first party. |
create_session_with_single_party | boolean (Optional) | Allows session creation with only one party. Default: false. |
virtual_number_cooloff_period | integer (Optional) | Cool-off period in seconds before the virtual number can be reused. Default: 0, Max: 3600. |
force_pin_authentication | boolean (Conditional) | Requires PIN even for registered numbers. Only applies if PIN authentication is required. Default: false. |
The below parameters cannot be updated for the active session
- first_party
- Second_party
- initiate_call_to_first_party
- is_pin_authentication_required
- pin_prompt_play
- pin_retry
- pin_retry_wait
- incorrect_pin_play
- Unknown_caller_play
- geomatch
- subaccount