[Bug fixes in PSTN provisioning Adrian Georgescu **20090702102842] hunk ./library/ngnpro_client.php 176 - 'description' => 'Manage phone numbers used for incoming calls and their mappings (e.g. +31123456789 map to sip:user@example.com). Use _ or % to match one or more characters. ' + 'description' => 'Manage E164 numbers used for incoming calls and their mappings (e.g. +31123456789 map to sip:user@example.com). Use _ or % to match one or more characters. ' hunk ./library/ngnpro_client.php 183 - 'description' => 'Manage phone number ranges that hold individual phone numbers. Use _ or % to match one or more characters. ' + 'description' => 'Manage E164 number ranges that hold individual phone numbers. Use _ or % to match one or more characters. ' hunk ./library/ngnpro_client.php 227 - 'description' => 'Manage carriers for outbound PSTN traffic. ', + 'description' => 'Manage outbound carriers for PSTN traffic. Click on Carier to edit its attributes. ', hunk ./library/ngnpro_client.php 235 - 'description' => 'Manage outbound PSTN gateways. Click on gateway to edit its attributes. ', + 'description' => 'Manage outbound PSTN gateways. Click on Gateway to edit its attributes. ', hunk ./library/ngnpro_client.php 243 - 'description' => 'Managed PSTN via carriers. Use _ or % to match one or more characters. ', + 'description' => 'Manage outbound PSTN routes. A prefix must be formated as 00+E164, an empty prefix matches all routes. ', hunk ./library/ngnpro_client.php 251 - 'description' => 'Manage rules for outbound PSTN gateways. Click on rule to edit its attributes.', + 'description' => 'Manage translation rules for PSTN gateways. Rules are applied against 00+E164 prefix. Click on Rule to edit its attributes. ', hunk ./library/ngnpro_client.php 1302 + function getGateways () { + if (count($this->gateways)) return true; + + $Query=array('filter' => array('name'=>''), + 'orderBy' => array('attribute' => 'name', + 'direction' => 'ASC' + ), + 'range' => array('start' => 0, + 'count' => 1000) + ); + + $this->SoapEngine->soapclient->addHeader($this->SoapEngine->SoapAuth); + $result = $this->SoapEngine->soapclient->getGateways($Query); + + if (PEAR::isError($result)) { + $error_msg = $result->getMessage(); + $error_fault= $result->getFault(); + $error_code = $result->getCode(); + printf ("

Error from %s: %s (%s): %s",$this->SoapEngine->SOAPurl,$error_msg, $error_fault->detail->exception->errorcode,$error_fault->detail->exception->errorstring); + return false; + } else { + foreach ($result->gateways as $_gateway) { + $this->gateways[$_gateway->id]=sprintf("%s, Carrier %s",$_gateway->name,$_gateway->carrier); + } + } + } + hunk ./library/ngnpro_client.php 8744 - + hunk ./library/ngnpro_client.php 8769 - hunk ./library/ngnpro_client.php 8789 - %s + %s hunk ./library/ngnpro_client.php 9253 - $_rules_url = $this->url.sprintf("&service=gateway_rules@%s&gateway_filter=%s&reseller_filter=%s", + $_rules_url = $this->url.sprintf("&service=gateway_rules@%s&gateway_id_filter=%s&reseller_filter=%s", hunk ./library/ngnpro_client.php 9337 - printf (" Carrier: "); + printf (" Carrier "); hunk ./library/ngnpro_client.php 9347 - printf (" Transport: "); + printf (" Transport "); hunk ./library/ngnpro_client.php 9381 + hunk ./library/ngnpro_client.php 9387 + hunk ./library/ngnpro_client.php 9393 + hunk ./library/ngnpro_client.php 9676 - 'id' => array('type'=>'integer','readonly' => true), - 'gateway' => array('type'=>'string'), - 'carrier_id'=> array('type'=>'integer', 'name' => 'Carrier'), - 'prefix' => array('type'=>'string'), - 'strip' => array('type'=>'integer'), - 'prepend' => array('type'=>'string'), - 'minLength' => array('type'=>'integer'), - 'maxLength' => array('type'=>'integer') + 'id' => array('type'=>'integer','readonly' => true), + 'gateway_id' => array('type'=>'integer','name' => 'Gateway'), + 'prefix' => array('type'=>'string'), + 'strip' => array('type'=>'integer'), + 'prepend' => array('type'=>'string'), + 'minLength' => array('type'=>'integer'), + 'maxLength' => array('type'=>'integer') hunk ./library/ngnpro_client.php 9687 - 'gateway' => trim($_REQUEST['gateway_filter']), + 'gateway_id' => trim($_REQUEST['gateway_id_filter']), hunk ./library/ngnpro_client.php 9695 - 'carrier_id' => 'Carrier', + 'carrier' => 'Carrier', hunk ./library/ngnpro_client.php 9710 - $filter=array('id' => intval($this->filters['id']), - 'gateway' => $this->filters['gateway'], - 'carrier_id'=> intval($this->filters['carrier_id']), - 'prefix' => $this->filters['prefix'], - 'customer' => intval($this->filters['customer']), - 'reseller' => intval($this->filters['reseller']) + $filter=array('id' => intval($this->filters['id']), + 'gateway_id' => intval($this->filters['gateway_id']), + 'carrier_id' => intval($this->filters['carrier_id']), + 'prefix' => $this->filters['prefix'], + 'customer' => intval($this->filters['customer']), + 'reseller' => intval($this->filters['reseller']) hunk ./library/ngnpro_client.php 9760 - Rule hunk ./library/ngnpro_client.php 9761 + Rule hunk ./library/ngnpro_client.php 9845 - %s - %s + %s (%d) + %s (%d) hunk ./library/ngnpro_client.php 9857 - $_url, $gateway_rule->id, hunk ./library/ngnpro_client.php 9858 - $_carrier_url, $gateway_rule->carrier, - $_gateway_url, $gateway_rule->gateway, + $_url, $gateway_rule->id, + $_carrier_url, $gateway_rule->carrier,$gateway_rule->carrier_id, + $_gateway_url, $gateway_rule->gateway,$gateway_rule->gateway_id, hunk ./library/ngnpro_client.php 9896 - $this->getCarriers(); + $this->getGateways(); hunk ./library/ngnpro_client.php 9898 - if (!count($this->carriers)) { - print "

Create a carrier first"; + if (!count($this->gateways)) { + print "

Create a gateway first"; hunk ./library/ngnpro_client.php 9918 - printf (" Gateway "); - - printf (" Carrier: "); - - print " "; + foreach (array_keys($this->gateways) as $_gateway) { + printf ("

Error: Missing gateway or carrier"); + if (!strlen($gateway_id)) { + printf ("

Error: Missing gateway id"); hunk ./library/ngnpro_client.php 9985 - 'gateway' => $gateway, - 'carrier_id' => intval($carrier_id), + 'gateway_id' => intval($gateway_id), hunk ./library/ngnpro_client.php 10030 - printf (" Gateway ",$this->filters['gateway']); hunk ./library/ngnpro_client.php 10033 + hunk ./library/ngnpro_client.php 10041 + printf (" Gateway ",$this->filters['gateway_id']); + printf (" Prefix ",$this->filters['prefix']); hunk ./library/ngnpro_client.php 10088 - if ($item == 'carrier_id') { + if ($item == 'gateway_id') { hunk ./library/ngnpro_client.php 10090 - $selected_carrier[$rule->$item]='selected'; - foreach ($this->carriers as $_grp) { - printf ("