[Asterisk-cvs] libpri-matt pri_internal.h,1.8,1.9 q931.c,1.7,1.8
mattf at lists.digium.com
mattf at lists.digium.com
Wed Dec 29 14:32:03 CST 2004
- Previous message: [Asterisk-cvs] asterisk/apps app_read.c,1.13,1.14
- Next message: [Asterisk-cvs] asterisk/channels chan_iax2.c, 1.229,
1.230 iax2-parser.c, 1.32, 1.33 iax2-parser.h, 1.12,
1.13 iax2.h, 1.18, 1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/libpri-matt
In directory mongoose.digium.com:/tmp/cvs-serv20798
Modified Files:
pri_internal.h q931.c
Log Message:
Added nuances for building the message with multiple facility IEs
Index: pri_internal.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_internal.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- pri_internal.h 29 Dec 2004 18:09:45 -0000 1.8
+++ pri_internal.h 29 Dec 2004 19:26:49 -0000 1.9
@@ -142,12 +142,13 @@
/* For scheduling the sending and receiving of invokes, etc */
struct adpu_event {
- int message;
- void (*callback)(void *data);
- void *data;
- void *adpu;
- int adpu_len;
- struct adpu_event *next;
+ int message; /* What message to send the ADPU in */
+ void (*callback)(void *data); /* Callback function for when response is received */
+ void *data; /* Data to callback */
+ void *adpu; /* ADPU to send */
+ int adpu_len; /* Length of ADPU */
+ int sent; /* Have we been sent already? */
+ struct adpu_event *next; /* Linked list pointer */
};
/* q931_call datastructure */
Index: q931.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/q931.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- q931.c 23 Dec 2004 18:02:00 -0000 1.7
+++ q931.c 29 Dec 2004 19:26:49 -0000 1.8
@@ -2071,6 +2071,8 @@
int offset=0;
int x;
int codeset;
+ struct adpu_event *facevent = c->adpus;
+
memset(buf, 0, sizeof(buf));
len = sizeof(buf);
init_header(pri, c, buf, &h, &mh, &len);
@@ -2078,11 +2080,30 @@
x=0;
codeset = 0;
while(ies[x] > -1) {
- res = add_ie(pri, c, mh->msg, ies[x], (q931_ie *)(mh->data + offset), len, &codeset);
+ if (x == Q931_IE_FACILITY) {
+ res = 0;
+ while (facevent) {
+ if (!facevent->sent && (facevent->message == msgtype)) {
+ int tmpres;
+ tmpres = add_ie(pri, c, mh->msg, ies[x], (q931_ie *)(mh->data + offset), len, &codeset);
+ if (tmpres < 0) {
+ pri_error("!! Unable to add IE '%s'\n", ie2str(ies[x]));
+ return -1;
+ }
+ res += tmpres;
+ facevent->sent = 1;
+ }
+ facevent = facevent->next;
+ }
+ } else {
+ res = add_ie(pri, c, mh->msg, ies[x], (q931_ie *)(mh->data + offset), len, &codeset);
+ }
+
if (res < 0) {
pri_error("!! Unable to add IE '%s'\n", ie2str(ies[x]));
return -1;
}
+
offset += res;
len -= res;
x++;
- Previous message: [Asterisk-cvs] asterisk/apps app_read.c,1.13,1.14
- Next message: [Asterisk-cvs] asterisk/channels chan_iax2.c, 1.229,
1.230 iax2-parser.c, 1.32, 1.33 iax2-parser.h, 1.12,
1.13 iax2.h, 1.18, 1.19
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list