Add separate ability to do both progress and proceeding

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@95 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Mark Spencer 2004-05-19 15:34:43 +00:00
parent c413151375
commit 2c26d98a89
4 changed files with 36 additions and 1 deletions

View File

@ -397,4 +397,7 @@ extern int pri_fd(struct pri *pri);
/* Send call proceeding */
extern int pri_progress(struct pri *pri, q931_call *c, int info);
#define PRI_PROCEEDING
/* Send call proceeding */
extern int pri_proceeding(struct pri *pri, q931_call *c, int info);
#endif

9
pri.c
View File

@ -191,13 +191,20 @@ int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info)
return q931_alerting(pri, call, channel, info);
}
int pri_progress(struct pri *pri, q931_call *call, int info)
int pri_proceeding(struct pri *pri, q931_call *call, int info)
{
if (!pri || !call)
return -1;
return q931_call_proceeding(pri, call,info);
}
int pri_progress(struct pri *pri, q931_call *call, int info)
{
if (!pri || !call)
return -1;
return q931_call_progress(pri, call,info);
}
int pri_information(struct pri *pri, q931_call *call, char digit)
{
if (!pri || !call)

View File

@ -243,6 +243,8 @@ extern int q931_receive(struct pri *pri, q931_h *h, int len);
extern int q931_alerting(struct pri *pri, q931_call *call, int channel, int info);
extern int q931_call_progress(struct pri *pri, q931_call *call, int info);
extern int q931_call_proceeding(struct pri *pri, q931_call *call, int info);
extern int q931_setup_ack(struct pri *pri, q931_call *call, int channel, int nonisdn);

23
q931.c
View File

@ -1563,6 +1563,29 @@ static int restart_ack(struct pri *pri, q931_call *c)
return send_message(pri, c, Q931_RESTART_ACKNOWLEDGE, restart_ack_ies);
}
#ifdef ALERTING_NO_PROGRESS
static int call_progress_ies[] = { Q931_CHANNEL_IDENT, -1 };
#else
static int call_progress_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 };
#endif
int q931_call_progress(struct pri *pri, q931_call *c, int info)
{
c->ourcallstate = Q931_CALL_STATE_INCOMING_CALL_PROCEEDING;
c->peercallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING;
if (info) {
c->progloc = LOC_PRIV_NET_LOCAL_USER;
c->progcode = CODE_CCITT;
c->progress = Q931_PROG_INBAND_AVAILABLE;
} else
c->progress = -1;
if (!c->proc)
q931_call_proceeding(pri, c, 0);
c->proc = 1;
c->alive = 1;
return send_message(pri, c, Q931_PROGRESS, call_progress_ies);
}
#ifdef ALERTING_NO_PROGRESS
static int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, -1 };
#else