Port control
[Public API functions]

Collaboration diagram for Port control:

Deprecated functions

 VT_DEPRECATED (int WINAPI vpb_bridge(int h1, int h2, BridgeMode mode, int resource))

Defines

#define VPB_RING_STATION_ON   -1
 Ring station port with default cadence.
#define VPB_RING_STATION_OFF   0
 Stop station port ringing.

Enumerations

enum  HookState { VPB_ONHOOK = 0, VPB_OFFHOOK = 1, VPB_FASTOFFHOOK = 2 }
 Symbolic hook states. More...
enum  BridgeMode { VPB_BRIDGE_OFF = 0, VPB_BRIDGE_ON = 1 }
 Port bridging control flags. More...

Functions

HookState WINAPI vpb_get_hookstate (VPBPortHandle handle)
 Return the hook state of a port.
void WINAPI vpb_sethook_async (VPBPortHandle handle, HookState hookstate)
 Signal a port to set its hook state. Returns immediately.
void WINAPI vpb_sethook_sync (VPBPortHandle handle, HookState hookstate)
 Set the hook state of a port. Waits for it to change before returning.
void WINAPI vpb_ring_station_async (VPBPortHandle handle, int cadence=-1)
 Start or stop a station port ringing.
int WINAPI vpb_bridge (VPBPortHandle h1, VPBPortHandle h2, BridgeMode mode)
 Create a full duplex bridge between ports h1 and h2.
int WINAPI vpb_listen (VPBPortHandle dest, VPBPortHandle src, BridgeMode mode)
 Create a half duplex bridge routing audio from src to dest.
int WINAPI vpb_soft_bridge (int h1, int h2, int mode)
void WINAPI vpb_set_codec_reg (VPBPortHandle handle, uint16_t addr, uint16_t value)

Enumeration Type Documentation

enum BridgeMode

Port bridging control flags.

Enumerator:
VPB_BRIDGE_OFF  stop bridging
VPB_BRIDGE_ON  start bridging

enum HookState

Symbolic hook states.

Enumerator:
VPB_ONHOOK  Port on-hook.
VPB_OFFHOOK  Port off-hook.
VPB_FASTOFFHOOK  Port off-hook, no calibration.


Function Documentation

HookState WINAPI vpb_get_hookstate ( VPBPortHandle  handle  ) 

Return the hook state of a port.

Parameters:
handle The handle of the port to query.
Returns:
VPB_ONHOOK or VPB_OFFHOOK if the query succeeds.
Exceptions:
VpbException will be thrown in the event of an error.
Warning:
In environments where asynchronous operations may take place on handle, the real state of the port may have already changed again by the time this function returns. It is the responsibility of the user application to determine how much trust may be placed in the accuracy of this value at any point in the code where it is used.

References CheckHandle(), VTCore::hook_state(), vpb_c, VPB_OPCI, VPB_OSW, VPB_PRI, VPB_V4LOG, VPB_V4PCI, and VpbException::VpbException().

void WINAPI vpb_ring_station_async ( VPBPortHandle  handle,
int  cadence = -1 
)

Start or stop a station port ringing.

Parameters:
handle The handle of the port to control.
cadence The ring cadence value.
If the cadence parameter is not specified, the default cadence for a normal ring according to the port's country setting will be used. The valid cadence values are defined as follows:

  • 0 - Stop ringing.
  • 1 - Ring a guard tone cadence. Often used before sending caller id.
  • 2 - Normal ring for Australian phone networks. (DR0)
  • 3-9 - DR1 to DR7 of the AS/ACIF S002:2001 distinctive ring series.
  • 10 - US ring cadence.

There is an additional special ring cadence 255, which like 0, stops the station ringing, but in addition will signal an OpenPCI FXS port to enter a mode where caller id information can be transmitted to a handset that is still on hook. ie. for US style caller id, you would generate one second of cadence 1 tone, stopped by a cadence 255 signal. The caller id tones can then be sent, and normal ringing commenced using cadence 2 - 10. Convenience functions to do this are provided with the CTPort interface to ctserver.

Note:
Distinctive ring cadences are not supported by the OpenSwitch cards at the time of writing. Values 1 - 10 will all cause its normal ring cadence to be generated.
See also:
vpb_ring_with_cid()

References CheckHandle(), and ring_station_async().

Referenced by vpb_reset(), and vpb_ring_with_cid().


Generated on Mon May 19 14:29:36 2008 for libvpb by  doxygen 1.5.5