From 78e37908bca3f878e7ba582471a1a05f7a4ae30e Mon Sep 17 00:00:00 2001 From: Brian West Date: Fri, 7 Apr 2006 17:32:14 +0000 Subject: [PATCH] Add optional packetization and VAD buster options to RTP git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1090 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- libs/srtp/Makefile | 2 +- libs/srtp/config.log | 779 +++++++++--------- libs/srtp/config.status | 26 +- libs/srtp/crypto/Makefile | 2 +- libs/srtp/crypto/include/config.h | 4 +- src/include/switch_rtp.h | 30 +- src/include/switch_types.h | 10 +- .../endpoints/mod_dingaling/mod_dingaling.c | 2 + src/mod/endpoints/mod_exosip/mod_exosip.c | 2 + src/switch_rtp.c | 203 +++-- 10 files changed, 570 insertions(+), 490 deletions(-) diff --git a/libs/srtp/Makefile b/libs/srtp/Makefile index 5248d1f72b..1bc052ecbd 100644 --- a/libs/srtp/Makefile +++ b/libs/srtp/Makefile @@ -34,7 +34,7 @@ CC = gcc INCDIR = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include DEFS = -DHAVE_CONFIG_H CPPFLAGS= -CFLAGS = -Wall -O4 -fexpensive-optimizations -funroll-loops +CFLAGS = -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops LIBS = LDFLAGS = -L. COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) diff --git a/libs/srtp/config.log b/libs/srtp/config.log index 468f78547e..8044f7a859 100644 --- a/libs/srtp/config.log +++ b/libs/srtp/config.log @@ -4,22 +4,22 @@ running configure, to aid debugging if configure makes a mistake. It was created by configure, which was generated by GNU Autoconf 2.59. Invocation command line was - $ ./configure --prefix=/usr/local/freeswitch + $ ./configure --prefix=/usr/local/freeswitch --enable-pic ## --------- ## ## Platform. ## ## --------- ## -hostname = agentbox3 -uname -m = i686 -uname -r = 2.6.9-r1 +hostname = drone1 +uname -m = x86_64 +uname -r = 2.6.13.4 uname -s = Linux -uname -v = #4 SMP Tue Mar 21 23:08:10 UTC 2006 +uname -v = #2 SMP Mon Oct 31 12:11:19 UTC 2005 /usr/bin/uname -p = unknown /bin/uname -X = unknown -/bin/arch = i686 +/bin/arch = x86_64 /usr/bin/arch -k = unknown /usr/convex/getsysinfo = unknown hostinfo = unknown @@ -49,17 +49,17 @@ configure:1450: found /usr/bin/gcc configure:1460: result: gcc configure:1704: checking for C compiler version configure:1707: gcc --version &5 -gcc (GCC) 3.3.4 (AsterLinux) -Copyright (C) 2003 Free Software Foundation, Inc. +gcc (GCC) 3.4.4 (CRUX) +Copyright (C) 2004 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. configure:1710: $? = 0 configure:1712: gcc -v &5 -Reading specs from /usr/lib/gcc-lib/i686-pc-linux-gnu/3.3.4/specs -Configured with: ../gcc-3.3.4/configure --prefix=/usr --enable-languages=c,c++,objc --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-shared --disable-nls +Reading specs from /usr/lib64/gcc/x86_64-unknown-linux-gnu/3.4.4/specs +Configured with: ../gcc-3.4.4/configure --prefix=/usr --libexecdir=/usr/lib64 --libdir=/usr/lib64 --with-slibdir=/lib64 --enable-languages=c,c++,objc --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-shared --enable-multilib --disable-nls Thread model: posix -gcc version 3.3.4 (AsterLinux) +gcc version 3.4.4 (CRUX) configure:1715: $? = 0 configure:1717: gcc -V &5 gcc: `-V' option must have argument @@ -161,145 +161,145 @@ configure: failed program was: configure:2759: checking for egrep configure:2769: result: grep -E configure:2774: checking for ANSI C header files -configure:2799: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2799: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 configure:2805: $? = 0 configure:2809: test -z || test ! -s conftest.err configure:2812: $? = 0 configure:2815: test -s conftest.o configure:2818: $? = 0 -configure:2904: gcc -o conftest -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2907: gcc -o conftest -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 conftest.c: In function `main': conftest.c:27: warning: implicit declaration of function `exit' -configure:2907: $? = 0 -configure:2909: ./conftest -configure:2912: $? = 0 -configure:2927: result: yes -configure:2951: checking for sys/types.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2910: $? = 0 +configure:2912: ./conftest +configure:2915: $? = 0 +configure:2930: result: yes +configure:2954: checking for sys/types.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for sys/stat.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for sys/stat.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for stdlib.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for stdlib.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for string.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for string.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for memory.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for memory.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for strings.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for strings.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for inttypes.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for inttypes.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for stdint.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for stdint.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:2951: checking for unistd.h -configure:2967: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:2973: $? = 0 -configure:2977: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:2954: checking for unistd.h +configure:2970: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:2976: $? = 0 +configure:2980: test -z || test ! -s conftest.err -configure:2980: $? = 0 -configure:2983: test -s conftest.o -configure:2986: $? = 0 -configure:2997: result: yes -configure:3014: checking for stdlib.h -configure:3019: result: yes -configure:3164: checking for unistd.h -configure:3169: result: yes -configure:3323: checking byteswap.h usability -configure:3335: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:3341: $? = 0 -configure:3345: test -z +configure:2983: $? = 0 +configure:2986: test -s conftest.o +configure:2989: $? = 0 +configure:3000: result: yes +configure:3017: checking for stdlib.h +configure:3022: result: yes +configure:3167: checking for unistd.h +configure:3172: result: yes +configure:3326: checking byteswap.h usability +configure:3338: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:3344: $? = 0 +configure:3348: test -z || test ! -s conftest.err -configure:3348: $? = 0 -configure:3351: test -s conftest.o -configure:3354: $? = 0 -configure:3364: result: yes -configure:3368: checking byteswap.h presence -configure:3378: gcc -E conftest.c -configure:3384: $? = 0 -configure:3404: result: yes -configure:3439: checking for byteswap.h -configure:3446: result: yes -configure:3464: checking for stdint.h -configure:3469: result: yes -configure:3623: checking sys/uio.h usability -configure:3635: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:3641: $? = 0 -configure:3645: test -z +configure:3351: $? = 0 +configure:3354: test -s conftest.o +configure:3357: $? = 0 +configure:3367: result: yes +configure:3371: checking byteswap.h presence +configure:3381: gcc -E conftest.c +configure:3387: $? = 0 +configure:3407: result: yes +configure:3442: checking for byteswap.h +configure:3449: result: yes +configure:3467: checking for stdint.h +configure:3472: result: yes +configure:3626: checking sys/uio.h usability +configure:3638: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:3644: $? = 0 +configure:3648: test -z || test ! -s conftest.err -configure:3648: $? = 0 -configure:3651: test -s conftest.o -configure:3654: $? = 0 -configure:3664: result: yes -configure:3668: checking sys/uio.h presence -configure:3678: gcc -E conftest.c -configure:3684: $? = 0 -configure:3704: result: yes -configure:3739: checking for sys/uio.h -configure:3746: result: yes -configure:3764: checking for inttypes.h -configure:3769: result: yes -configure:3914: checking for sys/types.h -configure:3919: result: yes -configure:4073: checking machine/types.h usability -configure:4085: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:3651: $? = 0 +configure:3654: test -s conftest.o +configure:3657: $? = 0 +configure:3667: result: yes +configure:3671: checking sys/uio.h presence +configure:3681: gcc -E conftest.c +configure:3687: $? = 0 +configure:3707: result: yes +configure:3742: checking for sys/uio.h +configure:3749: result: yes +configure:3767: checking for inttypes.h +configure:3772: result: yes +configure:3917: checking for sys/types.h +configure:3922: result: yes +configure:4076: checking machine/types.h usability +configure:4088: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 conftest.c:61:27: machine/types.h: No such file or directory -configure:4091: $? = 1 +configure:4094: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -362,11 +362,11 @@ configure: failed program was: | # include | #endif | #include -configure:4114: result: no -configure:4118: checking machine/types.h presence -configure:4128: gcc -E conftest.c +configure:4117: result: no +configure:4121: checking machine/types.h presence +configure:4131: gcc -E conftest.c conftest.c:27:27: machine/types.h: No such file or directory -configure:4134: $? = 1 +configure:4137: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -395,13 +395,13 @@ configure: failed program was: | #define HAVE_SYS_TYPES_H 1 | /* end confdefs.h. */ | #include -configure:4154: result: no -configure:4189: checking for machine/types.h -configure:4196: result: no -configure:4223: checking sys/int_types.h usability -configure:4235: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4157: result: no +configure:4192: checking for machine/types.h +configure:4199: result: no +configure:4226: checking sys/int_types.h usability +configure:4238: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 conftest.c:61:27: sys/int_types.h: No such file or directory -configure:4241: $? = 1 +configure:4244: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -464,11 +464,11 @@ configure: failed program was: | # include | #endif | #include -configure:4264: result: no -configure:4268: checking sys/int_types.h presence -configure:4278: gcc -E conftest.c +configure:4267: result: no +configure:4271: checking sys/int_types.h presence +configure:4281: gcc -E conftest.c conftest.c:27:27: sys/int_types.h: No such file or directory -configure:4284: $? = 1 +configure:4287: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -497,58 +497,58 @@ configure: failed program was: | #define HAVE_SYS_TYPES_H 1 | /* end confdefs.h. */ | #include -configure:4304: result: no -configure:4339: checking for sys/int_types.h -configure:4346: result: no -configure:4376: checking sys/socket.h usability -configure:4388: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:4394: $? = 0 -configure:4398: test -z +configure:4307: result: no +configure:4342: checking for sys/int_types.h +configure:4349: result: no +configure:4379: checking sys/socket.h usability +configure:4391: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4397: $? = 0 +configure:4401: test -z || test ! -s conftest.err -configure:4401: $? = 0 -configure:4404: test -s conftest.o -configure:4407: $? = 0 -configure:4417: result: yes -configure:4421: checking sys/socket.h presence -configure:4431: gcc -E conftest.c -configure:4437: $? = 0 -configure:4457: result: yes -configure:4492: checking for sys/socket.h -configure:4499: result: yes -configure:4376: checking netinet/in.h usability -configure:4388: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:4394: $? = 0 -configure:4398: test -z +configure:4404: $? = 0 +configure:4407: test -s conftest.o +configure:4410: $? = 0 +configure:4420: result: yes +configure:4424: checking sys/socket.h presence +configure:4434: gcc -E conftest.c +configure:4440: $? = 0 +configure:4460: result: yes +configure:4495: checking for sys/socket.h +configure:4502: result: yes +configure:4379: checking netinet/in.h usability +configure:4391: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4397: $? = 0 +configure:4401: test -z || test ! -s conftest.err -configure:4401: $? = 0 -configure:4404: test -s conftest.o -configure:4407: $? = 0 -configure:4417: result: yes -configure:4421: checking netinet/in.h presence -configure:4431: gcc -E conftest.c -configure:4437: $? = 0 -configure:4457: result: yes -configure:4492: checking for netinet/in.h -configure:4499: result: yes -configure:4376: checking arpa/inet.h usability -configure:4388: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:4394: $? = 0 -configure:4398: test -z +configure:4404: $? = 0 +configure:4407: test -s conftest.o +configure:4410: $? = 0 +configure:4420: result: yes +configure:4424: checking netinet/in.h presence +configure:4434: gcc -E conftest.c +configure:4440: $? = 0 +configure:4460: result: yes +configure:4495: checking for netinet/in.h +configure:4502: result: yes +configure:4379: checking arpa/inet.h usability +configure:4391: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4397: $? = 0 +configure:4401: test -z || test ! -s conftest.err -configure:4401: $? = 0 -configure:4404: test -s conftest.o -configure:4407: $? = 0 -configure:4417: result: yes -configure:4421: checking arpa/inet.h presence -configure:4431: gcc -E conftest.c -configure:4437: $? = 0 -configure:4457: result: yes -configure:4492: checking for arpa/inet.h -configure:4499: result: yes -configure:4526: checking windows.h usability -configure:4538: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4404: $? = 0 +configure:4407: test -s conftest.o +configure:4410: $? = 0 +configure:4420: result: yes +configure:4424: checking arpa/inet.h presence +configure:4434: gcc -E conftest.c +configure:4440: $? = 0 +configure:4460: result: yes +configure:4495: checking for arpa/inet.h +configure:4502: result: yes +configure:4529: checking windows.h usability +configure:4541: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 conftest.c:64:21: windows.h: No such file or directory -configure:4544: $? = 1 +configure:4547: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -614,11 +614,11 @@ configure: failed program was: | # include | #endif | #include -configure:4567: result: no -configure:4571: checking windows.h presence -configure:4581: gcc -E conftest.c +configure:4570: result: no +configure:4574: checking windows.h presence +configure:4584: gcc -E conftest.c conftest.c:30:21: windows.h: No such file or directory -configure:4587: $? = 1 +configure:4590: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -650,193 +650,193 @@ configure: failed program was: | #define HAVE_ARPA_INET_H 1 | /* end confdefs.h. */ | #include -configure:4607: result: no -configure:4642: checking for windows.h -configure:4649: result: no -configure:4826: checking syslog.h usability -configure:4838: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:4844: $? = 0 -configure:4848: test -z +configure:4610: result: no +configure:4645: checking for windows.h +configure:4652: result: no +configure:4829: checking syslog.h usability +configure:4841: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4847: $? = 0 +configure:4851: test -z || test ! -s conftest.err -configure:4851: $? = 0 -configure:4854: test -s conftest.o -configure:4857: $? = 0 -configure:4867: result: yes -configure:4871: checking syslog.h presence -configure:4881: gcc -E conftest.c -configure:4887: $? = 0 -configure:4907: result: yes -configure:4942: checking for syslog.h -configure:4949: result: yes -configure:4963: checking for int8_t -configure:4987: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:4993: $? = 0 -configure:4997: test -z +configure:4854: $? = 0 +configure:4857: test -s conftest.o +configure:4860: $? = 0 +configure:4870: result: yes +configure:4874: checking syslog.h presence +configure:4884: gcc -E conftest.c +configure:4890: $? = 0 +configure:4910: result: yes +configure:4945: checking for syslog.h +configure:4952: result: yes +configure:4966: checking for int8_t +configure:4990: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:4996: $? = 0 +configure:5000: test -z || test ! -s conftest.err -configure:5000: $? = 0 -configure:5003: test -s conftest.o -configure:5006: $? = 0 -configure:5017: result: yes -configure:5027: checking for uint8_t -configure:5051: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5057: $? = 0 -configure:5061: test -z +configure:5003: $? = 0 +configure:5006: test -s conftest.o +configure:5009: $? = 0 +configure:5020: result: yes +configure:5030: checking for uint8_t +configure:5054: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5060: $? = 0 +configure:5064: test -z || test ! -s conftest.err -configure:5064: $? = 0 -configure:5067: test -s conftest.o -configure:5070: $? = 0 -configure:5081: result: yes -configure:5091: checking for int16_t -configure:5115: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5121: $? = 0 -configure:5125: test -z +configure:5067: $? = 0 +configure:5070: test -s conftest.o +configure:5073: $? = 0 +configure:5084: result: yes +configure:5094: checking for int16_t +configure:5118: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5124: $? = 0 +configure:5128: test -z || test ! -s conftest.err -configure:5128: $? = 0 -configure:5131: test -s conftest.o -configure:5134: $? = 0 -configure:5145: result: yes -configure:5155: checking for uint16_t -configure:5179: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5185: $? = 0 -configure:5189: test -z +configure:5131: $? = 0 +configure:5134: test -s conftest.o +configure:5137: $? = 0 +configure:5148: result: yes +configure:5158: checking for uint16_t +configure:5182: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5188: $? = 0 +configure:5192: test -z || test ! -s conftest.err -configure:5192: $? = 0 -configure:5195: test -s conftest.o -configure:5198: $? = 0 -configure:5209: result: yes -configure:5219: checking for int32_t -configure:5243: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5249: $? = 0 -configure:5253: test -z +configure:5195: $? = 0 +configure:5198: test -s conftest.o +configure:5201: $? = 0 +configure:5212: result: yes +configure:5222: checking for int32_t +configure:5246: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5252: $? = 0 +configure:5256: test -z || test ! -s conftest.err -configure:5256: $? = 0 -configure:5259: test -s conftest.o -configure:5262: $? = 0 -configure:5273: result: yes -configure:5283: checking for uint32_t -configure:5307: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5313: $? = 0 -configure:5317: test -z +configure:5259: $? = 0 +configure:5262: test -s conftest.o +configure:5265: $? = 0 +configure:5276: result: yes +configure:5286: checking for uint32_t +configure:5310: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5316: $? = 0 +configure:5320: test -z || test ! -s conftest.err -configure:5320: $? = 0 -configure:5323: test -s conftest.o -configure:5326: $? = 0 -configure:5337: result: yes -configure:5347: checking for uint64_t -configure:5371: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5377: $? = 0 -configure:5381: test -z +configure:5323: $? = 0 +configure:5326: test -s conftest.o +configure:5329: $? = 0 +configure:5340: result: yes +configure:5350: checking for uint64_t +configure:5374: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5380: $? = 0 +configure:5384: test -z || test ! -s conftest.err -configure:5384: $? = 0 -configure:5387: test -s conftest.o -configure:5390: $? = 0 -configure:5401: result: yes -configure:5412: checking for unsigned long -configure:5436: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5442: $? = 0 -configure:5446: test -z +configure:5387: $? = 0 +configure:5390: test -s conftest.o +configure:5393: $? = 0 +configure:5404: result: yes +configure:5415: checking for unsigned long +configure:5439: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5445: $? = 0 +configure:5449: test -z || test ! -s conftest.err -configure:5449: $? = 0 -configure:5452: test -s conftest.o -configure:5455: $? = 0 -configure:5466: result: yes -configure:5469: checking size of unsigned long -configure:5788: gcc -o conftest -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5791: $? = 0 -configure:5793: ./conftest -configure:5796: $? = 0 -configure:5819: result: 4 -configure:5826: checking for unsigned long long -configure:5850: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:5856: $? = 0 -configure:5860: test -z +configure:5452: $? = 0 +configure:5455: test -s conftest.o +configure:5458: $? = 0 +configure:5469: result: yes +configure:5472: checking size of unsigned long +configure:5791: gcc -o conftest -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5794: $? = 0 +configure:5796: ./conftest +configure:5799: $? = 0 +configure:5822: result: 8 +configure:5829: checking for unsigned long long +configure:5853: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5859: $? = 0 +configure:5863: test -z || test ! -s conftest.err -configure:5863: $? = 0 -configure:5866: test -s conftest.o -configure:5869: $? = 0 -configure:5880: result: yes -configure:5883: checking size of unsigned long long -configure:6202: gcc -o conftest -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6205: $? = 0 -configure:6207: ./conftest -configure:6210: $? = 0 -configure:6233: result: 8 -configure:6241: checking for an ANSI C-conforming const -configure:6308: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:5866: $? = 0 +configure:5869: test -s conftest.o +configure:5872: $? = 0 +configure:5883: result: yes +configure:5886: checking size of unsigned long long +configure:6205: gcc -o conftest -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6208: $? = 0 +configure:6210: ./conftest +configure:6213: $? = 0 +configure:6236: result: 8 +configure:6244: checking for an ANSI C-conforming const +configure:6311: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 conftest.c: In function `main': conftest.c:67: warning: unused variable `s' conftest.c:87: warning: unused variable `foo' conftest.c:48: warning: unused variable `x' conftest.c:54: warning: unused variable `zero' -conftest.c:66: warning: `t' might be used uninitialized in this function -conftest.c:84: warning: `b' might be used uninitialized in this function -configure:6314: $? = 0 -configure:6318: test -z +conftest.c:84: warning: 'b' might be used uninitialized in this function +conftest.c:66: warning: 't' might be used uninitialized in this function +configure:6317: $? = 0 +configure:6321: test -z || test ! -s conftest.err -configure:6321: $? = 0 -configure:6324: test -s conftest.o -configure:6327: $? = 0 -configure:6338: result: yes -configure:6348: checking for inline -configure:6369: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6375: $? = 0 -configure:6379: test -z +configure:6324: $? = 0 +configure:6327: test -s conftest.o +configure:6330: $? = 0 +configure:6341: result: yes +configure:6351: checking for inline +configure:6372: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6378: $? = 0 +configure:6382: test -z || test ! -s conftest.err -configure:6382: $? = 0 -configure:6385: test -s conftest.o -configure:6388: $? = 0 -configure:6400: result: inline -configure:6419: checking for size_t -configure:6443: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6449: $? = 0 -configure:6453: test -z +configure:6385: $? = 0 +configure:6388: test -s conftest.o +configure:6391: $? = 0 +configure:6403: result: inline +configure:6422: checking for size_t +configure:6446: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6452: $? = 0 +configure:6456: test -z || test ! -s conftest.err -configure:6456: $? = 0 -configure:6459: test -s conftest.o -configure:6462: $? = 0 -configure:6473: result: yes -configure:6492: checking for socket -configure:6549: gcc -o conftest -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6555: $? = 0 -configure:6559: test -z +configure:6459: $? = 0 +configure:6462: test -s conftest.o +configure:6465: $? = 0 +configure:6476: result: yes +configure:6495: checking for socket +configure:6552: gcc -o conftest -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6558: $? = 0 +configure:6562: test -z || test ! -s conftest.err -configure:6562: $? = 0 -configure:6565: test -s conftest -configure:6568: $? = 0 -configure:6580: result: yes -configure:6492: checking for inet_aton -configure:6549: gcc -o conftest -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6555: $? = 0 -configure:6559: test -z +configure:6565: $? = 0 +configure:6568: test -s conftest +configure:6571: $? = 0 +configure:6583: result: yes +configure:6495: checking for inet_aton +configure:6552: gcc -o conftest -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6558: $? = 0 +configure:6562: test -z || test ! -s conftest.err -configure:6562: $? = 0 -configure:6565: test -s conftest -configure:6568: $? = 0 -configure:6580: result: yes -configure:6492: checking for usleep -configure:6549: gcc -o conftest -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6555: $? = 0 -configure:6559: test -z +configure:6565: $? = 0 +configure:6568: test -s conftest +configure:6571: $? = 0 +configure:6583: result: yes +configure:6495: checking for usleep +configure:6552: gcc -o conftest -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6558: $? = 0 +configure:6562: test -z || test ! -s conftest.err -configure:6562: $? = 0 -configure:6565: test -s conftest -configure:6568: $? = 0 -configure:6580: result: yes -configure:6726: checking whether byte ordering is bigendian -configure:6753: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 -configure:6759: $? = 0 -configure:6763: test -z +configure:6565: $? = 0 +configure:6568: test -s conftest +configure:6571: $? = 0 +configure:6583: result: yes +configure:6729: checking whether byte ordering is bigendian +configure:6756: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6762: $? = 0 +configure:6766: test -z || test ! -s conftest.err -configure:6766: $? = 0 -configure:6769: test -s conftest.o -configure:6772: $? = 0 -configure:6796: gcc -c -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 +configure:6769: $? = 0 +configure:6772: test -s conftest.o +configure:6775: $? = 0 +configure:6799: gcc -c -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops conftest.c >&5 conftest.c: In function `main': conftest.c:50: error: `not' undeclared (first use in this function) conftest.c:50: error: (Each undeclared identifier is reported only once conftest.c:50: error: for each function it appears in.) conftest.c:50: error: parse error before "big" -configure:6802: $? = 1 +configure:6805: $? = 1 configure: failed program was: | /* confdefs.h. */ | @@ -874,7 +874,7 @@ configure: failed program was: | #define HAVE_INT32_T 1 | #define HAVE_UINT32_T 1 | #define HAVE_UINT64_T 1 -| #define SIZEOF_UNSIGNED_LONG 4 +| #define SIZEOF_UNSIGNED_LONG 8 | #define SIZEOF_UNSIGNED_LONG_LONG 8 | #define HAVE_SOCKET 1 | #define HAVE_INET_ATON 1 @@ -893,24 +893,24 @@ configure: failed program was: | ; | return 0; | } -configure:6937: result: no -configure:6963: checking build system type -configure:6981: result: i686-pc-linux-gnu -configure:6989: checking host system type -configure:7003: result: i686-pc-linux-gnu -configure:7049: checking whether to compile in debugging -configure:7065: result: yes -configure:7068: checking whether to use ISMAcryp code -configure:7084: result: no -configure:7087: checking whether to use syslog for error reporting -configure:7103: result: no -configure:7106: checking whether to use stdout for error reporting -configure:7122: result: yes -configure:7125: checking whether to use /dev/console for error reporting -configure:7146: result: no -configure:7149: checking whether to use GDOI key management -configure:7167: result: no -configure:7269: creating ./config.status +configure:6940: result: no +configure:6966: checking build system type +configure:6984: result: x86_64-unknown-linux-gnu +configure:6992: checking host system type +configure:7006: result: x86_64-unknown-linux-gnu +configure:7052: checking whether to compile in debugging +configure:7068: result: yes +configure:7071: checking whether to use ISMAcryp code +configure:7087: result: no +configure:7090: checking whether to use syslog for error reporting +configure:7106: result: no +configure:7109: checking whether to use stdout for error reporting +configure:7125: result: yes +configure:7128: checking whether to use /dev/console for error reporting +configure:7149: result: no +configure:7152: checking whether to use GDOI key management +configure:7170: result: no +configure:7272: creating ./config.status ## ---------------------- ## ## Running config.status. ## @@ -925,7 +925,7 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $ ./config.status -on agentbox3 +on drone1 config.status:664: creating Makefile config.status:664: creating crypto/Makefile @@ -936,8 +936,8 @@ config.status:768: creating crypto/include/config.h ## Cache variables. ## ## ---------------- ## -ac_cv_build=i686-pc-linux-gnu -ac_cv_build_alias=i686-pc-linux-gnu +ac_cv_build=x86_64-unknown-linux-gnu +ac_cv_build_alias=x86_64-unknown-linux-gnu ac_cv_c_bigendian=no ac_cv_c_compiler_gnu=yes ac_cv_c_const=yes @@ -982,8 +982,8 @@ ac_cv_header_sys_uio_h=yes ac_cv_header_syslog_h=yes ac_cv_header_unistd_h=yes ac_cv_header_windows_h=no -ac_cv_host=i686-pc-linux-gnu -ac_cv_host_alias=i686-pc-linux-gnu +ac_cv_host=x86_64-unknown-linux-gnu +ac_cv_host_alias=x86_64-unknown-linux-gnu ac_cv_objext=o ac_cv_path_install='/usr/bin/install -c' ac_cv_prog_CPP='gcc -E' @@ -992,7 +992,7 @@ ac_cv_prog_ac_ct_RANLIB=ranlib ac_cv_prog_cc_g=yes ac_cv_prog_cc_stdc= ac_cv_prog_egrep='grep -E' -ac_cv_sizeof_unsigned_long=4 +ac_cv_sizeof_unsigned_long=8 ac_cv_sizeof_unsigned_long_long=8 ac_cv_type_int16_t=yes ac_cv_type_int32_t=yes @@ -1010,7 +1010,7 @@ ac_cv_type_unsigned_long_long=yes ## ----------------- ## CC='gcc' -CFLAGS='-Wall -O4 -fexpensive-optimizations -funroll-loops' +CFLAGS='-fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops' CPP='gcc -E' CPPFLAGS='' DEFS='-DHAVE_CONFIG_H' @@ -1041,18 +1041,18 @@ SHELL='/bin/sh' ac_ct_CC='gcc' ac_ct_RANLIB='ranlib' bindir='${exec_prefix}/bin' -build='i686-pc-linux-gnu' +build='x86_64-unknown-linux-gnu' build_alias='' -build_cpu='i686' +build_cpu='x86_64' build_os='linux-gnu' -build_vendor='pc' +build_vendor='unknown' datadir='${prefix}/share' exec_prefix='${prefix}' -host='i686-pc-linux-gnu' +host='x86_64-unknown-linux-gnu' host_alias='' -host_cpu='i686' +host_cpu='x86_64' host_os='linux-gnu' -host_vendor='pc' +host_vendor='unknown' includedir='${prefix}/include' infodir='${prefix}/info' libdir='${exec_prefix}/lib' @@ -1105,13 +1105,12 @@ target_alias='' #define HAVE_UNISTD_H 1 #define HAVE_UNISTD_H 1 #define HAVE_USLEEP 1 -#define HAVE_X86 1 #define PACKAGE_BUGREPORT "" #define PACKAGE_NAME "" #define PACKAGE_STRING "" #define PACKAGE_TARNAME "" #define PACKAGE_VERSION "" -#define SIZEOF_UNSIGNED_LONG 4 +#define SIZEOF_UNSIGNED_LONG 8 #define SIZEOF_UNSIGNED_LONG_LONG 8 #define STDC_HEADERS 1 diff --git a/libs/srtp/config.status b/libs/srtp/config.status index 364f53b90e..8fa9c0b7de 100755 --- a/libs/srtp/config.status +++ b/libs/srtp/config.status @@ -300,7 +300,7 @@ Report bugs to ." ac_cs_version="\ config.status configured by ./configure, generated by GNU Autoconf 2.59, - with options \"'--prefix=/usr/local/freeswitch'\" + with options \"'--prefix=/usr/local/freeswitch' '--enable-pic'\" Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation @@ -379,8 +379,8 @@ if $ac_cs_silent; then fi if $ac_cs_recheck; then - echo "running /bin/sh ./configure " '--prefix=/usr/local/freeswitch' $ac_configure_extra_args " --no-create --no-recursion" >&6 - exec /bin/sh ./configure '--prefix=/usr/local/freeswitch' $ac_configure_extra_args --no-create --no-recursion + echo "running /bin/sh ./configure " '--prefix=/usr/local/freeswitch' '--enable-pic' $ac_configure_extra_args " --no-create --no-recursion" >&6 + exec /bin/sh ./configure '--prefix=/usr/local/freeswitch' '--enable-pic' $ac_configure_extra_args --no-create --no-recursion fi for ac_config_target in $ac_config_targets @@ -475,7 +475,7 @@ s,@LIBS@,,;t t s,@RANLIB@,ranlib,;t t s,@ac_ct_RANLIB@,ranlib,;t t s,@CC@,gcc,;t t -s,@CFLAGS@,-Wall -O4 -fexpensive-optimizations -funroll-loops,;t t +s,@CFLAGS@,-fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops,;t t s,@LDFLAGS@,,;t t s,@CPPFLAGS@,,;t t s,@ac_ct_CC@,gcc,;t t @@ -487,13 +487,13 @@ s,@INSTALL_DATA@,${INSTALL} -m 644,;t t s,@RNG_OBJS@,rand_source.o,;t t s,@CPP@,gcc -E,;t t s,@EGREP@,grep -E,;t t -s,@build@,i686-pc-linux-gnu,;t t -s,@build_cpu@,i686,;t t -s,@build_vendor@,pc,;t t +s,@build@,x86_64-unknown-linux-gnu,;t t +s,@build_cpu@,x86_64,;t t +s,@build_vendor@,unknown,;t t s,@build_os@,linux-gnu,;t t -s,@host@,i686-pc-linux-gnu,;t t -s,@host_cpu@,i686,;t t -s,@host_vendor@,pc,;t t +s,@host@,x86_64-unknown-linux-gnu,;t t +s,@host_cpu@,x86_64,;t t +s,@host_vendor@,unknown,;t t s,@host_os@,linux-gnu,;t t s,@EXE@,,;t t s,@GDOI_OBJS@,,;t t @@ -841,7 +841,7 @@ ${ac_dA}HAVE_UINT16_T${ac_dB}HAVE_UINT16_T${ac_dC}1${ac_dD} ${ac_dA}HAVE_INT32_T${ac_dB}HAVE_INT32_T${ac_dC}1${ac_dD} ${ac_dA}HAVE_UINT32_T${ac_dB}HAVE_UINT32_T${ac_dC}1${ac_dD} ${ac_dA}HAVE_UINT64_T${ac_dB}HAVE_UINT64_T${ac_dC}1${ac_dD} -${ac_dA}SIZEOF_UNSIGNED_LONG${ac_dB}SIZEOF_UNSIGNED_LONG${ac_dC}4${ac_dD} +${ac_dA}SIZEOF_UNSIGNED_LONG${ac_dB}SIZEOF_UNSIGNED_LONG${ac_dC}8${ac_dD} ${ac_dA}SIZEOF_UNSIGNED_LONG_LONG${ac_dB}SIZEOF_UNSIGNED_LONG_LONG${ac_dC}8${ac_dD} ${ac_dA}HAVE_SOCKET${ac_dB}HAVE_SOCKET${ac_dC}1${ac_dD} ${ac_dA}HAVE_INET_ATON${ac_dB}HAVE_INET_ATON${ac_dC}1${ac_dD} @@ -856,7 +856,6 @@ t clr : clr ${ac_dA}HAVE_USLEEP${ac_dB}HAVE_USLEEP${ac_dC}1${ac_dD} ${ac_dA}CPU_CISC${ac_dB}CPU_CISC${ac_dC}1${ac_dD} -${ac_dA}HAVE_X86${ac_dB}HAVE_X86${ac_dC}1${ac_dD} ${ac_dA}ENABLE_DEBUGGING${ac_dB}ENABLE_DEBUGGING${ac_dC}1${ac_dD} ${ac_dA}ERR_REPORTING_STDOUT${ac_dB}ERR_REPORTING_STDOUT${ac_dC}1${ac_dD} CEOF @@ -905,7 +904,7 @@ ${ac_uA}HAVE_UINT16_T${ac_uB}HAVE_UINT16_T${ac_uC}1${ac_uD} ${ac_uA}HAVE_INT32_T${ac_uB}HAVE_INT32_T${ac_uC}1${ac_uD} ${ac_uA}HAVE_UINT32_T${ac_uB}HAVE_UINT32_T${ac_uC}1${ac_uD} ${ac_uA}HAVE_UINT64_T${ac_uB}HAVE_UINT64_T${ac_uC}1${ac_uD} -${ac_uA}SIZEOF_UNSIGNED_LONG${ac_uB}SIZEOF_UNSIGNED_LONG${ac_uC}4${ac_uD} +${ac_uA}SIZEOF_UNSIGNED_LONG${ac_uB}SIZEOF_UNSIGNED_LONG${ac_uC}8${ac_uD} ${ac_uA}SIZEOF_UNSIGNED_LONG_LONG${ac_uB}SIZEOF_UNSIGNED_LONG_LONG${ac_uC}8${ac_uD} ${ac_uA}HAVE_SOCKET${ac_uB}HAVE_SOCKET${ac_uC}1${ac_uD} ${ac_uA}HAVE_INET_ATON${ac_uB}HAVE_INET_ATON${ac_uC}1${ac_uD} @@ -920,7 +919,6 @@ t clr : clr ${ac_uA}HAVE_USLEEP${ac_uB}HAVE_USLEEP${ac_uC}1${ac_uD} ${ac_uA}CPU_CISC${ac_uB}CPU_CISC${ac_uC}1${ac_uD} -${ac_uA}HAVE_X86${ac_uB}HAVE_X86${ac_uC}1${ac_uD} ${ac_uA}ENABLE_DEBUGGING${ac_uB}ENABLE_DEBUGGING${ac_uC}1${ac_uD} ${ac_uA}ERR_REPORTING_STDOUT${ac_uB}ERR_REPORTING_STDOUT${ac_uC}1${ac_uD} s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, diff --git a/libs/srtp/crypto/Makefile b/libs/srtp/crypto/Makefile index d7ac61fb14..fe5ae96f33 100644 --- a/libs/srtp/crypto/Makefile +++ b/libs/srtp/crypto/Makefile @@ -12,7 +12,7 @@ CC = gcc INCDIR = -Iinclude -I$(srcdir)/include DEFS = -DHAVE_CONFIG_H CPPFLAGS= -CFLAGS = -Wall -O4 -fexpensive-optimizations -funroll-loops +CFLAGS = -fPIC -Wall -O4 -fexpensive-optimizations -funroll-loops LIBS = LDFLAGS = -L. COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS) diff --git a/libs/srtp/crypto/include/config.h b/libs/srtp/crypto/include/config.h index bf039d9121..5163cf9b9c 100644 --- a/libs/srtp/crypto/include/config.h +++ b/libs/srtp/crypto/include/config.h @@ -113,7 +113,7 @@ /* #undef HAVE_WINSOCK2_H */ /* Define to use X86 inlined assembly code */ -#define HAVE_X86 1 +/* #undef HAVE_X86 */ /* Define to the address where bug reports for this package should be sent. */ #define PACKAGE_BUGREPORT "" @@ -131,7 +131,7 @@ #define PACKAGE_VERSION "" /* The size of a `unsigned long', as computed by sizeof. */ -#define SIZEOF_UNSIGNED_LONG 4 +#define SIZEOF_UNSIGNED_LONG 8 /* The size of a `unsigned long long', as computed by sizeof. */ #define SIZEOF_UNSIGNED_LONG_LONG 8 diff --git a/src/include/switch_rtp.h b/src/include/switch_rtp.h index 9c083633c9..5b2625189e 100644 --- a/src/include/switch_rtp.h +++ b/src/include/switch_rtp.h @@ -73,16 +73,20 @@ SWITCH_DECLARE(switch_port_t) switch_rtp_request_port(void); \brief create a new RTP session handle \param new_rtp_session a poiter to aim at the new session \param payload the IANA payload number + \param packet_size the default packet_size + \param ms_per_packet time in microseconds per packet \param flags flags to control behaviour \param err a pointer to resolve error messages \param pool a memory pool to use for the session \return the new RTP session or NULL on failure */ SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session, - int payload, - switch_rtp_flag_t flags, - const char **err, - switch_memory_pool *pool); + int payload, + switch_size_t packet_size, + uint32_t ms_per_packet, + switch_rtp_flag_t flags, + const char **err, + switch_memory_pool *pool); /*! @@ -92,6 +96,8 @@ SWITCH_DECLARE(switch_status)switch_rtp_create(switch_rtp **new_rtp_session, \param tx_host the remote address \param tx_port the remote port \param payload the IANA payload number + \param packet_size the default packet_size + \param ms_per_packet time in microseconds per packet \param flags flags to control behaviour \param err a pointer to resolve error messages \param pool a memory pool to use for the session @@ -102,6 +108,8 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, char *tx_host, switch_port_t tx_port, int payload, + switch_size_t packet_size, + uint32_t ms_per_packet, switch_rtp_flag_t flags, const char **err, switch_memory_pool *pool); @@ -151,6 +159,20 @@ SWITCH_DECLARE(switch_status) switch_rtp_activate_ice(switch_rtp *rtp_session, c */ SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_session); +/*! + \brief Set the default packet size for a given RTP session + \param rtp_session the RTP session to set the packet size on + \param packet_size the new default packet size +*/ +SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint32_t packet_size); + +/*! + \brief Get the default packet size for a given RTP session + \param rtp_session the RTP session to get the packet size from + \return the default packet_size of the RTP session +*/ +SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session); + /*! \brief Set the default payload number for a given RTP session \param rtp_session the RTP session to set the payload number on diff --git a/src/include/switch_types.h b/src/include/switch_types.h index 7cae7d1efd..a9a944e1ee 100644 --- a/src/include/switch_types.h +++ b/src/include/switch_types.h @@ -98,13 +98,15 @@ SWITCH_DECLARE_DATA extern switch_directories SWITCH_GLOBAL_dirs; \enum switch_rtp_flag_t \brief RTP Related Flags
-    SWITCH_RTP_NOBLOCK      - Do not block
-    SWITCH_RTP_FLAG_IO      - IO is ready
+    SWITCH_RTP_FLAG_NOBLOCK      - Do not block
+    SWITCH_RTP_FLAG_IO           - IO is ready
+	SWITCH_RTP_FLAG_USE_TIMER    - Timeout Reads and replace with a CNG Frame
 
