Skip to content

Instantly share code, notes, and snippets.

@Gipetto
Created December 8, 2011 18:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Gipetto/1447888 to your computer and use it in GitHub Desktop.
Save Gipetto/1447888 to your computer and use it in GitHub Desktop.
Inserting custom numbers in to the CallerId list (hack)
<?php // do not copy this line
// Add this code to `OpenVBX/controllers/iframe.php`
// In the 1.0.x branch insert the following on line 53
// In the 1.1.x branch insert the following on line 66
// Create a list of extra caller id numbers to add
// These numbers need to be validated in Twilio
// Validated numbers are listed in your Twilio Account: https://www.twilio.com/user/account/phone-numbers/verified
$custom_numbers = array(
(object) array(
'id' => null,
'flow_id' => null,
'name' => '(415) 000-0000', // friendly formatted number
'phone' => '(415) 000-0000', // friendly formatted number
'pin' => null,
'sandbox' => null,
'url' => null,
'method' => null,
'smsUrl' => null,
'smsMethod' => null,
'capabilities' => 'voice',
'voiceApplicationSid' => null
),
// add another object here if you have more than 1 number to add
);
// iterate the above list and PREPEND the numbers to the list of numbers
// so that they show up first
foreach ($custom_numbers as $number)
{
array_unshift($data['callerid_numbers'], $number);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment