Dial

From SoftIVR

Jump to: navigation, search

dial

dial(number [,options]) dials a specified number and, optionally, bridges the current caller to it.

The number can refer to a SIP extension on the IVR, if its is in the range 2000-2024, or an external number. Numbers to dial should be formatted as '+' followed by the country code and the rest of the number; for example:

  • +44800500005 - the BT newsline in the UK
  • +18002992534 - IDT's calling card in the USA

One exception to this is calling UK directory enquiries numbers, where the number is of the form 118000 to 118999, and is just dialled as-is.

Alternatively, the number can be of the form gtalk:<contact address> - e.g. gtalk:softivr.call@googlemail.com - and a voice call will be established to that Google Talk user.

The following options are supported:

  • caller_id=<caller ID> - sets the caller ID for the outbound call. This should be of the form '+' + country code + number - e.g. +442081145002.
  • carrier=[bt|att|verizon] - sets the outbound carrier to use for the call.
  • service=<service name>[(<parameter list>)] - launches the outbound call, and, rather than bridging the inbound leg to it, connects the outbound call to the specified service. An optional parameter list can be passed to the service.

Return values

The dial function returns a string containing the status of the outbound call at its termination, or one of:

  • ERROR_NO_CREDIT - not enough credit to make this call
  • ERROR_INVALID_NUMBER - number format invalid

See the callthrough example for more information as to how to make outbound calls.

Return to Javascript functions.