*/ typedef enum { - SWITCH_RTP_NOBLOCK = ( 1 << 0), - SWITCH_RTP_FLAG_IO = (1 << 1) + SWITCH_RTP_FLAG_NOBLOCK = ( 1 << 0), + SWITCH_RTP_FLAG_IO = (1 << 1), + SWITCH_RTP_FLAG_USE_TIMER = (1 << 2) } switch_rtp_flag_t; /*! diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c index b6e6d653f1..f8ef54de23 100644 --- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c +++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c @@ -1286,6 +1286,8 @@ static ldl_status handle_signalling(ldl_handle_t *handle, ldl_session_t *dlsessi tech_pvt->remote_ip, tech_pvt->remote_port, tech_pvt->codec_num, + tech_pvt->read_codec.implementation->encoded_bytes_per_frame, + tech_pvt->read_codec.implementation->microseconds_per_frame, 0, &err, switch_core_session_get_pool(tech_pvt->session)))) { switch_console_printf(SWITCH_CHANNEL_CONSOLE, "RTP ERROR %s\n", err); diff --git a/src/mod/endpoints/mod_exosip/mod_exosip.c b/src/mod/endpoints/mod_exosip/mod_exosip.c index 8ddc801646..0d568aefa4 100644 --- a/src/mod/endpoints/mod_exosip/mod_exosip.c +++ b/src/mod/endpoints/mod_exosip/mod_exosip.c @@ -479,6 +479,8 @@ static switch_status activate_rtp(struct private_object *tech_pvt) tech_pvt->remote_sdp_audio_ip, tech_pvt->remote_sdp_audio_port, tech_pvt->read_codec.codec_interface->ianacode, + tech_pvt->read_codec.implementation->encoded_bytes_per_frame, + ms, 0, &err, switch_core_session_get_pool(tech_pvt->session)); diff --git a/src/switch_rtp.c b/src/switch_rtp.c index 4bddcb81b5..305f7928e6 100644 --- a/src/switch_rtp.c +++ b/src/switch_rtp.c @@ -80,14 +80,16 @@ struct switch_rtp { char *ice_user; char *user_ice; switch_time_t last_stun; + switch_size_t packet_size; + switch_time_t last_read; + switch_time_t next_read; + uint32_t ms_per_packet; uint8_t stuncount; + switch_buffer *packet_buffer; }; static int global_init = 0; - - - static switch_status ice_out(switch_rtp *rtp_session) { @@ -218,6 +220,9 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_local_address(switch_rtp *rtp_sessi return SWITCH_STATUS_FALSE; } + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER) || switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK)) { + switch_socket_opt_set(rtp_session->sock, APR_SO_NONBLOCK, TRUE); + } switch_set_flag(rtp_session, SWITCH_RTP_FLAG_IO); return SWITCH_STATUS_SUCCESS; } @@ -236,6 +241,8 @@ SWITCH_DECLARE(switch_status) switch_rtp_set_remote_address(switch_rtp *rtp_sess SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, int payload, + switch_size_t packet_size, + uint32_t ms_per_packet, switch_rtp_flag_t flags, const char **err, switch_memory_pool *pool) @@ -247,17 +254,24 @@ SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, *new_rtp_session = NULL; + if (packet_size > SWITCH_RTP_MAX_BUF_LEN) { + *err = "Packet Size Too Large!"; + return SWITCH_STATUS_FALSE; + } + if (!(rtp_session = switch_core_alloc(pool, sizeof(*rtp_session)))) { *err = "Memory Error!"; return SWITCH_STATUS_MEMERR; } rtp_session->pool = pool; + + /* for from address on recvfrom calls */ switch_sockaddr_info_get(&rtp_session->from_addr, NULL, SWITCH_UNSPEC, 0, 0, rtp_session->pool); - if switch_test_flag(rtp_session, SWITCH_RTP_NOBLOCK) { - switch_socket_opt_set(rtp_session->sock, APR_SO_NONBLOCK, TRUE); - } + + + policy.key = (uint8_t *)key; policy.ssrc.type = ssrc_specific; @@ -298,6 +312,9 @@ SWITCH_DECLARE(switch_status) switch_rtp_create(switch_rtp **new_rtp_session, rtp_session->seq = rtp_session->send_msg.header.seq; rtp_session->payload = payload; + rtp_session->ms_per_packet = ms_per_packet; + rtp_session->packet_size = packet_size; + rtp_session->next_read = switch_time_now() + rtp_session->ms_per_packet; srtp_create(&rtp_session->recv_ctx, &policy); srtp_create(&rtp_session->send_ctx, &policy); @@ -311,13 +328,15 @@ SWITCH_DECLARE(switch_rtp *)switch_rtp_new(char *rx_host, char *tx_host, switch_port_t tx_port, int payload, + switch_size_t packet_size, + uint32_t ms_per_packet, switch_rtp_flag_t flags, const char **err, switch_memory_pool *pool) { switch_rtp *rtp_session; - if (switch_rtp_create(&rtp_session, payload, flags, err, pool) != SWITCH_STATUS_SUCCESS) { + if (switch_rtp_create(&rtp_session, payload, packet_size, ms_per_packet, flags, err, pool) != SWITCH_STATUS_SUCCESS) { return NULL; } @@ -372,6 +391,16 @@ SWITCH_DECLARE(switch_socket_t *)switch_rtp_get_rtp_socket(switch_rtp *rtp_sessi return rtp_session->sock; } +SWITCH_DECLARE(void) switch_rtp_set_default_packet_size(switch_rtp *rtp_session, uint32_t packet_size) +{ + rtp_session->packet_size = packet_size; +} + +SWITCH_DECLARE(uint32_t) switch_rtp_get_default_packet_size(switch_rtp *rtp_session) +{ + return rtp_session->packet_size; +} + SWITCH_DECLARE(void) switch_rtp_set_default_payload(switch_rtp *rtp_session, uint32_t payload) { rtp_session->payload = payload; @@ -387,32 +416,58 @@ SWITCH_DECLARE(void) switch_rtp_set_invald_handler(switch_rtp *rtp_session, swit rtp_session->invalid_handler = on_invalid; } -SWITCH_DECLARE(int) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t datalen, int *payload_type, switch_frame_flag *flags) + +static int rtp_common_read(switch_rtp *rtp_session, void *data, int *payload_type, switch_frame_flag *flags) { switch_size_t bytes; - - if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) { - return -1; - } - bytes = sizeof(rtp_msg_t); - - switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes); + switch_status status; - if (bytes <= 0) { - return 0; - } - - if (rtp_session->recv_msg.header.version != 2) { - if (rtp_session->recv_msg.header.version == 0 && rtp_session->ice_user) { - handle_ice(rtp_session, (void *) &rtp_session->recv_msg, bytes); + for(;;) { + bytes = sizeof(rtp_msg_t); + status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes); + + if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_USE_TIMER)) { + if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) { + return -1; + } + + if ((switch_time_now() - rtp_session->next_read) > 1000) { + /* We're late! We're Late!*/ + memset(&rtp_session->recv_msg, 0, 13); + rtp_session->recv_msg.header.pt = SWITCH_RTP_CNG_PAYLOAD; + *flags |= SFF_CNG; + /* RE-Sync the clock and return a CNG frame */ + rtp_session->next_read = switch_time_now() + rtp_session->ms_per_packet; + return 13; + } + + if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_NOBLOCK) && status == SWITCH_STATUS_BREAK) { + switch_yield(1000); + continue; + } + } + + if (bytes <= 0) { + return 0; } - if (rtp_session->invalid_handler) { - rtp_session->invalid_handler(rtp_session, rtp_session->sock, (void *) &rtp_session->recv_msg, bytes, rtp_session->from_addr); + + if (rtp_session->recv_msg.header.version != 2) { + if (rtp_session->recv_msg.header.version == 0 && rtp_session->ice_user) { + handle_ice(rtp_session, (void *) &rtp_session->recv_msg, bytes); + } + + if (rtp_session->invalid_handler) { + rtp_session->invalid_handler(rtp_session, rtp_session->sock, (void *) &rtp_session->recv_msg, bytes, rtp_session->from_addr); + } + return 0; } - return 0; + + break; } - memcpy(data, rtp_session->recv_msg.body, bytes); + + rtp_session->last_read = switch_time_now(); + rtp_session->next_read += rtp_session->ms_per_packet; *payload_type = rtp_session->recv_msg.header.pt; if (*payload_type == SWITCH_RTP_CNG_PAYLOAD) { @@ -420,48 +475,69 @@ SWITCH_DECLARE(int) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_ } return (int)(bytes - rtp_header_len); +} +SWITCH_DECLARE(int) switch_rtp_read(switch_rtp *rtp_session, void *data, uint32_t datalen, int *payload_type, switch_frame_flag *flags) +{ + + int bytes = rtp_common_read(rtp_session, data, payload_type, flags); + + if (bytes <= 0) { + return bytes; + } + memcpy(data, rtp_session->recv_msg.body, bytes); + return bytes; } SWITCH_DECLARE(int) switch_rtp_zerocopy_read(switch_rtp *rtp_session, void **data, int *payload_type, switch_frame_flag *flags) { - switch_size_t bytes; + int bytes = rtp_common_read(rtp_session, data, payload_type, flags); *data = NULL; - if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO)) { - return -1; - } - - bytes = sizeof(rtp_msg_t); - switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes); - if (bytes <= 0) { - return 0; + return bytes; } - - if (rtp_session->recv_msg.header.version != 2) { - if (rtp_session->recv_msg.header.version == 0 && rtp_session->ice_user) { - handle_ice(rtp_session, (void *) &rtp_session->recv_msg, bytes); - } - - if (rtp_session->invalid_handler) { - rtp_session->invalid_handler(rtp_session, rtp_session->sock, (void *) &rtp_session->recv_msg, bytes, rtp_session->from_addr); - } - return 0; - } - *payload_type = rtp_session->recv_msg.header.pt; *data = rtp_session->recv_msg.body; + return bytes; +} - if (*payload_type == SWITCH_RTP_CNG_PAYLOAD) { - *flags |= SFF_CNG; +static int rtp_common_write(switch_rtp *rtp_session, void *data, int datalen, int payload) +{ + switch_size_t bytes; + + if (rtp_session->packet_size > datalen && (payload == rtp_session->payload)) { + if (!rtp_session->packet_buffer) { + if (switch_buffer_create(rtp_session->pool, &rtp_session->packet_buffer, rtp_session->packet_size * 2) != SWITCH_STATUS_SUCCESS) { + switch_console_printf(SWITCH_CHANNEL_CONSOLE, "Buffer memory error\n"); + return -1; + } + } + switch_buffer_write(rtp_session->packet_buffer, data, datalen); + if (switch_buffer_inuse(rtp_session->packet_buffer) >= rtp_session->packet_size) { + switch_buffer_read(rtp_session->packet_buffer, rtp_session->send_msg.body, rtp_session->packet_size); + datalen = rtp_session->packet_size; + } else { + return datalen; + } + } else { + memcpy(rtp_session->send_msg.body, data, datalen); + } + + bytes = datalen + rtp_header_len; + switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&rtp_session->send_msg, &bytes); + + if (rtp_session->ice_user) { + if (ice_out(rtp_session) != SWITCH_STATUS_SUCCESS) { + return -1; + } } - return (int)(bytes - rtp_header_len); + return (int)bytes; + } SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, int datalen, uint32_t ts) { - switch_size_t bytes; if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) { return -1; @@ -474,22 +550,12 @@ SWITCH_DECLARE(int) switch_rtp_write(switch_rtp *rtp_session, void *data, int da rtp_session->send_msg.header.ts = htonl(rtp_session->ts); rtp_session->payload = htonl(rtp_session->payload); - memcpy(rtp_session->send_msg.body, data, datalen); - - bytes = datalen + rtp_header_len; - switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&rtp_session->send_msg, &bytes); - if (rtp_session->ice_user) { - if (ice_out(rtp_session) != SWITCH_STATUS_SUCCESS) { - return -1; - } - } + return rtp_common_write(rtp_session, data, datalen, rtp_session->payload); - return (int)bytes; } SWITCH_DECLARE(int) switch_rtp_write_payload(switch_rtp *rtp_session, void *data, int datalen, uint8_t payload, uint32_t ts, uint16_t mseq) { - switch_size_t bytes; if (!switch_test_flag(rtp_session, SWITCH_RTP_FLAG_IO) || !rtp_session->remote_addr) { return -1; @@ -499,18 +565,7 @@ SWITCH_DECLARE(int) switch_rtp_write_payload(switch_rtp *rtp_session, void *data rtp_session->send_msg.header.ts = htonl(rtp_session->ts); rtp_session->send_msg.header.pt = (uint8_t)htonl(payload); - memcpy(rtp_session->send_msg.body, data, datalen); - - bytes = datalen + rtp_header_len; - switch_socket_sendto(rtp_session->sock, rtp_session->remote_addr, 0, (void*)&rtp_session->send_msg, &bytes); - - if (rtp_session->ice_user) { - if (ice_out(rtp_session) != SWITCH_STATUS_SUCCESS) { - return -1; - } - } - - return (int)bytes; + return rtp_common_write(rtp_session, data, datalen, payload); } SWITCH_DECLARE(uint32_t) switch_rtp_get_ssrc(switch_rtp *rtp_session)