diff --git a/libpri.h b/libpri.h index abcb946..054158e 100755 --- a/libpri.h +++ b/libpri.h @@ -62,6 +62,7 @@ #define PRI_EVENT_RESTART_ACK 10 /* Restart complete on a given channel */ #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 */ /* Simple states */ #define PRI_STATE_DOWN 0 @@ -247,6 +248,12 @@ typedef struct pri_event_restart_ack { int channel; } pri_event_restart_ack; +typedef struct pri_event_proceeding { + int e; + int channel; +} pri_event_proceeding; + + typedef union { int e; pri_event_generic gen; /* Generic view */ @@ -258,6 +265,7 @@ typedef union { pri_event_ringing ringing; /* Ringing */ pri_event_ringing answer; /* Answer */ pri_event_restart_ack restartack; /* Restart Acknowledge */ + pri_event_proceeding proceeding; /* Call proceeding & Progress */ } pri_event; struct pri; diff --git a/q931.c b/q931.c index 3f7beaf..4cee762 100755 --- a/q931.c +++ b/q931.c @@ -1906,17 +1906,20 @@ int q931_receive(struct pri *pri, q931_h *h, int len) #endif return Q931_RES_HAVEEVENT; case Q931_PROGRESS: + case Q931_CALL_PROCEEDING: + pri->ev.e = PRI_EVENT_PROCEEDING; + pri->ev.proceeding.channel = c->channelno; + c->ourcallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING; + return Q931_RES_HAVEEVENT; case Q931_CONNECT_ACKNOWLEDGE: c->ourcallstate = Q931_CALL_STATE_ACTIVE; + break; case Q931_STATUS: /* Do nothing */ if ((pri->debug & PRI_DEBUG_Q931_ANOMALY) && (c->cause != PRI_CAUSE_INTERWORKING)) pri_error("Received unsolicited status: %s\n", pri_cause2str(c->cause)); break; - case Q931_CALL_PROCEEDING: - c->ourcallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING; - break; case Q931_RELEASE_COMPLETE: c->ourcallstate = Q931_CALL_STATE_NULL; /* Free resources */