This entire `try {} catch() {}` block is old, rickety, and needs to be reworked. `PhoneNumber::validatePhoneNumber()` will throw a validation exception that we catch and re-raise as a `VBX_CallException()`. This should be smarter about the different formats that are passed in and throw context appropriate exceptions.

I can work on this after merging the request, but if you want to take a whack at it my preliminary thought is that it should be something like:

```php
try {

	foreach (array('from' => $from, 'to' => $to) as $type => $value) 
	{
		// to
		if (PhoneNumber::analyzePhoneNumber($value) != PhoneNumber::TYPE_UNKNOWN) 
		{
			PhoneNumber::validatePhoneNumber($value);
		} 
		elseif (strpos($value, 'sip') !== false && !validate_sip_address($value)) 
		{
			throw new Exception(sprintf('%s phone number %s is not a valid sip address', $type, $value));
		} 
		elseif (strpos($value, '@') !== false && !filter_var($value, FILTER_VALIDATE_EMAIL)) 
		{
			throw new Exception(sprintf('%s phone number %s is not a valid email address', $type, $value));
		}
		else 
		{
			throw new Exception(sprintf('Could not validate %s phone number: %s' $type, $value));
		}
	}
	
} catch (Exception $e) {
	throw new VBX_CallException($e->getMessage);

}
```

Its a lot more strict and more informative on malformed data.