[Asterisk-cvs] libpri libpri.h,1.23,1.24 pri.c,1.17,1.18 pri_q931.h,1.12,1.13 q931.c,1.55,1.56
markster at lists.digium.com
markster at lists.digium.com
Wed May 19 16:49:05 CDT 2004
Update of /usr/cvsroot/libpri
In directory mongoose.digium.com:/tmp/cvs-serv25909
Modified Files:
libpri.h pri.c pri_q931.h q931.c
Log Message:
Only send channel identifier with call proceeding
Index: libpri.h
===================================================================
RCS file: /usr/cvsroot/libpri/libpri.h,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- libpri.h 19 May 2004 15:34:43 -0000 1.23
+++ libpri.h 19 May 2004 21:01:36 -0000 1.24
@@ -395,9 +395,9 @@
#define PRI_PROGRESS
/* 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 channel, int info);
-#define PRI_PROCEEDING
+#define PRI_PROCEEDING_FULL
/* Send call proceeding */
-extern int pri_proceeding(struct pri *pri, q931_call *c, int info);
+extern int pri_proceeding(struct pri *pri, q931_call *c, int channel, int info);
#endif
Index: pri.c
===================================================================
RCS file: /usr/cvsroot/libpri/pri.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- pri.c 19 May 2004 15:34:43 -0000 1.17
+++ pri.c 19 May 2004 21:01:36 -0000 1.18
@@ -191,18 +191,18 @@
return q931_alerting(pri, call, channel, info);
}
-int pri_proceeding(struct pri *pri, q931_call *call, int info)
+int pri_proceeding(struct pri *pri, q931_call *call, int channel, int info)
{
if (!pri || !call)
return -1;
- return q931_call_proceeding(pri, call,info);
+ return q931_call_proceeding(pri, call, channel, info);
}
-int pri_progress(struct pri *pri, q931_call *call, int info)
+int pri_progress(struct pri *pri, q931_call *call, int channel, int info)
{
if (!pri || !call)
return -1;
- return q931_call_progress(pri, call,info);
+ return q931_call_progress(pri, call, channel, info);
}
int pri_information(struct pri *pri, q931_call *call, char digit)
Index: pri_q931.h
===================================================================
RCS file: /usr/cvsroot/libpri/pri_q931.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- pri_q931.h 19 May 2004 15:34:43 -0000 1.12
+++ pri_q931.h 19 May 2004 21:01:36 -0000 1.13
@@ -243,9 +243,9 @@
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_progress(struct pri *pri, q931_call *call, int channel, 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 channel, int info);
extern int q931_setup_ack(struct pri *pri, q931_call *call, int channel, int nonisdn);
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri/q931.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- q931.c 19 May 2004 15:34:43 -0000 1.55
+++ q931.c 19 May 2004 21:01:36 -0000 1.56
@@ -360,6 +360,8 @@
static int transmit_channel_id(struct pri *pri, q931_call *call, int msgtype, q931_ie *ie, int len)
{
int pos=0;
+ if (!call->channelno)
+ return 0;
/* Start with standard stuff */
ie->data[pos] = 0xa1;
/* Add exclusive flag if necessary */
@@ -1569,8 +1571,11 @@
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)
+int q931_call_progress(struct pri *pri, q931_call *c, int channel, int info)
{
+ if (!c->proc)
+ q931_call_proceeding(pri, c, channel, 0);
+ c->channelno = 0;
c->ourcallstate = Q931_CALL_STATE_INCOMING_CALL_PROCEEDING;
c->peercallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING;
if (info) {
@@ -1579,8 +1584,6 @@
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);
@@ -1592,8 +1595,12 @@
static int call_proceeding_ies[] = { Q931_CHANNEL_IDENT, Q931_PROGRESS_INDICATOR, -1 };
#endif
-int q931_call_proceeding(struct pri *pri, q931_call *c, int info)
+int q931_call_proceeding(struct pri *pri, q931_call *c, int channel, int info)
{
+ if (channel)
+ c->channelno = channel;
+ c->chanflags &= ~FLAG_PREFERRED;
+ c->chanflags |= FLAG_EXCLUSIVE;
c->ourcallstate = Q931_CALL_STATE_INCOMING_CALL_PROCEEDING;
c->peercallstate = Q931_CALL_STATE_OUTGOING_CALL_PROCEEDING;
if (info) {
@@ -1614,18 +1621,14 @@
int q931_alerting(struct pri *pri, q931_call *c, int channel, int info)
{
- if (channel)
- c->channelno = channel;
- c->chanflags &= ~FLAG_PREFERRED;
- c->chanflags |= FLAG_EXCLUSIVE;
+ if (!c->proc)
+ q931_call_proceeding(pri, c, channel, 0);
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->ourcallstate = Q931_CALL_STATE_CALL_RECEIVED;
c->peercallstate = Q931_CALL_STATE_CALL_DELIVERED;
c->alive = 1;
More information about the svn-commits
mailing list