Exemplo n.º 1
0
 /**
  * Processa os dados de um objeto em um array associativo que pode ser
  * usado para manipulação do banco de dados.
  *
  * @param Snep_Exten $exten
  * @return array string
  */
 private function getExtenDataAsArray(Snep_Exten $exten)
 {
     $extenData = array("context" => "default", "peer_type" => "R", "name" => $exten->getNumero(), "fromuser" => $exten->getNumero(), "username" => $exten->getNumero(), "callerid" => $exten->getCallerid(), "password" => $exten->getPassword(), "pickupgroup" => $exten->getPickupGroup(), "canal" => $exten->getInterface()->getCanal(), "group" => $exten->getGroup(), "email" => $exten->getEmail(), "usa_vc" => $exten->hasVoiceMail(), "mailbox" => $exten->getMailBox(), "authenticate" => $exten->isLocked(), "time_total" => $exten->getTimeTotal(), "time_chargeby" => $exten->getCtrlType());
     /**
      * Adicionando informações específica de interface.
      */
     if ($exten->getInterface() instanceof PBX_Asterisk_Interface_SIP || $exten->getInterface() instanceof PBX_Asterisk_Interface_IAX2) {
         $interface = $exten->getInterface();
         $extenData['allow'] = $interface->allow;
         $extenData['type'] = $interface->type;
         $extenData['secret'] = $interface->secret;
         $extenData['qualify'] = $interface->qualify;
         $extenData['dtmfmode'] = $interface->dtmfmode;
         $extenData['call-limit'] = $interface->{'call-limit'};
         $extenData['nat'] = $interface->nat;
     }
     return $extenData;
 }