[libss7-commits] mattf: branch mattf/bug13495 r227 - /team/mattf/bug13495/
SVN commits to the libss7 project
libss7-commits at lists.digium.com
Wed Dec 3 13:47:08 CST 2008
Author: mattf
Date: Wed Dec 3 13:47:08 2008
New Revision: 227
URL: http://svn.digium.com/view/libss7?view=rev&rev=227
Log:
ss7linktest builds again
Modified:
team/mattf/bug13495/Makefile
team/mattf/bug13495/ss7linktest.c
Modified: team/mattf/bug13495/Makefile
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/Makefile?view=diff&rev=227&r1=226&r2=227
==============================================================================
--- team/mattf/bug13495/Makefile (original)
+++ team/mattf/bug13495/Makefile Wed Dec 3 13:47:08 2008
@@ -69,7 +69,7 @@
gcc -g -o ss7test ss7test.c libss7.a -lpthread
ss7linktest: ss7linktest.c $(STATIC_LIBRARY)
-# gcc -g -o ss7linktest ss7linktest.c libss7.a -lpthread
+ gcc -g -o ss7linktest ss7linktest.c libss7.a -lpthread
parser_debug: parser_debug.c $(STATIC_LIBRARY)
gcc -g -Wall -o parser_debug parser_debug.c libss7.a
Modified: team/mattf/bug13495/ss7linktest.c
URL: http://svn.digium.com/view/libss7/team/mattf/bug13495/ss7linktest.c?view=diff&rev=227&r1=226&r2=227
==============================================================================
--- team/mattf/bug13495/ss7linktest.c (original)
+++ team/mattf/bug13495/ss7linktest.c Wed Dec 3 13:47:08 2008
@@ -29,6 +29,7 @@
* terms granted here.
*/
+#include <sys/time.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -57,9 +58,8 @@
#define NUM_BUFS 32
-void ss7_call(struct ss7 *ss7)
-{
- int i;
+static void ss7_call(struct ss7 *ss7)
+{
struct isup_call *c;
c = isup_new_call(ss7);
@@ -73,20 +73,23 @@
}
}
-void *ss7_run(void *data)
+static void *ss7_run(void *data)
{
int res = 0;
- unsigned char readbuf[512] = "";
struct timeval *next = NULL, tv;
struct linkset *linkset = (struct linkset *) data;
struct ss7 *ss7 = linkset->ss7;
- int ourlink = linknum;
ss7_event *e = NULL;
struct pollfd poller;
int nextms;
int x;
struct isup_call *c;
-
+ unsigned char state[255];
+ int i;
+
+ for (i = 0; i < 255; i++) {
+ state[i] = 0;
+ }
printf("Starting link %d\n", linknum++);
ss7_start(ss7);
@@ -112,10 +115,12 @@
res = poll(&poller, 1, nextms);
if (res < 0) {
+#if 0
printf("next->tv_sec = %d\n", next->tv_sec);
printf("next->tv_usec = %d\n", next->tv_usec);
printf("tv->tv_sec = %d\n", tv.tv_sec);
printf("tv->tv_usec = %d\n", tv.tv_usec);
+#endif
perror("select");
}
else if (!res) {
@@ -172,7 +177,7 @@
break;
case ISUP_EVENT_GRS:
printf("Got GRS from cic %d to %d: Acknowledging\n", e->grs.startcic, e->grs.endcic);
- isup_gra(ss7, e->grs.startcic, e->grs.endcic, dpc);
+ isup_gra(ss7, e->grs.call, e->grs.endcic, state);
break;
case ISUP_EVENT_RSC:
isup_rlc(ss7, e->rsc.call);
@@ -182,13 +187,13 @@
ss7_call(ss7);
break;
case ISUP_EVENT_BLO:
- isup_bla(ss7, e->blo.cic, dpc);
+ isup_bla(ss7, e->blo.call);
break;
case ISUP_EVENT_CGB:
- isup_cgba(ss7, e->cgb.startcic, e->cgb.endcic, dpc, e->cgb.status, e->cgb.type);
+ isup_cgba(ss7, e->cgb.call, e->cgb.endcic, e->cgb.status);
break;
case ISUP_EVENT_CGU:
- isup_cgua(ss7, e->cgu.startcic, e->cgu.endcic, dpc, e->cgu.status, e->cgu.type);
+ isup_cgua(ss7, e->cgu.call, e->cgu.endcic, e->cgu.status);
break;
case ISUP_EVENT_IAM:
printf("Got IAM for cic %d and number %s\n", e->iam.cic, e->iam.called_party_num);
@@ -223,13 +228,13 @@
}
}
-void myprintf(struct ss7 *ss7, char *fmt)
-{
- int i = 0;
+static void myprintf(struct ss7 *ss7, char *fmt)
+{
+ //int i = 0;
printf("%s", fmt);
}
-int zap_open(int devnum, int *ismtp2)
+static int zap_open(int devnum, int *ismtp2)
{
int fd;
struct dahdi_bufferinfo bi;
@@ -260,7 +265,7 @@
return fd;
}
-void print_args(void)
+static void print_args(void)
{
printf("Incorrect arguments. Should be:\n");
printf("ss7linktest [sigchan number] [ss7 style - itu or ansi] [OPC - in decimal] [DPC - in decimal]\n");
More information about the libss7-commits
mailing list