Caller id generation
[Caller id]

Collaboration diagram for Caller id generation:

High level functions

int WINAPI vpb_cid_set (VPB_CID *cid, CidDataType field, void *value)
 Set a field in the cid data structure.
void WINAPI vpb_ring_with_cid (int handle, const VPB_CID &cid, int cadence=-1)
 Start handle ringing and send type 1 caller id information.
void WINAPI vpb_send_cid_t2_sync (int handle, const VPB_CID &cid)
 Send type 2 caller id information to handle.

Low level functions

int WINAPI vpb_cid_compose_dlp (const VPB_CID &cid, char *dlp)
 Create a data link packet from a VPB_CID structure.
int WINAPI vpb_cid_compose_dlp (const VPB_CID *cid, char *dlp)
 Create a data link packet from a VPB_CID structure.
void WINAPI vpb_cid_compose_wav (const char *dlp, int dlp_len, short *wav_buf, int *wav_len, const Country *country=NULL)
 Encode a data link packet into CP-FSK wav data for type 1 CID.
void WINAPI vpb_cid_t2_compose_wav (const char *dlp, int dlp_len, short *wav_buf, int *wav_len, const Country *country=NULL)
 Encode a data link packet into CP-FSK wav data for type 2 CID.

Defines

#define VPB_CID_MAX_BUF   20400
 Maximum size of CID wav data.
#define VPB_CID_MAX_DLP   256
 Maximum size of CID dlp data.

Enumerations

enum  CidDataType {
  VPB_CID_EMPTY = 0, VPB_CID_DATE_TIME = 1, VPB_CID_CALLING_LINE_DN = 2, VPB_CID_CALLED_DN = 3,
  VPB_CID_RFA_CLDN = 4, VPB_CID_CALLER_NAME = 7, VPB_CID_RFA_CN = 8, VPB_CID_CALL_TYPE = 0x11,
  VPB_CID_NMSS = 0x13
}
 Field type identifiers for CID data. More...

Enumeration Type Documentation

Field type identifiers for CID data.

Enumerator:
VPB_CID_EMPTY  Flag to clear CID data fields.
VPB_CID_DATE_TIME  Timestamp.
VPB_CID_CALLING_LINE_DN  Caller directory number.
VPB_CID_CALLED_DN  Called directory number.
VPB_CID_RFA_CLDN  Reason for absence of caller number.
VPB_CID_CALLER_NAME  Caller name.
VPB_CID_RFA_CN  Reason for absence of caller name.
VPB_CID_CALL_TYPE  Call type indicator.
VPB_CID_NMSS  Network message system status.


Function Documentation

int WINAPI vpb_cid_compose_dlp ( const VPB_CID cid,
char *  dlp 
)

Create a data link packet from a VPB_CID structure.

Parameters:
cid The VPB_CID structure to send.
dlp Pointer to storage for the returned data packet.
Returns:
The number of bytes in the dlp.

References vpb_cid_compose_dlp().

int WINAPI vpb_cid_compose_dlp ( const VPB_CID cid,
char *  dlp 
)

Create a data link packet from a VPB_CID structure.

Parameters:
cid The VPB_CID structure to send.
dlp Pointer to storage for the returned data packet.
Returns:
The number of bytes in the dlp.

References VPB_CID::call_type, VPB_CID::cdn, VPB_CID::cldn, VPB_CID::cn, VPB_CID::date_time, VPB_CID::nmss, VPB_CID::ra_cldn, VPB_CID::ra_cn, VPB_CID_CALL_TYPE, VPB_CID_CALLED_DN, VPB_CID_CALLER_NAME, VPB_CID_CALLING_LINE_DN, VPB_CID_CT_UNKNOWN, VPB_CID_DATE_TIME, VPB_CID_NMSS, VPB_CID_RFA_CLDN, and VPB_CID_RFA_CN.

Referenced by vpb_cid_compose_dlp(), vpb_ring_with_cid(), and vpb_send_cid_t2_sync().

void WINAPI vpb_cid_compose_wav ( const char *  dlp,
int  dlp_len,
short *  wav_buf,
int *  wav_len,
const Country country = NULL 
)

Encode a data link packet into CP-FSK wav data for type 1 CID.

The resulting wav includes the required CSS and MSS headers.

Parameters:
dlp Data link layer packet (as created by vpb_cid_compose_dlp())
dlp_len The length of the dlp data (as returned by vpb_cid_compose_dlp())
wav_buf Pointer to storage for the returned wav data.
wav_len Pointer to storage for the wav data sample count.
country Locale specific data about the modulation to use.

References vpb_get_country_data().

Referenced by vpb_ring_with_cid().

int WINAPI vpb_cid_set ( VPB_CID cid,
CidDataType  field,
void *  value 
)

Set a field in the cid data structure.

Parameters:
cid The VPB_CID structure to initialise.
field The VPB_CID field to set. If VPB_CID_EMPTY is passed here, then value will be ignored and all fields will be reset to their default values.
value The value to set field to.
Returns:
0 upon success, -1 in the event of error or an invalid value.
Note:
Setting some fields may reset other dependent fields to appropriate values.

References VPB_CID::call_type, VPB_CID::cdn, VPB_CID::cldn, VPB_CID::clear(), VPB_CID::cn, VPB_CID::date_time, VPB_CID::nmss, VPB_CID::ra_cldn, VPB_CID::ra_cn, VPB_CID_CALL_TYPE, VPB_CID_CALLED_DN, VPB_CID_CALLER_NAME, VPB_CID_CALLING_LINE_DN, VPB_CID_CT_MW, VPB_CID_CT_RBWF, VPB_CID_CT_VOICE, VPB_CID_DATE_TIME, VPB_CID_EMPTY, VPB_CID_NMSS, VPB_CID_RFA_CLDN, and VPB_CID_RFA_CN.

void WINAPI vpb_cid_t2_compose_wav ( const char *  dlp,
int  dlp_len,
short *  wav_buf,
int *  wav_len,
const Country country = NULL 
)

Encode a data link packet into CP-FSK wav data for type 2 CID.

The resulting wav includes the required MSS headers.

Parameters:
dlp Data link layer packet (as created by vpb_cid_compose_dlp())
dlp_len The length of the dlp data (as returned by vpb_cid_compose_dlp())
wav_buf Pointer to storage for the returned wav data.
wav_len Pointer to storage for the wav data sample count.
country Locale specific data about the modulation to use.

References vpb_get_country_data().

Referenced by vpb_send_cid_t2_sync().

void WINAPI vpb_ring_with_cid ( int  handle,
const VPB_CID cid,
int  cadence = -1 
)

Start handle ringing and send type 1 caller id information.

This function will return once the normal ring cadence has begun. That may be several seconds from the time it is first called.

Parameters:
handle The handle to a station port to ring.
cid The called id information to transmit.
cadence The ring cadence to use. If not specified, the normal ring cadence for the country associated with handle will be used.
Exceptions:
various exceptions may be thrown in the event of an error.
See also:
vpb_ring_station_async()

References get_country(), ring_station_async(), vpb_cid_compose_dlp(), vpb_cid_compose_wav(), VPB_CID_MAX_BUF, VPB_CID_MAX_DLP, VPB_LINEAR, vpb_play_buf_finish_sync(), vpb_play_buf_start(), vpb_play_buf_sync(), and vpb_ring_station_async().


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