Allow progress to be sent with 1

git-svn-id: https://origsvn.digium.com/svn/libpri/trunk@93 2fbb986a-6c06-0410-b554-c9c1f0a7f128
This commit is contained in:
Mark Spencer 2004-05-19 15:21:15 +00:00
parent c8528b633a
commit 8098266c90
4 changed files with 12 additions and 6 deletions

View File

@ -395,6 +395,6 @@ extern int pri_fd(struct pri *pri);
#define PRI_PROGRESS
/* Send call proceeding */
extern int pri_progress(struct pri *pri, q931_call *c);
extern int pri_progress(struct pri *pri, q931_call *c, int info);
#endif

4
pri.c
View File

@ -191,11 +191,11 @@ 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 pri_progress(struct pri *pri, q931_call *call, int info)
{
if (!pri || !call)
return -1;
return q931_call_proceeding(pri, call);
return q931_call_proceeding(pri, call,info);
}
int pri_information(struct pri *pri, q931_call *call, char digit)

View File

@ -243,7 +243,7 @@ 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_proceeding(struct pri *pri, q931_call *call);
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);

10
q931.c
View File

@ -1565,10 +1565,16 @@ static int restart_ack(struct pri *pri, q931_call *c)
static int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, -1 };
int q931_call_proceeding(struct pri *pri, q931_call *c)
int q931_call_proceeding(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;
c->proc = 1;
c->alive = 1;
return send_message(pri, c, Q931_CALL_PROCEEDING, call_proceeding_ies);
@ -1592,7 +1598,7 @@ int q931_alerting(struct pri *pri, q931_call *c, int channel, int info)
} else
c->progress = -1;
if (!c->proc)
q931_call_proceeding(pri, c);
q931_call_proceeding(pri, c, 0);
c->ourcallstate = Q931_CALL_STATE_CALL_RECEIVED;
c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED;
c->alive = 1;