<number>

Role: <number> keyword can be used to dial another number. This keyword can be used independently or it can be nested inside dial. Connecting to call to external number can cost extra depending on the service plan.

Use:

  • Connecting the call to another person based on time and location of the caller.

  • Using it along with IVR, where press 1 can go to sales person and press 1 can go to support number.

While there are no limitation on where <number> can be used, there is set of optional attributes to use with <number>. Below is a list of attributes to be used with <number>, each attribute has a specific function and can use certain values.

Attributes

Attribute

Value

Default

url

Callback URL

none

Method

POST/GET

POST

senddigits

any number digit

none

statusCallbackEvent

initiated, ringing, answered, completed

completed

statusCallback

status call back url

none

statusCallbackMethod

GET/POST

post

maxlength

integer value in seconds

4 hours

callerid

valid phone number

Caller’s ID

timout

Integer in seconds

30 seconds

record

on/off

off

Here is an example of how <number> is used within code.

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
         <number>19499300360</number>
 </Response>

No another example, <number> can be nested inside the <dial> command.

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
    <dial>
         <number maxlength=60 timeout=15>19499300360</number>
    </dial>
 </Response>

Attributes details:

url

If url is detected, phone system will execute the instruction set on the url to the called party. This happens only once the call is answered by the destination number and right before the call is connected to the original caller. This is useful if you want to play a small messaged to the called party. Remember caller is waiting for the call to be connected, so you might not want to make him wait for too long.

Sample callback URL

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
    <dial>
         <number url="https://www.didforsale.com/apidemo/calledurl.xml">19499300360</number>
    </dial>
 </Response>

sendDigits

This attribute, send dtmf digits once the call is answered. For example if you know call is being answered by the IVR and you digits needs to be pressed to connect the call to the destination number. There are two special key ‘w’ and ‘W’. If detect ‘w’ phone system wait for 0.5 seconds and if ‘W’ system wait for 1 second before sending next digits. Example ‘WWWW101’ system will wait for 5 seconds before sending 101.

Sample Send Digits

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
    <dial>
         <number sendDigits="www103">19499300360</number>
    </dial>
 </Response>

statusCallbackEvents

When the system made an outbound call, there are 4 things happens: “initiated”, means system is ready to make a call. “ringing” means end users phone is ringing, “answered”, enduser picked up the call, “completed”, end of the call. statusCallbackEvent event allows you to subscribe for for notifications for these events.

statusCallback

You must specify the users if you want to receive the events. This url will be calls for all the events.

statusCallback Parameters:

Here is list of parameters you receive for each event.

Parameter

Description

Called

Number Dialed

ParentCallSid

Call id of A Leg

CallStatus

One of the event “initiated, ringing, answered, completed”

Direction

Call Direction”Inbound/Outbound”

callSid

Orginal call ID

CallbackSource

call-progress-event

CallDurartion

Only on Completed Event

RecordingURL

If Recording Enabled and only on Completed Event

Example Call Status Events

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
    <dial>
         <Number url="http://www.businessphoneservice.us/phone/index2.xml" 
          statusCallbackEvent="initiated ringing answered completed" 
           statusCallback="http://www.businessphoneservice.us/phone/event.php" 
           statusCallbackMethod="POST">+19499300360</Number>
    </dial>
 </Response>

Advanced Options:

  • With dial and number commands you can call multiple users at the same time. Whoever answers first wins. This is great for simultaneous dialing.

  • If the call is answered automatically answered with a Voicemail, call will be connected to that leg. So need to be careful while using simultaneous calling.

Example Dialing Multiple Numbers Simultaneously

<?xml version="1.0" encoding="UTF-8"?> 
<Response>
    <dial>
         <Number>+19499300360</Number>
         <number>18005797676</number>
    </dial>
 </Response>

Running in any Issue? Need Help? Contact our support team or email us contact-support@didforsale.com.

Troubleshooting

  • Make sure attributes inside the nodes are in quotes " ".

Last updated