foreach ($msg->parameters as $param) {
switch ($param->type) {
case EDSS1_Parameter::CALLING_PARTY_NUMBER:
- $call->from = $param->number;
+ $call->from = $this->getFullNumber(
+ $param->number, $param->numberType
+ );
break;
case EDSS1_Parameter::CALLED_PARTY_NUMBER:
- $call->to = $param->number;
+ $call->to = $this->getFullNumber(
+ $param->number, $param->numberType
+ );
break;
}
}
}
+
+
+ protected function getFullNumber($number, $type)
+ {
+ if ($type == EDSS1_Parameter_Names::NUMBER_NATIONAL) {
+ return '0' . $number;
+ }
+ return $number;
+ }
}
?>
*/
class EDSS1_Parameter_Names extends EDSS1_Parameter
{
+ const NUMBER_UNKNOWN = 0;
+ const NUMBER_INTERNATIONAL = 1;
+ const NUMBER_NATIONAL = 2;
+ const NUMBER_NETWORKSPECIFIC = 3;
+ const NUMBER_SUBSCRIBER = 4;
+ const NUMBER_ABBREV = 5;
+
static $numberTypes = array(
0 => 'Unknown',
1 => 'International number',