diff --git a/libpri.h b/libpri.h index 613e3b8..9d89b53 100755 --- a/libpri.h +++ b/libpri.h @@ -63,6 +63,7 @@ #define PRI_EVENT_FACNAME 11 /* Caller*ID Name received on Facility */ #define PRI_EVENT_INFO_RECEIVED 12 /* Additional info (keypad) received */ #define PRI_EVENT_PROCEEDING 13 /* When we get CALL_PROCEEDING or PROGRESS */ +#define PRI_EVENT_SETUP_ACK 14 /* When we get SETUP_ACKNOWLEDGE */ /* Simple states */ #define PRI_STATE_DOWN 0 @@ -253,6 +254,10 @@ typedef struct pri_event_proceeding { int channel; } pri_event_proceeding; +typedef struct pri_event_setup_ack { + int e; + int channel; +} pri_event_setup_ack; typedef union { int e; @@ -266,6 +271,7 @@ typedef union { pri_event_ringing answer; /* Answer */ pri_event_restart_ack restartack; /* Restart Acknowledge */ pri_event_proceeding proceeding; /* Call proceeding & Progress */ + pri_event_setup_ack setup_ack; /* SETUP_ACKNOWLEDGE structure */ } pri_event; struct pri; diff --git a/q931.c b/q931.c index 472322f..6bc4796 100755 --- a/q931.c +++ b/q931.c @@ -1991,7 +1991,9 @@ int q931_receive(struct pri *pri, q931_h *h, int len) break; case Q931_SETUP_ACKNOWLEDGE: c->ourcallstate = Q931_CALL_STATE_OVERLAP_SENDING; - break; + pri->ev.e = PRI_EVENT_SETUP_ACK; + pri->ev.setup_ack.channel = c->channelno; + return Q931_RES_HAVEEVENT; case Q931_USER_INFORMATION: case Q931_SEGMENT: case Q931_CONGESTION_CONTROL: