| r2context.h | | r2context.h | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 162 | |
| /* Transcoding interface. Users should provide this interface | | /* Transcoding interface. Users should provide this interface | |
| to provide transcoding services from linear to alaw and | | to provide transcoding services from linear to alaw and | |
| viceversa */ | | viceversa */ | |
| typedef int16_t (*openr2_alaw_to_linear_func)(uint8_t alaw); | | typedef int16_t (*openr2_alaw_to_linear_func)(uint8_t alaw); | |
| typedef uint8_t (*openr2_linear_to_alaw_func)(int linear); | | typedef uint8_t (*openr2_linear_to_alaw_func)(int linear); | |
| typedef struct { | | typedef struct { | |
| openr2_alaw_to_linear_func alaw_to_linear; | | openr2_alaw_to_linear_func alaw_to_linear; | |
| openr2_linear_to_alaw_func linear_to_alaw; | | openr2_linear_to_alaw_func linear_to_alaw; | |
| } openr2_transcoder_interface_t; | | } openr2_transcoder_interface_t; | |
| | | | |
|
| /* DTMF transmitter interface */ | | /* DTMF transmitter part of the openr2_dtmf_interface_t */ | |
| typedef void *(*openr2_dtmf_tx_init_func)(void *dtmf_write_handle); | | typedef void *(*openr2_dtmf_tx_init_func)(void *dtmf_write_handle); | |
| typedef void (*openr2_dtmf_tx_set_timing_func)(void *dtmf_write_handle, int
on_time, int off_time); | | typedef void (*openr2_dtmf_tx_set_timing_func)(void *dtmf_write_handle, int
on_time, int off_time); | |
| typedef int (*openr2_dtmf_tx_put_func)(void *dtmf_write_handle, const char
*digits, int len); | | typedef int (*openr2_dtmf_tx_put_func)(void *dtmf_write_handle, const char
*digits, int len); | |
| typedef int (*openr2_dtmf_tx_func)(void *dtmf_write_handle, int16_t amp[],
int max_samples); | | typedef int (*openr2_dtmf_tx_func)(void *dtmf_write_handle, int16_t amp[],
int max_samples); | |
| | | | |
|
| | | /* DTMF receiver part of the openr2_dtmf_interface_t */ | |
| | | typedef void (*openr2_digits_rx_callback_t)(void *user_data, const char *di | |
| | | gits, int len); | |
| | | typedef void *(*openr2_dtmf_rx_init_func)(void *dtmf_read_handle, openr2_di | |
| | | gits_rx_callback_t callback, void *user_data); | |
| | | typedef int (*openr2_dtmf_rx_status_func)(void *dtmf_read_handle); | |
| | | typedef int (*openr2_dtmf_rx_func)(void *dtmf_read_handle, const int16_t am | |
| | | p[], int samples); | |
| | | | |
| typedef struct { | | typedef struct { | |
|
| | | /* DTMF Transmitter */ | |
| openr2_dtmf_tx_init_func dtmf_tx_init; | | openr2_dtmf_tx_init_func dtmf_tx_init; | |
| openr2_dtmf_tx_set_timing_func dtmf_tx_set_timing; | | openr2_dtmf_tx_set_timing_func dtmf_tx_set_timing; | |
| openr2_dtmf_tx_put_func dtmf_tx_put; | | openr2_dtmf_tx_put_func dtmf_tx_put; | |
| openr2_dtmf_tx_func dtmf_tx; | | openr2_dtmf_tx_func dtmf_tx; | |
|
| | | | |
| | | /* DTMF Detector */ | |
| | | openr2_dtmf_rx_init_func dtmf_rx_init; | |
| | | openr2_dtmf_rx_status_func dtmf_rx_status; | |
| | | openr2_dtmf_rx_func dtmf_rx; | |
| } openr2_dtmf_interface_t; | | } openr2_dtmf_interface_t; | |
| | | | |
| /* Library errors */ | | /* Library errors */ | |
| typedef enum { | | typedef enum { | |
| /* Failed system call */ | | /* Failed system call */ | |
| OR2_LIBERR_SYSCALL_FAILED, | | OR2_LIBERR_SYSCALL_FAILED, | |
| /* Invalid channel signaling when creating it */ | | /* Invalid channel signaling when creating it */ | |
| OR2_LIBERR_INVALID_CHAN_SIGNALING, | | OR2_LIBERR_INVALID_CHAN_SIGNALING, | |
| /* cannot set to IDLE the channel when creating it */ | | /* cannot set to IDLE the channel when creating it */ | |
| OR2_LIBERR_CANNOT_SET_IDLE | | OR2_LIBERR_CANNOT_SET_IDLE | |
| | | | |
| skipping to change at line 213 | | skipping to change at line 225 | |
| int openr2_context_get_mf_threshold(openr2_context_t *r2context); | | int openr2_context_get_mf_threshold(openr2_context_t *r2context); | |
| int openr2_context_set_log_directory(openr2_context_t *r2context, char *dir
ectory); | | int openr2_context_set_log_directory(openr2_context_t *r2context, char *dir
ectory); | |
| char *openr2_context_get_log_directory(openr2_context_t *r2context, char *d
irectory, int len); | | char *openr2_context_get_log_directory(openr2_context_t *r2context, char *d
irectory, int len); | |
| void openr2_context_set_mf_back_timeout(openr2_context_t *r2context, int ms
); | | void openr2_context_set_mf_back_timeout(openr2_context_t *r2context, int ms
); | |
| int openr2_context_get_mf_back_timeout(openr2_context_t *r2context); | | int openr2_context_get_mf_back_timeout(openr2_context_t *r2context); | |
| void openr2_context_set_metering_pulse_timeout(openr2_context_t *r2context,
int ms); | | void openr2_context_set_metering_pulse_timeout(openr2_context_t *r2context,
int ms); | |
| int openr2_context_get_metering_pulse_timeout(openr2_context_t *r2context); | | int openr2_context_get_metering_pulse_timeout(openr2_context_t *r2context); | |
| void openr2_context_set_double_answer(openr2_context_t *r2context, int enab
le); | | void openr2_context_set_double_answer(openr2_context_t *r2context, int enab
le); | |
| int openr2_context_get_double_answer(openr2_context_t *r2context); | | int openr2_context_get_double_answer(openr2_context_t *r2context); | |
| int openr2_context_configure_from_advanced_file(openr2_context_t *r2context
, const char *filename); | | int openr2_context_configure_from_advanced_file(openr2_context_t *r2context
, const char *filename); | |
|
| | | void openr2_context_set_dtmf_detection(openr2_context_t *r2context, int ena | |
| | | ble); | |
| | | int openr2_context_get_dtmf_detection(openr2_context_t *r2context); | |
| void openr2_context_set_dtmf_dialing(openr2_context_t *r2context, int enabl
e, int dtmf_on, int dtmf_off); | | void openr2_context_set_dtmf_dialing(openr2_context_t *r2context, int enabl
e, int dtmf_on, int dtmf_off); | |
| int openr2_context_get_dtmf_dialing(openr2_context_t *r2context, int *dtmf_
on, int *dtmf_off); | | int openr2_context_get_dtmf_dialing(openr2_context_t *r2context, int *dtmf_
on, int *dtmf_off); | |
| int openr2_context_set_dtmf_interface(openr2_context_t *r2context, openr2_d
tmf_interface_t *dtmf_interface); | | int openr2_context_set_dtmf_interface(openr2_context_t *r2context, openr2_d
tmf_interface_t *dtmf_interface); | |
| | | | |
| #ifdef __OR2_COMPILING_LIBRARY__ | | #ifdef __OR2_COMPILING_LIBRARY__ | |
| #undef openr2_chan_t | | #undef openr2_chan_t | |
| #undef openr2_context_t | | #undef openr2_context_t | |
| #endif | | #endif | |
| | | | |
| #if defined(__cplusplus) | | #if defined(__cplusplus) | |
| | | | |
End of changes. 5 change blocks. |
| 1 lines changed or deleted | | 19 lines changed or added | |
|