function telecoms.num.route

Routes a phone number to a defined destination (eg to another phone number, a route plan, etc).

Arguments:

argrequired?syntaxinfo
custIDNposintcustID of account that owns the number to be re-routed (default is your own account)
numberYposintnumber to be re-routed
routeto_typeYenum:nowhere|externally-routed|fax2email|number|routeplan|dayparting|sip|voicemail|ivrspecifies the destination type
destnumberconditionalposintfor routeto_type=number, the phone number to route to (no spaces)
routeplanIDconditionalposintfor routeto_type=routeplan, the routeplanID to route to
daypartIDconditionalposintfor routeto_type=dayparting, the dayparting ID where to route to
mailboxIDconditionalposintfor routeto_type=voicemail, the voicemail mailbox ID where to route to
ivrIDconditionalposintfor routeto_type=ivr, the ID of the IVR menu to route to
destargsconditionalarrayfor routeto_type=sip or routeto_type=fax2email, a sub-array of additional routing parameters

Further argument information

routeto_type

routeto_type can be one of:

destargs

For routeto_type=sip, a sub array consisting of:

For routeto_type=fax2email, a sub array consisting of:

Example 1

Route 08001231234 to 01123456789

JSON example request:

POST https://live.apicontrol.co.uk/1/json
{
    "auth" : {
        "username" : "YOURUSERNAME",
        "password" : "YOURPASSWORD",
    },
    "func" : "telecoms.num.route",
    "args" : {
       "number" : "08001231234",
       "destnumber" : "01123456789",
       "routeto_type" : "number"
    }
}

JSON example response:

{
   "results" : {
      "eventID" : "548836"
   },
   "success" : "1"
}

Example 2

Route 08001231234 to a route plan with routeplanID 2433.

JSON example request:

POST https://live.apicontrol.co.uk/1/json
{
    "auth" : {
        "username" : "YOURUSERNAME",
        "password" : "YOURPASSWORD",
    },
    "func" : "telecoms.num.route",
    "args" : {
       "routeplanID" : 2433,
       "number" : "08001231234",
       "routeto_type" : "routeplan"
    }
}

JSON example response:

{
   "success" : "1",
   "results" : {
      "eventID" : "548838"
   }
}

Example 3

Use 08001231234 as a fax number; specify the faxes to emailed as TIFF files to fred@example.com.

Perl example request:

JSON example request:

POST https://live.apicontrol.co.uk/1/json
{
    "auth" : {
        "username" : "YOURUSERNAME",
        "password" : "YOURPASSWORD",
    },
    "func" : "telecoms.num.route",
    "args" : {
       "number" : "08001231234",
       "destargs" : {
          "to_addr" : "fred@example.com",
          "format" : "tiff"
       },
       "routeto_type" : "fax2email"
    }
}

JSON example response:

{
   "results" : {
      "eventID" : "548837"
   },
   "success" : "1"
}