Asterisk - The Open Source Telephony Project GIT-master-f36a736
Data Fields
aeap_transport_vtable Struct Reference

Asterisk external application transport virtual table. More...

#include <transport.h>

Data Fields

int(* connect )(struct aeap_transport *self, const char *url, const char *protocol, int timeout)
 Connect a transport. More...
 
void(* destroy )(struct aeap_transport *self)
 Destroy a transport. More...
 
int(* disconnect )(struct aeap_transport *self)
 Disconnect a transport. More...
 
intmax_t(* read )(struct aeap_transport *self, void *buf, intmax_t size, enum AST_AEAP_DATA_TYPE *rtype)
 Read data from a transport. More...
 
intmax_t(* write )(struct aeap_transport *self, const void *buf, intmax_t size, enum AST_AEAP_DATA_TYPE wtype)
 Write data to a transport. More...
 

Detailed Description

Asterisk external application transport virtual table.

Callbacks to be implemented by "derived" transports

Definition at line 33 of file transport.h.

Field Documentation

◆ connect

int(* connect) (struct aeap_transport *self, const char *url, const char *protocol, int timeout)

Connect a transport.

Parameters
selfThe transport object
urlThe URL to connect to
protocolThe connection protocol to use if applicable
timeoutHow long (in milliseconds) to attempt to connect (-1 equals infinite)
Returns
0 on success, or -1 on error

Definition at line 44 of file transport.h.

Referenced by aeap_transport_connect(), and transport_websocket_vtable().

◆ destroy

void(* destroy) (struct aeap_transport *self)

Destroy a transport.

Parameters
selfThe transport object

Definition at line 60 of file transport.h.

Referenced by aeap_transport_destroy().

◆ disconnect

int(* disconnect) (struct aeap_transport *self)

Disconnect a transport.

Parameters
selfThe transport object
Returns
0 on success, or -1 on error

Definition at line 53 of file transport.h.

Referenced by aeap_transport_disconnect().

◆ read

intmax_t(* read) (struct aeap_transport *self, void *buf, intmax_t size, enum AST_AEAP_DATA_TYPE *rtype)

Read data from a transport.

Parameters
selfThe transport object
bufThe buffer data is read read into
sizeThe size of the given data buffer
rtype[out] The type of data read
Returns
Total number of bytes read, or less than zero on error

Definition at line 72 of file transport.h.

Referenced by aeap_transport_read().

◆ write

intmax_t(* write) (struct aeap_transport *self, const void *buf, intmax_t size, enum AST_AEAP_DATA_TYPE wtype)

Write data to a transport.

Parameters
selfThe transport object
bufThe data to write
sizeThe size of data to write
wtypeThe type of data to write
Returns
Total number of bytes written, or less than zero on error

Definition at line 85 of file transport.h.

Referenced by aeap_transport_write(), and MultiOrderedConfigParser::write().


The documentation for this struct was generated from the following file: