Rate this page:

How to send data to the call

You can send info from a call to Voximplant servers and vice versa. Learn how and when you can do it.

Headers

You can send extra headers while:

  • creating a call
  • answering a call
X-headers: creating a call

X-headers: creating a call

X-headers: answering a call

X-headers: answering a call

You can receive extra headers when a call is disconnected:

X-headers: terminating a session

X-headers: terminating a session

Send message

There is a sendMessage method within the Call class. It allows sending arbitrary data in string format from Voximplant servers to a user endpoint.

sendMessage() call

sendMessage() call

To handle such data coming to a call from an SDK, use the MessageReceived event.

X-headers

You can also retrieve X-headers from this event, examine the code below.

MessageReceived event

MessageReceived event

CustomData

There are two kinds of the customData values: one is for a JavaScript session (i.e., VoxEngine object), another is for the particular call (i.e., Call.customData and Web SDK parameter of the method). It's possible to use them at the same time because they are independent entities.

Remember that if you receive some value from the Wed SDK, it doesn't overwrite the VoxEngine's value. Any of customData's type values can be later obtained from Call History using HTTP API or Control Panel.

customData

customData