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:
parent
c413151375
commit
2c26d98a89
3
libpri.h
3
libpri.h
@ -397,4 +397,7 @@ extern int pri_fd(struct pri *pri);
|
|||||||
/* Send call proceeding */
|
/* Send call proceeding */
|
||||||
extern int pri_progress(struct pri *pri, q931_call *c, int info);
|
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
|
#endif
|
||||||
|
9
pri.c
9
pri.c
@ -191,13 +191,20 @@ int pri_acknowledge(struct pri *pri, q931_call *call, int channel, int info)
|
|||||||
return q931_alerting(pri, call, channel, 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)
|
if (!pri || !call)
|
||||||
return -1;
|
return -1;
|
||||||
return q931_call_proceeding(pri, call,info);
|
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)
|
int pri_information(struct pri *pri, q931_call *call, char digit)
|
||||||
{
|
{
|
||||||
if (!pri || !call)
|
if (!pri || !call)
|
||||||
|
@ -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_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_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);
|
extern int q931_setup_ack(struct pri *pri, q931_call *call, int channel, int nonisdn);
|
||||||
|
23
q931.c
23
q931.c
@ -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);
|
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
|
#ifdef ALERTING_NO_PROGRESS
|
||||||
static int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, -1 };
|
static int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, -1 };
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user