#include <openr2/r2chan.h> |
#include <stdio.h> |
#include <stdlib.h> |
|
//auxiliary function |
void |
on_call_init(openr2_chan_t* p1){} |
|
//auxiliary function |
void |
on_call_offered( |
openr2_chan_t* p1, |
char const* p2, |
char const* p3, |
openr2_calling_party_category_t p4, |
int p5){} |
|
//auxiliary function |
void |
on_call_accepted(openr2_chan_t* p1, openr2_call_mode_t p2){} |
|
//auxiliary function |
void |
on_call_disconnect(openr2_chan_t* p1, openr2_call_disconnect_cause_t p2){} |
|
//auxiliary function |
void |
on_call_read(openr2_chan_t* p1, unsigned char const* p2, int p3){} |
|
//auxiliary function |
void |
on_hardware_alarm(openr2_chan_t* p1, int p2){} |
|
//auxiliary function |
void |
on_protocol_error(openr2_chan_t* p1, openr2_protocol_error_t p2){} |
|
//auxiliary function |
void |
on_context_log( |
openr2_context_t* p1, |
char const* p2, |
char const* p3, |
unsigned int p4, |
openr2_log_level_t p5, |
char const* p6, |
va_list p7){} |
|
//auxiliary function |
int |
on_dnis_digit_received(openr2_chan_t* p1, char p2){ |
return 1; |
} |
|
//auxiliary function |
void |
on_ani_digit_received(openr2_chan_t* p1, char p2){} |
|
//auxiliary function |
void |
on_call_log_created(openr2_chan_t* p1, char const* p2){} |
|
int main(int argc, char *argv[]) |
{ |
openr2_event_interface_t callmgmt = { |
.on_call_init = &on_call_init, |
.on_call_proceed = &on_call_init, |
.on_call_offered = &on_call_offered, |
.on_call_accepted = &on_call_accepted, |
.on_call_answered = &on_call_init, |
.on_call_disconnect = &on_call_disconnect, |
.on_call_end = &on_call_init, |
.on_call_read = &on_call_read, |
.on_hardware_alarm = &on_hardware_alarm, |
.on_os_error = &on_hardware_alarm, |
.on_protocol_error = &on_protocol_error, |
.on_line_blocked = &on_call_init, |
.on_line_idle = &on_call_init, |
.on_context_log = &on_context_log, |
.on_dnis_digit_received = &on_dnis_digit_received, |
.on_ani_digit_received = &on_ani_digit_received, |
.on_billing_pulse_received = &on_call_init, |
.on_call_log_created = &on_call_log_created}; |
openr2_context_t* r2context = openr2_context_new( |
OR2_VAR_ARGENTINA, |
&callmgmt, |
4, |
4); |
openr2_chan_t* r2chan = openr2_chan_new(r2context, 2); |
void* dtmf_read_handle = malloc(256); |
void* dtmf_write_handle = malloc(256); |
openr2_chan_set_dtmf_handles(r2chan, dtmf_read_handle, dtmf_write_handle); //target call |
return 0; |
} |