<?php
global $NAMESPACE;
// ==== WSDL TYPES DECLARATION =================================================

// ---- int[] ------------------------------------------------------------------

$server->wsdl->addComplexType(
    'intArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:int[]')
    ),
    'xsd:int'
);

// ---- string[] ------------------------------------------------------------------

$server->wsdl->addComplexType(
    'stringArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'xsd:string[]')
    ),
    'xsd:string'
);


// ---- AssociativeArray -----------------------------------------------------------------

$server->wsdl->addComplexType(
    'Associative',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'key'            => array('name'=>'key',  'type'=>'xsd:string'),
        'value'          => array('name'=>'value','type'=>'xsd:string')
    )
);

// ---- AssociativeArray[] ---------------------------------------------------------------

$server->wsdl->addComplexType(
    'AssociativeArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Associative[]')),
    'tns:Associative'
);


// ---- Entity -----------------------------------------------------------------

$server->wsdl->addComplexType(
    'Entity',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'            => array('name'=>'id','type'=>'xsd:int'),
        'type'          => array('name'=>'type','type'=>'xsd:int'),
        'key'           => array('name'=>'key','type'=>'xsd:int')
    )
);

// ---- Entity[] ---------------------------------------------------------------

$server->wsdl->addComplexType(
    'EntityArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Entity[]')),
    'tns:Entity'
);


// ---- Group ------------------------------------------------------------------

$server->wsdl->addComplexType(
    'Group',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'type'        => array('name'=>'type','type'=>'xsd:int'),
        'metagroup'   => array('name'=>'metagroup','type'=>'xsd:int'),
        'entity'      => array('name'=>'entity','type'=>'tns:intArray')
    )
);

// ---- Group[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'GroupArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Group[]')
    ),
    'tns:Group'
);

// ---- Client -----------------------------------------------------------------

$server->wsdl->addComplexType(
    'Client',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'surname'     => array('name'=>'surname','type'=>'xsd:string'),
        'extension'   => array('name'=>'extension','type'=>'xsd:string'),
        'alias'       => array('name'=>'alias','type'=>'xsd:string'),
        'username'    => array('name'=>'username','type'=>'xsd:string'),
        'password'    => array('name'=>'password','type'=>'xsd:string'),
        'language'    => array('name'=>'language','type'=>'xsd:string'),
        'options'     => array('name'=>'options','type'=>'tns:AssociativeArray'),
        'groups'      => array('name'=>'groups','type'=>'tns:intArray'),
        'rule'        => array('name'=>'rule','type'=>'xsd:int'),
        'technology'  => array('name'=>'technology','type'=>'xsd:int'),
        'voicemail'   => array('name'=>'voicemail','type'=>'tns:VoiceMail')
    )
);

// ---- Client[] ---------------------------------------------------------------

$server->wsdl->addComplexType(
    'ClientArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Client[]')
    ),
    'tns:Client'
);

// ---- Office -------------------------------------------------------------

$server->wsdl->addComplexType(
    'Office',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'speeddial'   => array('name'=>'speeddial','type'=>'xsd:string'),
        'inkey'       => array('name'=>'inkey','type'=>'xsd:string'),
        'username'    => array('name'=>'username','type'=>'xsd:string'),
        'password'    => array('name'=>'password','type'=>'xsd:string'),
        'host'        => array('name'=>'host','type'=>'xsd:string'),
        'port'        => array('name'=>'port','type'=>'xsd:int'),
        'register'    => array('name'=>'register','type'=>'xsd:int'),
        'did'         => array('name'=>'did','type'=>'xsd:int'),
        'options'     => array('name'=>'options','type'=>'tns:AssociativeArray'),
        'numbers'     => array('name'=>'numbers','type'=>'tns:stringArray'),
        'groups'      => array('name'=>'groups','type'=>'tns:intArray'),
        'rule'        => array('name'=>'rule','type'=>'xsd:int')
    )
);

// ---- Office[] --------------------------------------------------------------

$server->wsdl->addComplexType(
    'OfficeArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Office[]')
    ),
    'tns:Office'
);

