For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Platform docsVideosCommunitySign up
CapabilitiesGetting startedVoice AI OrchestrationVoxEngine PlatformAPI ReferenceFAQ
CapabilitiesGetting startedVoice AI OrchestrationVoxEngine PlatformAPI ReferenceFAQ
  • VoxEngine Development
    • VoxEngine concepts
    • Applications
    • Users
    • Scenarios
    • Routing rules
    • Phone numbers
    • Calls and sessions
    • Video calls
    • Management API
    • Account subusers
    • Integrations
    • Firewall
    • Cloud IDE
    • Type declarations
    • VoxEngine CI
    • Working with API requests
    • Working with the Voximplant's API
    • Remote session management
    • Key-value storage
    • Secret storage
    • Custom data
    • Limits and restrictions
    • Scenarios troubleshooting
    • How billing works
  • Management API
    • Overview
    • Developer Basics
    • Authorization
    • Callbacks
    • Child accounts
    • Accessing secure objects
  • Web and Mobile SDKs
    • iOS: CallKit
    • Android: ConnectionService
    • Screen sharing
    • Custom video sources
    • Mobile SDK statistics
LogoLogo
Platform docsVideosCommunitySign up
VoxEngine Development

Remote session management

Learn how to interact with an active session via HTTP in Voximplant.
||View as Markdown|
Was this page helpful?
Edit this page
Previous

Working with the Voximplant's API

Next

Key-value storage

Built with

On this page
  • URL management

Learn how to interact with an active session via HTTP.

URL management

If you start a call session with an HTTP request, you receive an object with the media_session_access_url property as a response:

Starting a scenario — Request
1curl "https://api.voximplant.com/platform_api/StartScenarios/?api_key=API_KEY&account_id=1&rule_id=1"
Starting a scenario — Response
1{
2 "result": 1,
3 "media_session_access_secure_url": "https:\/\/1.2.3.4:12092\/request\/AF307C280E30CCA6.1580999958.1204800_185.164.149.16\/90ABEE0D64BE5D84",
4 "media_session_access_url": "http:\/\/1.2.3.4:12092\/request\/AF307C280E30CCA6.1580999958.1204800_185.164.149.16\/90ABEE0D64BE5D84"
5}

This URL can be used for arbitrary tasks such as stopping scenarios or passing additional data to them. This is how you can make an HTTP request with additional data in it:

Managing the request — Request
1curl -d '{"param1": "value1", "param2": "value2"}' -H "Content-type: application/json" -X POST http:\/\/1.2.3.4:12092\/request\/F986320151BF8D91.1581003419.1231744_185.164.148.231\/AD12E50B42DD5CE4

Making an HTTP request on this URL results in the AppEvents.HttpRequest VoxEngine event being triggered in a scenario, with HTTP request data passed to it.

For example, if you need to write additional data to the log and then stop the session, you can write the following code in your VoxEngine scenario:

Stopping the scenario
1VoxEngine.addEventListener(AppEvents.Started, () => {
2 Logger.write('==========> Session is started');
3
4 VoxEngine.addEventListener(AppEvents.HttpRequest, (e) => {
5 Logger.write(e.content);
6 Logger.write('==========> Session is closing');
7 setTimeout(() => VoxEngine.terminate(), 300);
8 });
9});

After an HTTP request to media_session_access_url is performed, the session is terminated.

Key-value storage