Guides

Send DTMF

This guide uses the full SIP.js API. The Simple User is intended to help get beginners up and running quickly. This guide is adopted from the SIP.js Github API documentation.

Prerequisites

See the User Agent guide on how to create a user agent. This guide requires a registered user agent.

See the Make a Call guide on how to make a call.

See the Receive a Call guide on how to receive a call.

DTMF INFO Body

A DTMF tone can be a SIP INFO packet with a specific body to be interpreted by another SIP endpoint. You will need to create the body of the packet to send. The fields needed to send a DTMF INFO are the contentDisposition, contentType, content.

The contentDisposition field should be set to render. This tells the endpoint to render the content to the user.

The contentType field should be set to application/dtmf-relay. This tells the endpoint that message is a DTMF message.

The content field needs to contain the Signal=<DTMF_SIGNAL> and Duration=<DTMF_DURATION> each on it’s own line. This tells the application the signal to send and how long it was sent for.

const options = {
  requestOptions: {
    body: {
      contentDisposition: "render",
      contentType: "application/dtmf-relay",
      content: "Signal=1\r\nDuration=1000"
    }
  }
};

Send The Message

Once the body is constructed the message can be sent by calling the session.info(options) function.

infoer.info(options);