// ---- Provider ---------------------------------------------------------------

$server->wsdl->addComplexType(
    'Provider',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'speeddial'   => array('name'=>'speeddial','type'=>'xsd:string'),
        'username'    => array('name'=>'username','type'=>'xsd:string'),
        'password'    => array('name'=>'password','type'=>'xsd:string'),
        'host'        => array('name'=>'host','type'=>'xsd:string'),
        'port'        => array('name'=>'port','type'=>'xsd:string'),
        'did'         => array('name'=>'did','type'=>'xsd:string'),
        'numbers'     => array('name'=>'numbers','type'=>'tns:intArray'),
        'technology'  => array('name'=>'technology','type'=>'xsd:int'),
        'options'     => array('name'=>'options','type'=>'tns:AssociativeArray'),
        'groups'      => array('name'=>'groups','type'=>'tns:intArray'),
        'rule'        => array('name'=>'rule','type'=>'xsd:int')
    )
);

// ---- Provider[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'ProviderArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Provider[]')
    ),
    'tns:Provider'
);

// ---- Technology ---------------------------------------------------------------

$server->wsdl->addComplexType(
    'Technology',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'voip'        => array('name'=>'voip','type'=>'xsd:int'),
        'config_file' => array('name'=>'config_file','type'=>'xsd:string'),
        'realtime'    => array('name'=>'realtime','type'=>'xsd:int'),
        'table'       => array('name'=>'table','type'=>'xsd:string')
    )
);

// ---- Technology[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'TechnologyArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Technology[]')
    ),
    'tns:Technology'
);

// ---- PhoneNumber ------------------------------------------------------------

$server->wsdl->addComplexType(
    'PhoneNumber',
    'complexType',
    'struct',
    'all',
    '$NAMESPACE',
    array(
        'id'        => array('name'=>'id','type'=>'xsd:int'),
        'name'      => array('name'=>'name','type'=>'xsd:string'),
        'number'    => array('name'=>'number','type'=>'tns:stringArray'),
        'emergency' => array('name'=>'emergendy','type'=>'xsd:int'),
        'groups'    => array('name'=>'groups','type'=>'tns:intArray')
    )
);

// ---- PhoneNumber[] ----------------------------------------------------------

$server->wsdl->addComplexType(
    'PhoneNumberArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:PhoneNumber[]')),
    'tns:PhoneNumber'
);


// ---- Queue ------------------------------------------------------------------

$server->wsdl->addComplexType(
    'Queue',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'                  => array('name'=>'id','type'=>'xsd:int'),
        'name'                => array('name'=>'name','type'=>'xsd:string'),
        'strategy'            => array('name'=>'strategy','type'=>'xsd:string'),
        'music'               => array('name'=>'music','type'=>'xsd:string'),
        'announce-frequency'  => array('name'=>'announce-frequency','type'=>'xsd:int'),
        'announce-holdtime'   => array('name'=>'announce-holdtime','type'=>'xsd:string'),
        'joinempty'           => array('name'=>'joinempty','type'=>'xsd:string'),
        'member'              => array('name'=>'member','type'=>'tns:intArray')
    )
);

// ---- Queue[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'QueueArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Queue[]')
    ),
    'tns:Queue'
);

// ---- Ivr --------------------------------------------------------------------

$server->wsdl->addComplexType(
    'Ivr',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'                  => array('name'=>'id','type'=>'xsd:int'),
        'name'                => array('name'=>'name','type'=>'xsd:string'),
        'rootnode'            => array('name'=>'rootnode','type'=>'xsd:int')
    )
);

// ---- Ivr[] ------------------------------------------------------------------

$server->wsdl->addComplexType(
    'IvrArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Ivr[]')
    ),
    'tns:Ivr'
);


// ---- IvrNode ----------------------------------------------------------------

