[Asterisk-cvs]
libpri-matt pri_facility.c, 1.9, 1.10 pri_facility.h, 1.7, 1.8
mattf at lists.digium.com
mattf at lists.digium.com
Wed Jan 12 18:28:26 CST 2005
Update of /usr/cvsroot/libpri-matt
In directory mongoose.digium.com:/tmp/cvs-serv15745
Modified Files:
pri_facility.c pri_facility.h
Log Message:
Initial MWIActivate ADPU code
Index: pri_facility.c
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- pri_facility.c 6 Jan 2005 17:44:41 -0000 1.9
+++ pri_facility.c 13 Jan 2005 00:32:26 -0000 1.10
@@ -42,14 +42,44 @@
}
#endif
-int mwi_activate_encode_and_queue(q931_call *call, )
+void mwi_activate_encode_cb(void *data)
{
- int i = 0;
+ free(data);
+ return;
+}
+
+int mwi_activate_encode_and_queue(q931_call *call)
+{
+ int res = 0, i = 0;
+ unsigned char * buffer = NULL;
+ int destlen = strlen(call->callednum);
/* TODO:1 */
+ buffer = malloc(255);
+ if (!buffer)
+ return -1;
+
+ if (destlen <= 0) {
+ free(buffer);
+ return -1;
+ } else if (destlen > 20)
+ destlen = 20; /* Destination number cannot be greater then 20 digits */
+
+ buffer[i++] = 0x30; /* Sequence */
+ buffer[i++] = 5 /* All fixed length necessary parts */
+ + destlen;
+ buffer[i++] = 0x80; /* PartyNumber */
+ buffer[i++] = destlen;
+ strncpy(&buffer[i], call->callednum, destlen);
+ i += destlen;
+ buffer[i++] = 0xa; /* Enumeration: basicService */
+ buffer[i++] = 0x1; /* Length */
+ buffer[i++] = 0x1; /* contents: Voice */
+
+ res = pri_call_adpu_queue(call, Q931_SETUP, buffer, i, mwi_activate_encode_cb, buffer);
- return i;
+ return res;
}
static int rose_return_result_decode(q931_call *call, unsigned char *data, int len)
Index: pri_facility.h
===================================================================
RCS file: /usr/cvsroot/libpri-matt/pri_facility.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- pri_facility.h 29 Dec 2004 18:09:45 -0000 1.7
+++ pri_facility.h 13 Jan 2005 00:32:26 -0000 1.8
@@ -113,5 +113,7 @@
#define FUNC_SEND(name) int ((name))(int full_ie, struct pri *pri, q931_call *call, int msgtype, q931_ie *ie, int len)
extern FUNC_SEND(transmit_facility);
extern FUNC_RECV(receive_facility);
+int mwi_activate_encode_and_queue(q931_call *call);
+void mwi_activate_encode_cb(void *data);
#endif /* _PRI_FACILITY_H */
More information about the svn-commits
mailing list