Send a Message
Let’s walk through how to send a message.
We must create the files index.html and main.js in the same folder. In the index.html file we can include the SIP.js library, as well as the main.js file. We are assuming SIP.js is imported as a node module for this demo.
<button> element is included to determine when to send the message.
Creating the User Agent
In order to send messages, create a SIP user agent. Calling
SIP.UA() method, with no parameters, creates an anonymous user agent.
Sending the Message
After the user agent has been created we can send the message.
To send the message, call the
.message(target, body) method, along with the address that the message is being sent to in the
target argument and the message that we are sending in the
Add a click event to the
<button> element, that calls the