$server->wsdl->addComplexType(
    'IvrNode',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'parent'      => array('name'=>'parent','type'=>'xsd:int'),
        'order'       => array('name'=>'order','type'=>'xsd:int'),
        'key'         => array('name'=>'key','type'=>'xsd:string'),
        'audio'       => array('name'=>'audio','type'=>'xsd:string'),
        'macro'       => array('name'=>'macro','type'=>'xsd:int'),
        'parameter'   => array('name'=>'parameter','type'=>'xsd:string'),
        'timesegment' => array('name'=>'timesegment','type'=>'xsd:int'),
        'taudio'      => array('name'=>'taudio','type'=>'xsd:string'),
        'trepeat'     => array('name'=>'trepeat','type'=>'xsd:int'),
        'iaudio'      => array('name'=>'iaudio','type'=>'xsd:string'),
        'irepeat'     => array('name'=>'irepeat','type'=>'xsd:int')
    )
);

// ---- IvrNode[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'IvrNodeArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:IvrNode[]')
    ),
    'tns:IvrNode'
);



// ---- Option ------------------------------------------------------------------

$server->wsdl->addComplexType(
    'Option',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'                  => array('name'=>'id',       'type'=>'xsd:int'),
        'general_section'     => array('name'=>'general_section',     'type'=>'xsd:int'),
        'default_section'     => array('name'=>'default_section',     'type'=>'xsd:int'),
        'advanced_option'     => array('name'=>'advanced_option',     'type'=>'xsd:int'),
        'name'                => array('name'=>'name',     'type'=>'xsd:string'),
        'value'               => array('name'=>'value',    'type'=>'xsd:string'),
        'category'            => array('name'=>'category', 'type'=>'xsd:string'),
        'default'             => array('name'=>'default',  'type'=>'xsd:string'),
        'valuelist'           => array('name'=>'valuelist','type'=>'xsd:string'),
        'type'                => array('name'=>'type',     'type'=>'xsd:string'),
        'comment'             => array('name'=>'comment',  'type'=>'xsd:string'),
        'commented'           => array('name'=>'commented','type'=>'xsd:int')
    )
);

// ---- Option[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'OptionArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Option[]')
    ),
    'tns:Option'
);

// ---- ISDN Card --------------------------------------------------------------

$server->wsdl->addComplexType(
    'Card',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'                  => array('name'=>'id',      'type'=>'xsd:int'),
        'name'                => array('name'=>'name',    'type'=>'xsd:string'),
        'ports'                => array('name'=>'ports',    'type'=>'xsd:int'),
        'driver'                => array('name'=>'driver',    'type'=>'xsd:string')
    )
);

// ---- ISDN Card[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'CardArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Card[]')
    ),
    'tns:Card'
);

// ---- ISDN Port --------------------------------------------------------------

$server->wsdl->addComplexType(
    'Port',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'                  => array('name'=>'id',      'type'=>'xsd:int'),
        'port'                => array('name'=>'port',    'type'=>'xsd:int'),
        'layermask'           => array('name'=>'layermask','type'=>'xsd:string'),
        'protocol'            => array('name'=>'protocol',    'type'=>'xsd:string'),
        'card'                => array('name'=>'card',    'type'=>'xsd:int'),
        'card_id'             => array('name'=>'card',    'type'=>'xsd:int'),
        'available'           => array('name'=>'available','type'=>'xsd:int')
    )
);

// ---- ISDN Port[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'PortArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Port[]')
    ),
    'tns:Port'
);

// ---- ISDN Group --------------------------------------------------------------

$server->wsdl->addComplexType(
    'IsdnGroup',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'            => array('name'=>'id',          'type'=>'xsd:int'),
        'name'          => array('name'=>'name',        'type'=>'xsd:string'),
        'channel_order' => array('name'=>'channel_order', 'type'=>'xsd:int'),
        'msns'          => array('name'=>'msns',        'type'=>'tns:stringArray'),
        'port'          => array('name'=>'port',        'type'=>'tns:intArray'),
        //'rule'        => array('name'=>'rule',        'type'=>'xsd:int'),
        'speeddial'     => array('name'=>'speeddial',   'type'=>'xsd:string'),
        'port_type'     => array('name'=>'port_type',   'type'=>'xsd:string'),
        'did'           => array('name'=>'did',         'type'=>'xsd:int'),
        'option'        => array('name'=>'option',      'type'=>'tns:AssociativeArray')
    )
);

// ---- ISDN Group[] -------------------------------------------------------------

$server->wsdl->addComplexType(
    'IsdnGroupArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:IsdnGroup[]')
    ),
    'tns:IsdnGroup'
);

// ---- Action --------------------------------------------------------

$server->wsdl->addComplexType(
    'Action',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'       => array('name'=>'id',   'type'=>'xsd:int'),
        'name'     => array('name'=>'name','type'=>'xsd:string'),
        'fax'      => array('name'=>'fax',   'type'=>'xsd:int'),
        'app'      => array('name'=>'app','type'=>'tns:stringArray'),
        'appdata'  => array('name'=>'appdata','type'=>'tns:stringArray')
    )
);

// ---- Action[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'ActionArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Action[]')
    ),
    'tns:Action'
);

// ---- VoiceMail --------------------------------------------------------------

$server->wsdl->addComplexType(
    'VoiceMail',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'mailbox'     => array('name'=>'mailbox',     'type'=>'xsd:int'),
        'fullname'    => array('name'=>'fullname',    'type'=>'xsd:string'),
        'password'    => array('name'=>'password',    'type'=>'xsd:string'),
        'email'       => array('name'=>'email',       'type'=>'xsd:string'),
        'attach'      => array('name'=>'attach',      'type'=>'xsd:string'),
        'saycid'      => array('name'=>'saycid',      'type'=>'xsd:string'),
        'hidefromdir' => array('name'=>'hidefromdir', 'type'=>'xsd:string')
    )
);

// ---- VoiceMail[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'VoiceMailArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:VoiceMail[]')
    ),
    'tns:VoiceMail'
);



// ---- Directory --------------------------------------------------------------

$server->wsdl->addComplexType(
    'Directory',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'name'        => array('name'=>'name',     'type'=>'xsd:string'),
        'username'    => array('name'=>'username', 'type'=>'xsd:string'),
        'status'      => array('name'=>'status',   'type'=>'xsd:string')
    )
);

// ---- Directory[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'DirectoryArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Directory[]')
    ),
    'tns:Directory'
);

// ---- User --------------------------------------------------------------

$server->wsdl->addComplexType(
    'User',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'        => array('name'=>'id',       'type'=>'xsd:int'),
        'fullname'  => array('name'=>'fullname', 'type'=>'xsd:string'),
        'username'  => array('name'=>'username', 'type'=>'xsd:string'),
        'password'  => array('name'=>'password', 'type'=>'xsd:string'),
        'lang'      => array('name'=>'lang',     'type'=>'xsd:string'),
        'entity_id' => array('name'=>'entity_id','type'=>'xsd:int'),
        'exten'     => array('name'=>'exten',    'type'=>'xsd:string'),
        'technology'=> array('name'=>'technology','type'=>'xsd:int'),
        'type'      => array('name'=>'type',     'type'=>'xsd:int')
    )
);

// ---- User[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'UserArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:User[]')
    ),
    'tns:User'
);

// ---- CDR Request (call detail report)------------------------------------------------

$server->wsdl->addComplexType(
    'CdrRequest',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'source'  => array('name'=>'source', 'type'=>'xsd:string'),
        'type'  => array('name'=>'type', 'type'=>'xsd:string'),
        'search'  => array('name'=>'search', 'type'=>'xsd:string'),
        'from'  => array('name'=>'from', 'type'=>'xsd:string'),
        'to'  => array('name'=>'to', 'type'=>'xsd:string'),
        'orderBy'  => array('name'=>'orderBy', 'type'=>'xsd:string'),
        'page'  => array('name'=>'page', 'type'=>'xsd:int')
    )
);

// ---- CDR (call detail report)------------------------------------------------

$server->wsdl->addComplexType(
    'Cdr',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'entity'  => array('name'=>'entity', 'type'=>'xsd:string'),
        'received'  => array('name'=>'received', 'type'=>'xsd:string'),
        'dialed'  => array('name'=>'dialed', 'type'=>'xsd:string'),
        'channel'  => array('name'=>'channel', 'type'=>'xsd:string'),
        'calldate'  => array('name'=>'calldate', 'type'=>'xsd:string'),
        'duration'  => array('name'=>'duration', 'type'=>'xsd:string')
    )
);

// ---- CDR[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'CdrArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Crd[]')
    ),
    'tns:Cdr'
);

// ---- TimeSegment ------------------------------------------------------------

$server->wsdl->addComplexType(
    'TimeSegment',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'  => array('name'=>'id', 'type'=>'xsd:int'),
        'name'  => array('name'=>'name', 'type'=>'xsd:string'),
        'date_from'  => array('name'=>'date_from', 'type'=>'xsd:string'),
        'date_to'  => array('name'=>'date_to', 'type'=>'xsd:string'),
        'hour_from'  => array('name'=>'hour_from', 'type'=>'xsd:string'),
        'hour_to'  => array('name'=>'hour_to', 'type'=>'xsd:string'),
        'week_day'  => array('name'=>'week_day', 'type'=>'xsd:string'),
        'day'  => array('name'=>'day', 'type'=>'xsd:string'),
        'month'  => array('name'=>'month', 'type'=>'xsd:string')
    )
);

// ---- TimeSegment[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'TimeSegmentArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:TimeSegment[]')
    ),
    'tns:TimeSegment'
);


// ---- Rule -------------------------------------------------------------------

$server->wsdl->addComplexType(
    'Rule',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id',          'type'=>'xsd:int'),
        'name'        => array('name'=>'name',        'type'=>'xsd:string'),
        'type'        => array('name'=>'type',        'type'=>'xsd:int'),
        'description' => array('name'=>'description', 'type'=>'xsd:string'),
        'outgoing'    => array('name'=>'outgoing',    'type'=>'tns:OutgoingRuleArray'),
        'incoming'    => array('name'=>'incoming',    'type'=>'tns:IncomingRuleArray')
    )
);

// ---- Rule[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'RuleArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Rule[]')
    ),
    'tns:Rule'
);

// ---- OutgoingRule ------------------------------------------------------------

$server->wsdl->addComplexType(
    'OutgoingRule',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id',          'type'=>'xsd:int'),
        'rule'        => array('name'=>'rule',        'type'=>'xsd:int'),
        'priority'    => array('name'=>'priority',    'type'=>'xsd:int'),
        'timesegment' => array('name'=>'timesegment', 'type'=>'xsd:int'),
        'group'       => array('name'=>'group',       'type'=>'xsd:int'),
        'entity'      => array('name'=>'entity',      'type'=>'xsd:int'),
        'resource'    => array('name'=>'resource',    'type'=>'xsd:string'),
        'provider'    => array('name'=>'provider',    'type'=>'xsd:int'),
        'action'      => array('name'=>'action',      'type'=>'xsd:int')
    )
);

// ---- OutgoingRule[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'OutgoingRuleArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:OutgoingRule[]')
    ),
    'tns:OutgoingRule'
);

// ---- IncomingRule ------------------------------------------------------------

$server->wsdl->addComplexType(
    'IncomingRule',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id',          'type'=>'xsd:int'),
        'rule'        => array('name'=>'rule',        'type'=>'xsd:int'),
        'priority'    => array('name'=>'priority',    'type'=>'xsd:int'),
        'timesegment' => array('name'=>'timesegment', 'type'=>'xsd:int'),
        'callerid'    => array('name'=>'callerid',    'type'=>'xsd:string'),
        'from_channel'  => array('name'=>'from_channel',  'type'=>'xsd:int'),
        'from_number' => array('name'=>'from_number', 'type'=>'tns:stringArray'),
        'macro'       => array('name'=>'macro',       'type'=>'xsd:int'),
        'parameter'   => array('name'=>'parameter',   'type'=>'xsd:string'),
        'duration'    => array('name'=>'duration',    'type'=>'xsd:int')
    )
);

// ---- IncomingRule[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'IncomingRuleArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:IncomingRule[]')
    ),
    'tns:IncomingRule'
);



// ---- Macro ------------------------------------------------------------

$server->wsdl->addComplexType(
    'Macro',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'            => array('name'=>'id',          'type'=>'xsd:int'),
        'name'          => array('name'=>'name',       'type'=>'xsd:string'),
        'label'         => array('name'=>'label',       'type'=>'xsd:string'),
        'description'   => array('name'=>'description', 'type'=>'xsd:string'),
        'parameter'     => array('name'=>'parameter',   'type'=>'xsd:string'),
        'code'          => array('name'=>'code',        'type'=>'xsd:string')
    )
);

// ---- Macro[] ------------------------------------------------------

$server->wsdl->addComplexType(
    'MacroArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Macro[]')
    ),
    'tns:Macro'
);

// ---- Application ------------------------------------------------------------

$server->wsdl->addComplexType(
    'Application',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'label'       => array('name'=>'label','type'=>'xsd:string'),
        'description' => array('name'=>'description','type'=>'xsd:string'),
        'extension'   => array('name'=>'extension','type'=>'xsd:string'),
        'code'        => array('name'=>'code','type'=>'xsd:string'),
        'macro'       => array('name'=>'macro','type'=>'xsd:int'),
        'parameter'   => array('name'=>'parameter','type'=>'xsd:string'),
        'groups'      => array('name'=>'groups','type'=>'tns:intArray')
    )
);

// ---- Application[] ----------------------------------------------------------

$server->wsdl->addComplexType(
    'ApplicationArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Application[]')
    ),
    'tns:Application'
);

// ---- Plugin ------------------------------------------------------------

$server->wsdl->addComplexType(
    'Plugin',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id','type'=>'xsd:int'),
        'name'        => array('name'=>'name','type'=>'xsd:string'),
        'version'     => array('name'=>'version','type'=>'xsd:string'),
        'entity'      => array('name'=>'entity','type'=>'xsd:string')
    )
);

// ---- Plugin[] ----------------------------------------------------------

$server->wsdl->addComplexType(
    'PluginArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Plugin[]')
    ),
    'tns:Plugin'
);

// ---- Channel ------------------------------------------------------------

$server->wsdl->addComplexType(
    'Channel',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id',        'type'=>'xsd:int'),
        'name'        => array('name'=>'name',      'type'=>'xsd:string'),
        'technology'  => array('name'=>'technology','type'=>'xsd:int'), 
        'resource'    => array('name'=>'resource',  'type'=>'xsd:string'), 
        'key'         => array('name'=>'key',       'type'=>'xsd:int'), 
        'msns'        => array('name'=>'msns',      'type'=>'tns:stringArray'),
        'did'         => array('name'=>'did',       'type'=>'xsd:int'),
        'rule'        => array('name'=>'rule',      'type'=>'xsd:int'),
        'speeddial'   => array('name'=>'speeddial', 'type'=>'xsd:string'),
        'order'       => array('name'=>'order',     'type'=>'xsd:int'),
        'trunk'       => array('name'=>'trunk',     'type'=>'xsd:int')
    )
);

// ---- Channel[] ----------------------------------------------------------

$server->wsdl->addComplexType(
    'ChannelArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:Channel[]')
    ),
    'tns:Channel'
);

// ---- AudioFile ------------------------------------------------------------

$server->wsdl->addComplexType(
    'AudioFile',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'id'          => array('name'=>'id',        'type'=>'xsd:int'),
        'name'        => array('name'=>'name',      'type'=>'xsd:string'),
        'filename'    => array('name'=>'filename',  'type'=>'xsd:string'), 
        'date'        => array('name'=>'date',      'type'=>'xsd:string') 
    )
);

// ---- AudioFile[] ----------------------------------------------------------

$server->wsdl->addComplexType(
    'AudioFileArray',
    'complexType',
    'array',
    '',
    'SOAP-ENC:Array',
    array(),
    array(
        array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:AudioFile[]')
    ),
    'tns:AudioFile'
);

?>
