* #27232: jni: added pjproject checkout as regular git content
We will remove it once the next release of pjsip (with Android support)
comes out and is merged into SFLphone.
diff --git a/jni/pjproject-android/.svn/pristine/e5/e52182f448eb3dd18a684c32daf2a8a20027c2da.svn-base b/jni/pjproject-android/.svn/pristine/e5/e52182f448eb3dd18a684c32daf2a8a20027c2da.svn-base
new file mode 100644
index 0000000..97f5cb8
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e5/e52182f448eb3dd18a684c32daf2a8a20027c2da.svn-base
@@ -0,0 +1,232 @@
+# Makefile for secure rtp
+#
+# David A. McGrew
+# Cisco Systems, Inc.
+
+# targets:
+#
+# runtest runs test applications
+# test builds test applications
+# libcrypt.a static library implementing crypto engine
+# libsrtp.a static library implementing srtp
+# clean removes objects, libs, and executables
+# distribution cleans and builds a .tgz
+# tags builds etags file from all .c and .h files
+
+.PHONY: all test build_table_apps
+
+all: test
+
+runtest: build_table_apps test
+ @echo "running libsrtp test applications..."
+ crypto/test/cipher_driver$(EXE) -v >/dev/null
+ crypto/test/kernel_driver$(EXE) -v >/dev/null
+ test/rdbx_driver$(EXE) -v >/dev/null
+ test/srtp_driver$(EXE) -v >/dev/null
+ test/roc_driver$(EXE) -v >/dev/null
+ test/replay_driver$(EXE) -v >/dev/null
+ test/dtls_srtp_driver$(EXE) >/dev/null
+ cd test; ./rtpw_test.sh >/dev/null
+ @echo "libsrtp test applications passed."
+ $(MAKE) -C crypto runtest
+
+# makefile variables
+
+CC = @CC@
+INCDIR = -Icrypto/include -I$(srcdir)/include -I$(srcdir)/crypto/include
+DEFS = @DEFS@
+CPPFLAGS= @CPPFLAGS@
+CFLAGS = @CFLAGS@
+LIBS = @LIBS@
+LDFLAGS = @LDFLAGS@ -L.
+COMPILE = $(CC) $(DEFS) $(INCDIR) $(CPPFLAGS) $(CFLAGS)
+SRTPLIB = -lsrtp
+
+RANLIB = @RANLIB@
+INSTALL = @INSTALL@
+
+# EXE defines the suffix on executables - it's .exe for Windows, and
+# null on linux, bsd, and OS X and other OSes.
+EXE = @EXE@
+# gdoi is the group domain of interpretation for isakmp, a group key
+# management system which can provide keys for srtp
+gdoi = @GDOI_OBJS@
+# Random source.
+RNG_OBJS = @RNG_OBJS@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+top_builddir = @top_builddir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+includedir = @includedir@
+libdir = @libdir@
+
+
+# implicit rules for object files and test apps
+
+%.o: %.c
+ $(COMPILE) -c $< -o $@
+
+%$(EXE): %.c
+ $(COMPILE) $(LDFLAGS) $< -o $@ $(SRTPLIB) $(LIBS)
+
+
+# libcrypt.a (the crypto engine)
+ciphers = crypto/cipher/cipher.o crypto/cipher/null_cipher.o \
+ crypto/cipher/aes.o crypto/cipher/aes_icm.o \
+ crypto/cipher/aes_cbc.o
+
+hashes = crypto/hash/null_auth.o crypto/hash/sha1.o \
+ crypto/hash/hmac.o crypto/hash/auth.o # crypto/hash/tmmhv2.o
+
+replay = crypto/replay/rdb.o crypto/replay/rdbx.o \
+ crypto/replay/ut_sim.o
+
+math = crypto/math/datatypes.o crypto/math/stat.o
+
+ust = crypto/ust/ust.o
+
+rng = crypto/rng/$(RNG_OBJS) crypto/rng/prng.o crypto/rng/ctr_prng.o
+
+err = crypto/kernel/err.o
+
+kernel = crypto/kernel/crypto_kernel.o crypto/kernel/alloc.o \
+ crypto/kernel/key.o $(rng) $(err) # $(ust)
+
+cryptobj = $(ciphers) $(hashes) $(math) $(stat) $(kernel) $(replay)
+
+# libsrtp.a (implements srtp processing)
+
+srtpobj = srtp/srtp.o
+
+libsrtp.a: $(srtpobj) $(cryptobj) $(gdoi)
+ ar cr libsrtp.a $^
+ $(RANLIB) libsrtp.a
+
+# libcryptomath.a contains general-purpose routines that are used to
+# generate tables and verify cryptoalgorithm implementations - this
+# library is not meant to be included in production code
+
+cryptomath = crypto/math/math.o crypto/math/gf2_8.o
+
+libcryptomath.a: $(cryptomath)
+ ar cr libcryptomath.a $(cryptomath)
+ $(RANLIB) libcryptomath.a
+
+
+# test applications
+
+crypto_testapp = crypto/test/aes_calc$(EXE) crypto/test/cipher_driver$(EXE) \
+ crypto/test/datatypes_driver$(EXE) crypto/test/kernel_driver$(EXE) \
+ crypto/test/rand_gen$(EXE) crypto/test/sha1_driver$(EXE) \
+ crypto/test/stat_driver$(EXE)
+
+testapp = $(crypto_testapp) test/srtp_driver$(EXE) test/replay_driver$(EXE) \
+ test/roc_driver$(EXE) test/rdbx_driver$(EXE) test/rtpw$(EXE) \
+ test/dtls_srtp_driver$(EXE)
+
+$(testapp): libsrtp.a
+
+test/rtpw$(EXE): test/rtpw.c test/rtp.c test/getopt_s.c
+ $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+
+test/srtp_driver$(EXE): test/srtp_driver.c test/getopt_s.c
+ $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+
+test/rdbx_driver$(EXE): test/rdbx_driver.c test/getopt_s.c
+ $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+
+test/dtls_srtp_driver$(EXE): test/dtls_srtp_driver.c test/getopt_s.c
+ $(COMPILE) $(LDFLAGS) -o $@ $^ $(LIBS) $(SRTPLIB)
+
+test: $(testapp)
+ @echo "Build done. Please run '$(MAKE) runtest' to run self tests."
+
+memtest: test/srtp_driver
+ @test/srtp_driver -v -d "alloc" > tmp
+ @grep freed tmp | wc -l > freed
+ @grep allocated tmp | wc -l > allocated
+ @echo "checking for memory leaks (only works with --enable-stdout)"
+ cmp -s allocated freed
+ @echo "passed (same number of alloc() and dealloc() calls found)"
+ @rm freed allocated tmp
+
+# tables_apps are used to generate the tables used in the crypto
+# implementations; these need only be generated during porting, not
+# for building libsrtp or the test applications
+
+table_apps = tables/aes_tables
+
+build_table_apps: $(table_apps)
+
+# in the tables/ subdirectory, we use libcryptomath instead of libsrtp
+
+tables/%: tables/%.c libcryptomath.a
+ $(COMPILE) $(LDFLAGS) $< -o $@ $(LIBS) libcryptomath.a
+
+# the target 'plot' runs the timing test (test/srtp_driver -t) then
+# uses gnuplot to produce plots of the results - see the script file
+# 'timing'
+
+plot: test/srtp_driver
+ test/srtp_driver -t > timing.dat
+
+
+# bookkeeping: tags, clean, and distribution
+
+tags:
+ etags */*.[ch] */*/*.[ch]
+
+
+# documentation - the target libsrtpdoc builds a PDF file documenting
+# libsrtp
+
+libsrtpdoc:
+ $(MAKE) -C doc
+
+.PHONY: clean superclean install
+
+install:
+ @if [ -d $(DESTDIR)$(includedir)/srtp ]; then \
+ echo "you should run 'make uninstall' first"; exit 1; \
+ fi
+ $(INSTALL) -d $(DESTDIR)$(includedir)/srtp
+ $(INSTALL) -d $(DESTDIR)$(libdir)
+ cp include/*.h $(DESTDIR)$(includedir)/srtp
+ cp crypto/include/*.h $(DESTDIR)$(includedir)/srtp
+ if [ -f libsrtp.a ]; then cp libsrtp.a $(DESTDIR)$(libdir)/; fi
+
+uninstall:
+ rm -rf $(DESTDIR)$(includedir)/srtp
+ rm -rf $(DESTDIR)$(libdir)/libsrtp.a
+
+clean:
+ rm -rf $(cryptobj) $(srtpobj) $(cryptomath) TAGS \
+ libcryptomath.a libsrtp.a core *.core test/core
+ for a in * */* */*/*; do \
+ if [ -f "$$a~" ] ; then rm -f $$a~; fi; \
+ done;
+ for a in $(testapp) $(table_apps); do rm -rf $$a$(EXE); done
+ rm -rf *.pict *.jpg *.dat
+ rm -rf freed allocated tmp
+ $(MAKE) -C doc clean
+ $(MAKE) -C crypto clean
+
+
+superclean: clean
+ rm -rf crypto/include/config.h config.log config.cache config.status \
+ Makefile .gdb_history test/.gdb_history .DS_Store
+ rm -rf autom4te.cache
+
+distname = srtp-$(shell cat VERSION)
+
+distribution: runtest superclean
+ if ! [ -f VERSION ]; then exit 1; fi
+ if [ -f ../$(distname).tgz ]; then \
+ mv ../$(distname).tgz ../$(distname).tgz.bak; \
+ fi
+ cd ..; tar cvzf $(distname).tgz srtp
+
+# EOF
diff --git a/jni/pjproject-android/.svn/pristine/e5/e525dbcbe8e93582e064e400c14ddfb10dee8570.svn-base b/jni/pjproject-android/.svn/pristine/e5/e525dbcbe8e93582e064e400c14ddfb10dee8570.svn-base
new file mode 100644
index 0000000..5dd0947
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e5/e525dbcbe8e93582e064e400c14ddfb10dee8570.svn-base
@@ -0,0 +1,119 @@
+/*
+ * alloc.c
+ *
+ * memory allocation and deallocation
+ *
+ * David A. McGrew
+ * Cisco Systems, Inc.
+ */
+/*
+ *
+ * Copyright (c) 2001-2006 Cisco Systems, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ *
+ * Neither the name of the Cisco Systems, Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ * OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "alloc.h"
+#include "crypto_kernel.h"
+
+/* the debug module for memory allocation */
+
+debug_module_t mod_alloc = {
+ 0, /* debugging is off by default */
+ "alloc" /* printable name for module */
+};
+
+/*
+ * Nota bene: the debugging statements for crypto_alloc() and
+ * crypto_free() have identical prefixes, which include the addresses
+ * of the memory locations on which they are operating. This fact can
+ * be used to locate memory leaks, by turning on memory debugging,
+ * grepping for 'alloc', then matching alloc and free calls by
+ * address.
+ */
+
+#ifdef SRTP_KERNEL_LINUX
+
+#include <linux/interrupt.h>
+
+void *
+crypto_alloc(size_t size) {
+ void *ptr;
+
+ ptr = kmalloc(size, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL);
+
+ if (ptr) {
+ debug_print(mod_alloc, "(location: %p) allocated", ptr);
+ } else
+ debug_print(mod_alloc, "allocation failed (asked for %d bytes)\n", size);
+
+ return ptr;
+}
+
+void
+crypto_free(void *ptr) {
+
+ debug_print(mod_alloc, "(location: %p) freed", ptr);
+
+ kfree(ptr);
+}
+
+
+#elif defined(HAVE_STDLIB_H)
+
+void *
+crypto_alloc(size_t size) {
+ void *ptr;
+
+ ptr = malloc(size);
+
+ if (ptr) {
+ debug_print(mod_alloc, "(location: %p) allocated", ptr);
+ } else
+ debug_print(mod_alloc, "allocation failed (asked for %d bytes)\n", size);
+
+ return ptr;
+}
+
+void
+crypto_free(void *ptr) {
+
+ debug_print(mod_alloc, "(location: %p) freed", ptr);
+
+ free(ptr);
+}
+
+#else /* we need to define our own memory allocation routines */
+
+#error no memory allocation defined yet
+
+#endif
diff --git a/jni/pjproject-android/.svn/pristine/e5/e53275ac76b7e9fe51c40676f80eba3a05767996.svn-base b/jni/pjproject-android/.svn/pristine/e5/e53275ac76b7e9fe51c40676f80eba3a05767996.svn-base
new file mode 100644
index 0000000..fa64e7a
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e5/e53275ac76b7e9fe51c40676f80eba3a05767996.svn-base
@@ -0,0 +1,19 @@
+# $Id$
+#
+from inc_cfg import *
+
+ADD_PARAM = ""
+
+if (HAS_SND_DEV == 0):
+ ADD_PARAM += "--null-audio"
+
+# Call with PCMU codec
+test_param = TestParam(
+ "PESQ codec PCMU",
+ [
+ InstanceParam("UA1", ADD_PARAM + " --max-calls=1 --add-codec pcmu --clock-rate 8000 --play-file wavs/input.8.wav"),
+ InstanceParam("UA2", "--null-audio --max-calls=1 --add-codec pcmu --clock-rate 8000 --rec-file wavs/tmp.8.wav --auto-answer 200")
+ ]
+ )
+
+pesq_threshold = 3.5
diff --git a/jni/pjproject-android/.svn/pristine/e5/e5bce908852ffde7e6c7fda5dc0c3006cc27c1e8.svn-base b/jni/pjproject-android/.svn/pristine/e5/e5bce908852ffde7e6c7fda5dc0c3006cc27c1e8.svn-base
new file mode 100644
index 0000000..2cda3dd
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e5/e5bce908852ffde7e6c7fda5dc0c3006cc27c1e8.svn-base
@@ -0,0 +1,451 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+/*
+ * Based on implementation kindly contributed by Switchlab, Ltd.
+ */
+#ifndef __PJMEDIA_JBUF_H__
+#define __PJMEDIA_JBUF_H__
+
+
+/**
+ * @file jbuf.h
+ * @brief Adaptive jitter buffer implementation.
+ */
+#include <pjmedia/types.h>
+
+/**
+ * @defgroup PJMED_JBUF Adaptive jitter buffer
+ * @ingroup PJMEDIA_FRAME_OP
+ * @brief Adaptive de-jitter buffering implementation
+ * @{
+ *
+ * This section describes PJMEDIA's implementation of de-jitter buffer.
+ * The de-jitter buffer may be set to operate in adaptive mode or fixed
+ * delay mode.
+ */
+
+
+PJ_BEGIN_DECL
+
+
+/**
+ * Types of frame returned by the jitter buffer.
+ */
+typedef enum pjmedia_jb_frame_type
+{
+ PJMEDIA_JB_MISSING_FRAME = 0, /**< No frame because it's missing */
+ PJMEDIA_JB_NORMAL_FRAME = 1, /**< Normal frame is being returned */
+ PJMEDIA_JB_ZERO_PREFETCH_FRAME = 2, /**< Zero frame is being returned
+ because JB is bufferring. */
+ PJMEDIA_JB_ZERO_EMPTY_FRAME = 3 /**< Zero frame is being returned
+ because JB is empty. */
+} pjmedia_jb_frame_type;
+
+
+/**
+ * Enumeration of jitter buffer discard algorithm. The jitter buffer
+ * continuously calculates the jitter level to get the optimum latency at
+ * any time and in order to adjust the latency, the jitter buffer may need
+ * to discard some frames.
+ */
+typedef enum pjmedia_jb_discard_algo
+{
+ /**
+ * Jitter buffer should not discard any frame, except when the jitter
+ * buffer is full and a new frame arrives, one frame will be discarded
+ * to make space for the new frame.
+ */
+ PJMEDIA_JB_DISCARD_NONE = 0,
+
+ /**
+ * Only discard one frame in at least 200ms when the latency is considered
+ * much higher than it should be. When the jitter buffer is full and a new
+ * frame arrives, one frame will be discarded to make space for the new
+ * frame.
+ */
+ PJMEDIA_JB_DISCARD_STATIC,
+
+ /**
+ * The discard rate is dynamically calculated based on actual parameters
+ * such as jitter level and latency. When the jitter buffer is full and
+ * a new frame arrives, one frame will be discarded to make space for the
+ * new frame.
+ */
+ PJMEDIA_JB_DISCARD_PROGRESSIVE
+
+} pjmedia_jb_discard_algo;
+
+
+/**
+ * This structure describes jitter buffer state.
+ */
+typedef struct pjmedia_jb_state
+{
+ /* Setting */
+ unsigned frame_size; /**< Individual frame size, in bytes. */
+ unsigned min_prefetch; /**< Minimum allowed prefetch, in frms. */
+ unsigned max_prefetch; /**< Maximum allowed prefetch, in frms. */
+
+ /* Status */
+ unsigned burst; /**< Current burst level, in frames */
+ unsigned prefetch; /**< Current prefetch value, in frames */
+ unsigned size; /**< Current buffer size, in frames. */
+
+ /* Statistic */
+ unsigned avg_delay; /**< Average delay, in ms. */
+ unsigned min_delay; /**< Minimum delay, in ms. */
+ unsigned max_delay; /**< Maximum delay, in ms. */
+ unsigned dev_delay; /**< Standard deviation of delay, in ms.*/
+ unsigned avg_burst; /**< Average burst, in frames. */
+ unsigned lost; /**< Number of lost frames. */
+ unsigned discard; /**< Number of discarded frames. */
+ unsigned empty; /**< Number of empty on GET events. */
+} pjmedia_jb_state;
+
+
+/**
+ * The constant PJMEDIA_JB_DEFAULT_INIT_DELAY specifies default jitter
+ * buffer prefetch count during jitter buffer creation.
+ */
+#define PJMEDIA_JB_DEFAULT_INIT_DELAY 15
+
+/**
+ * Opaque declaration for jitter buffer.
+ */
+typedef struct pjmedia_jbuf pjmedia_jbuf;
+
+
+/**
+ * Create an adaptive jitter buffer according to the specification. If
+ * application wants to have a fixed jitter buffer, it may call
+ * #pjmedia_jbuf_set_fixed() after the jitter buffer is created. Also
+ * if application wants to alter the discard algorithm, which the default
+ * PJMEDIA_JB_DISCARD_PROGRESSIVE, it may call #pjmedia_jbuf_set_discard().
+ *
+ * This function may allocate large chunk of memory to keep the frames in
+ * the buffer.
+ *
+ * @param pool The pool to allocate memory.
+ * @param name Name to identify the jitter buffer for logging
+ * purpose.
+ * @param frame_size The size of each frame that will be kept in the
+ * jitter buffer, in bytes. This should correspond
+ * to the minimum frame size supported by the codec.
+ * For example, a 10ms frame (80 bytes) would be
+ * recommended for G.711 codec.
+ * @param max_count Maximum number of frames that can be kept in the
+ * jitter buffer. This effectively means the maximum
+ * delay that may be introduced by this jitter
+ * buffer.
+ * @param ptime Indication of frame duration, used to calculate
+ * the interval between jitter recalculation.
+ * @param p_jb Pointer to receive jitter buffer instance.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_create(pj_pool_t *pool,
+ const pj_str_t *name,
+ unsigned frame_size,
+ unsigned ptime,
+ unsigned max_count,
+ pjmedia_jbuf **p_jb);
+
+/**
+ * Set the jitter buffer to fixed delay mode. The default behavior
+ * is to adapt the delay with actual packet delay.
+ *
+ * @param jb The jitter buffer
+ * @param prefetch The fixed delay value, in number of frames.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_set_fixed( pjmedia_jbuf *jb,
+ unsigned prefetch);
+
+
+/**
+ * Set the jitter buffer to adaptive mode.
+ *
+ * @param jb The jitter buffer.
+ * @param prefetch The initial prefetch value to be applied to the
+ * jitter buffer. Setting this to other than 0 will
+ * activate prefetch buffering, a jitter buffer feature
+ * that each time it gets empty, it won't return a
+ * normal frame until its size reaches the number
+ * specified here.
+ * @param min_prefetch The minimum delay that must be applied to each
+ * incoming packets, in number of frames.
+ * @param max_prefetch The maximum allowable value for prefetch delay,
+ * in number of frames.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_set_adaptive( pjmedia_jbuf *jb,
+ unsigned prefetch,
+ unsigned min_prefetch,
+ unsigned max_prefetch);
+
+
+/**
+ * Set the jitter buffer discard algorithm. The default discard algorithm,
+ * set in jitter buffer creation, is PJMEDIA_JB_DISCARD_PROGRESSIVE.
+ *
+ * @param jb The jitter buffer.
+ * @param algo The discard algorithm to be used.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_set_discard(pjmedia_jbuf *jb,
+ pjmedia_jb_discard_algo algo);
+
+
+/**
+ * Destroy jitter buffer instance.
+ *
+ * @param jb The jitter buffer.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_destroy(pjmedia_jbuf *jb);
+
+
+/**
+ * Restart jitter. This function flushes all packets in the buffer and
+ * reset the internal sequence number.
+ *
+ * @param jb The jitter buffer.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_reset(pjmedia_jbuf *jb);
+
+/**
+ * Put a frame to the jitter buffer. If the frame can be accepted (based
+ * on the sequence number), the jitter buffer will copy the frame and put
+ * it in the appropriate position in the buffer.
+ *
+ * Application MUST manage it's own synchronization when multiple threads
+ * are accessing the jitter buffer at the same time.
+ *
+ * @param jb The jitter buffer.
+ * @param frame Pointer to frame buffer to be stored in the jitter
+ * buffer.
+ * @param size The frame size.
+ * @param frame_seq The frame sequence number.
+ */
+PJ_DECL(void) pjmedia_jbuf_put_frame( pjmedia_jbuf *jb,
+ const void *frame,
+ pj_size_t size,
+ int frame_seq);
+
+/**
+ * Put a frame to the jitter buffer. If the frame can be accepted (based
+ * on the sequence number), the jitter buffer will copy the frame and put
+ * it in the appropriate position in the buffer.
+ *
+ * Application MUST manage it's own synchronization when multiple threads
+ * are accessing the jitter buffer at the same time.
+ *
+ * @param jb The jitter buffer.
+ * @param frame Pointer to frame buffer to be stored in the jitter
+ * buffer.
+ * @param size The frame size.
+ * @param bit_info Bit precise info of the frame, e.g: a frame may not
+ * exactly start and end at the octet boundary, so this
+ * field may be used for specifying start & end bit offset.
+ * @param frame_seq The frame sequence number.
+ * @param discarded Flag whether the frame is discarded by jitter buffer.
+ */
+PJ_DECL(void) pjmedia_jbuf_put_frame2( pjmedia_jbuf *jb,
+ const void *frame,
+ pj_size_t size,
+ pj_uint32_t bit_info,
+ int frame_seq,
+ pj_bool_t *discarded);
+
+/**
+ * Put a frame to the jitter buffer. If the frame can be accepted (based
+ * on the sequence number), the jitter buffer will copy the frame and put
+ * it in the appropriate position in the buffer.
+ *
+ * Application MUST manage it's own synchronization when multiple threads
+ * are accessing the jitter buffer at the same time.
+ *
+ * @param jb The jitter buffer.
+ * @param frame Pointer to frame buffer to be stored in the jitter
+ * buffer.
+ * @param size The frame size.
+ * @param bit_info Bit precise info of the frame, e.g: a frame may not
+ * exactly start and end at the octet boundary, so this
+ * field may be used for specifying start & end bit offset.
+ * @param frame_seq The frame sequence number.
+ * @param frame_ts The frame timestamp.
+ * @param discarded Flag whether the frame is discarded by jitter buffer.
+ */
+PJ_DECL(void) pjmedia_jbuf_put_frame3( pjmedia_jbuf *jb,
+ const void *frame,
+ pj_size_t size,
+ pj_uint32_t bit_info,
+ int frame_seq,
+ pj_uint32_t frame_ts,
+ pj_bool_t *discarded);
+/**
+ * Get a frame from the jitter buffer. The jitter buffer will return the
+ * oldest frame from it's buffer, when it is available.
+ *
+ * Application MUST manage it's own synchronization when multiple threads
+ * are accessing the jitter buffer at the same time.
+ *
+ * @param jb The jitter buffer.
+ * @param frame Buffer to receive the payload from the jitter buffer.
+ * Application MUST make sure that the buffer has
+ * appropriate size (i.e. not less than the frame size,
+ * as specified when the jitter buffer was created).
+ * The jitter buffer only copied a frame to this
+ * buffer when the frame type returned by this function
+ * is PJMEDIA_JB_NORMAL_FRAME.
+ * @param p_frm_type Pointer to receive frame type. If jitter buffer is
+ * currently empty or bufferring, the frame type will
+ * be set to PJMEDIA_JB_ZERO_FRAME, and no frame will
+ * be copied. If the jitter buffer detects that frame is
+ * missing with current sequence number, the frame type
+ * will be set to PJMEDIA_JB_MISSING_FRAME, and no
+ * frame will be copied. If there is a frame, the jitter
+ * buffer will copy the frame to the buffer, and frame
+ * type will be set to PJMEDIA_JB_NORMAL_FRAME.
+ */
+PJ_DECL(void) pjmedia_jbuf_get_frame( pjmedia_jbuf *jb,
+ void *frame,
+ char *p_frm_type);
+
+/**
+ * Get a frame from the jitter buffer. The jitter buffer will return the
+ * oldest frame from it's buffer, when it is available.
+ *
+ * @param jb The jitter buffer.
+ * @param frame Buffer to receive the payload from the jitter buffer.
+ * @see pjmedia_jbuf_get_frame().
+ * @param size Pointer to receive frame size.
+ * @param p_frm_type Pointer to receive frame type.
+ * @see pjmedia_jbuf_get_frame().
+ * @param bit_info Bit precise info of the frame, e.g: a frame may not
+ * exactly start and end at the octet boundary, so this
+ * field may be used for specifying start & end bit offset.
+ */
+PJ_DECL(void) pjmedia_jbuf_get_frame2(pjmedia_jbuf *jb,
+ void *frame,
+ pj_size_t *size,
+ char *p_frm_type,
+ pj_uint32_t *bit_info);
+
+
+/**
+ * Get a frame from the jitter buffer. The jitter buffer will return the
+ * oldest frame from it's buffer, when it is available.
+ *
+ * @param jb The jitter buffer.
+ * @param frame Buffer to receive the payload from the jitter buffer.
+ * @see pjmedia_jbuf_get_frame().
+ * @param size Pointer to receive frame size.
+ * @param p_frm_type Pointer to receive frame type.
+ * @see pjmedia_jbuf_get_frame().
+ * @param bit_info Bit precise info of the frame, e.g: a frame may not
+ * exactly start and end at the octet boundary, so this
+ * field may be used for specifying start & end bit offset.
+ * @param ts Frame timestamp.
+ * @param seq Frame sequence number.
+ */
+PJ_DECL(void) pjmedia_jbuf_get_frame3(pjmedia_jbuf *jb,
+ void *frame,
+ pj_size_t *size,
+ char *p_frm_type,
+ pj_uint32_t *bit_info,
+ pj_uint32_t *ts,
+ int *seq);
+
+
+/**
+ * Peek a frame from the jitter buffer. The jitter buffer state will not be
+ * modified.
+ *
+ * @param jb The jitter buffer.
+ * @param offset Offset from the oldest frame to be peeked.
+ * @param frame Buffer to receive the payload from the jitter buffer.
+ * @see pjmedia_jbuf_get_frame().
+ * @param size Pointer to receive frame size.
+ * @param p_frm_type Pointer to receive frame type.
+ * @see pjmedia_jbuf_get_frame().
+ * @param bit_info Bit precise info of the frame, e.g: a frame may not
+ * exactly start and end at the octet boundary, so this
+ * field may be used for specifying start & end bit offset.
+ * @param ts Frame timestamp.
+ * @param seq Frame sequence number.
+ */
+PJ_DECL(void) pjmedia_jbuf_peek_frame(pjmedia_jbuf *jb,
+ unsigned offset,
+ const void **frame,
+ pj_size_t *size,
+ char *p_frm_type,
+ pj_uint32_t *bit_info,
+ pj_uint32_t *ts,
+ int *seq);
+
+
+/**
+ * Remove frames from the jitter buffer.
+ *
+ * @param jb The jitter buffer.
+ * @param frame_cnt Number of frames to be removed.
+ *
+ * @return The number of frame successfully removed.
+ */
+PJ_DECL(unsigned) pjmedia_jbuf_remove_frame(pjmedia_jbuf *jb,
+ unsigned frame_cnt);
+
+/**
+ * Check if the jitter buffer is full.
+ *
+ * @param jb The jitter buffer.
+ *
+ * @return PJ_TRUE if it is full.
+ */
+PJ_DECL(pj_bool_t) pjmedia_jbuf_is_full(const pjmedia_jbuf *jb);
+
+
+/**
+ * Get jitter buffer current state/settings.
+ *
+ * @param jb The jitter buffer.
+ * @param state Buffer to receive jitter buffer state.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_jbuf_get_state( const pjmedia_jbuf *jb,
+ pjmedia_jb_state *state );
+
+
+
+PJ_END_DECL
+
+/**
+ * @}
+ */
+
+#endif /* __PJMEDIA_JBUF_H__ */
diff --git a/jni/pjproject-android/.svn/pristine/e5/e5dcb2d09da6d76f2731693471b31712de806127.svn-base b/jni/pjproject-android/.svn/pristine/e5/e5dcb2d09da6d76f2731693471b31712de806127.svn-base
new file mode 100644
index 0000000..5a5c394
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e5/e5dcb2d09da6d76f2731693471b31712de806127.svn-base
@@ -0,0 +1,438 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
+ * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+#include <pj/string.h>
+#include <pj/pool.h>
+#include <pj/log.h>
+#include <pj/os.h>
+#include "test.h"
+
+#define THIS_FILE "string.c"
+
+/**
+ * \page page_pjlib_string_test Test: String
+ *
+ * This file provides implementation of \b string_test(). It tests the
+ * functionality of the string API.
+ *
+ * \section sleep_test_sec Scope of the Test
+ *
+ * API tested:
+ * - pj_str()
+ * - pj_strcmp()
+ * - pj_strcmp2()
+ * - pj_stricmp()
+ * - pj_strlen()
+ * - pj_strncmp()
+ * - pj_strnicmp()
+ * - pj_strchr()
+ * - pj_strdup()
+ * - pj_strdup2()
+ * - pj_strcpy()
+ * - pj_strcat()
+ * - pj_strtrim()
+ * - pj_utoa()
+ * - pj_strtoul()
+ * - pj_strtoul2()
+ * - pj_create_random_string()
+ * - ... and mode..
+ *
+ * This file is <b>pjlib-test/string.c</b>
+ *
+ * \include pjlib-test/string.c
+ */
+
+#if INCLUDE_STRING_TEST
+
+#ifdef _MSC_VER
+# pragma warning(disable: 4204)
+#endif
+
+#define HELLO_WORLD "Hello World"
+#define HELLO_WORLD_LEN 11
+#define JUST_HELLO "Hello"
+#define JUST_HELLO_LEN 5
+#define UL_VALUE 3456789012UL
+
+#if 1
+/* See if both integers have the same sign */
+PJ_INLINE(int) cmp(const char *expr, int i, int j)
+{
+ int r = !((i>0 && j>0) || (i<0 && j<0) || (i==0 && j==0));
+ if (r) {
+ PJ_LOG(3,(THIS_FILE," error: %s: expecting %d, got %d", expr, j, i));
+ }
+ return r;
+}
+#else
+/* For strict comparison, must be equal */
+PJ_INLINE(int) cmp(const char *expr, int i, int j)
+{
+ PJ_UNUSED_ARG(expr);
+ return i!=j;
+}
+#endif
+
+#define C(expr, res) cmp(#expr, expr, res)
+
+static int stricmp_test(void)
+{
+/* This specificly tests and benchmark pj_stricmp(), pj_stricmp_alnum().
+ * In addition, it also tests pj_stricmp2(), pj_strnicmp(), and
+ * pj_strnicmp2().
+ */
+#define STRTEST(res,res2,S1,S2,code) \
+ do { \
+ s1.ptr=S1; s1.slen=(S1)?len:0; \
+ s2.ptr=S2; s2.slen=(S2)?len:0; \
+ pj_get_timestamp(&t1); \
+ if (C(pj_stricmp(&s1,&s2),res)) return code; \
+ pj_get_timestamp(&t2); \
+ pj_sub_timestamp(&t2, &t1); \
+ pj_add_timestamp(&e1, &t2); \
+ pj_get_timestamp(&t1); \
+ if (C(pj_stricmp_alnum(&s1,&s2),res)) return code-1; \
+ pj_get_timestamp(&t2); \
+ pj_sub_timestamp(&t2, &t1); \
+ pj_add_timestamp(&e2, &t2); \
+ if (C(pj_stricmp2(&s1,S2),res2)) return code*10; \
+ if (C(pj_strnicmp(&s1,&s2,len),res)) return code*100; \
+ if (C(pj_strnicmp2(&s1,S2,len),res)) return code*1000; \
+ } while (0)
+
+ char *buf;
+ pj_str_t s1, s2;
+ pj_timestamp t1, t2, e1, e2, zero;
+ pj_uint32_t c1, c2;
+ int len;
+
+ e1.u32.hi = e1.u32.lo = e2.u32.hi = e2.u32.lo = 0;
+
+ pj_thread_sleep(0);
+
+#define SNULL 0
+
+ /* Compare empty strings. */
+ len=0;
+ STRTEST( 0, 0, "","",-500);
+ STRTEST( 0, 0, SNULL,"",-502);
+ STRTEST( 0, 0, "",SNULL,-504);
+ STRTEST( 0, 0, SNULL,SNULL,-506);
+ STRTEST( 0, -1, "hello","world",-508);
+
+ /* equal, length=1
+ * use buffer to simulate non-aligned string.
+ */
+ buf = "a""A";
+ len=1;
+ STRTEST( 0, -1, "a",buf+0,-510);
+ STRTEST( 0, 0, "a",buf+1,-512);
+ STRTEST(-1, -1, "O", "P", -514);
+ STRTEST(-1, -1, SNULL, "a", -516);
+ STRTEST( 1, 1, "a", SNULL, -518);
+
+ /* equal, length=2
+ * use buffer to simulate non-aligned string.
+ */
+ buf = "aa""Aa""aA""AA";
+ len=2;
+ STRTEST( 0, -1, "aa",buf+0,-520);
+ STRTEST( 0, -1, "aa",buf+2,-522);
+ STRTEST( 0, -1, "aa",buf+4,-524);
+ STRTEST( 0, 0, "aa",buf+6,-524);
+
+ /* equal, length=3
+ * use buffer to simulate non-aligned string.
+ */
+ buf = "aaa""Aaa""aAa""aaA""AAa""aAA""AaA""AAA";
+ len=3;
+ STRTEST( 0, -1, "aaa",buf+0,-530);
+ STRTEST( 0, -1, "aaa",buf+3,-532);
+ STRTEST( 0, -1, "aaa",buf+6,-534);
+ STRTEST( 0, -1, "aaa",buf+9,-536);
+ STRTEST( 0, -1, "aaa",buf+12,-538);
+ STRTEST( 0, -1, "aaa",buf+15,-540);
+ STRTEST( 0, -1, "aaa",buf+18,-542);
+ STRTEST( 0, 0, "aaa",buf+21,-534);
+
+ /* equal, length=4 */
+ len=4;
+ STRTEST( 0, 0, "aaaa","aaaa",-540);
+ STRTEST( 0, 0, "aaaa","Aaaa",-542);
+ STRTEST( 0, 0, "aaaa","aAaa",-544);
+ STRTEST( 0, 0, "aaaa","aaAa",-546);
+ STRTEST( 0, 0, "aaaa","aaaA",-548);
+ STRTEST( 0, 0, "aaaa","AAaa",-550);
+ STRTEST( 0, 0, "aaaa","aAAa",-552);
+ STRTEST( 0, 0, "aaaa","aaAA",-554);
+ STRTEST( 0, 0, "aaaa","AaAa",-556);
+ STRTEST( 0, 0, "aaaa","aAaA",-558);
+ STRTEST( 0, 0, "aaaa","AaaA",-560);
+ STRTEST( 0, 0, "aaaa","AAAa",-562);
+ STRTEST( 0, 0, "aaaa","aAAA",-564);
+ STRTEST( 0, 0, "aaaa","AAaA",-566);
+ STRTEST( 0, 0, "aaaa","AaAA",-568);
+ STRTEST( 0, 0, "aaaa","AAAA",-570);
+
+ /* equal, length=5 */
+ buf = "aaaAa""AaaaA""AaAaA""AAAAA";
+ len=5;
+ STRTEST( 0, -1, "aaaaa",buf+0,-580);
+ STRTEST( 0, -1, "aaaaa",buf+5,-582);
+ STRTEST( 0, -1, "aaaaa",buf+10,-584);
+ STRTEST( 0, 0, "aaaaa",buf+15,-586);
+
+ /* not equal, length=1 */
+ len=1;
+ STRTEST( -1, -1, "a", "b", -600);
+
+ /* not equal, length=2 */
+ buf = "ab""ba";
+ len=2;
+ STRTEST( -1, -1, "aa", buf+0, -610);
+ STRTEST( -1, -1, "aa", buf+2, -612);
+
+ /* not equal, length=3 */
+ buf = "aab""aba""baa";
+ len=3;
+ STRTEST( -1, -1, "aaa", buf+0, -620);
+ STRTEST( -1, -1, "aaa", buf+3, -622);
+ STRTEST( -1, -1, "aaa", buf+6, -624);
+
+ /* not equal, length=4 */
+ buf = "aaab""aaba""abaa""baaa";
+ len=4;
+ STRTEST( -1, -1, "aaaa", buf+0, -630);
+ STRTEST( -1, -1, "aaaa", buf+4, -632);
+ STRTEST( -1, -1, "aaaa", buf+8, -634);
+ STRTEST( -1, -1, "aaaa", buf+12, -636);
+
+ /* not equal, length=5 */
+ buf="aaaab""aaaba""aabaa""abaaa""baaaa";
+ len=5;
+ STRTEST( -1, -1, "aaaaa", buf+0, -640);
+ STRTEST( -1, -1, "aaaaa", buf+5, -642);
+ STRTEST( -1, -1, "aaaaa", buf+10, -644);
+ STRTEST( -1, -1, "aaaaa", buf+15, -646);
+ STRTEST( -1, -1, "aaaaa", buf+20, -648);
+
+ zero.u32.hi = zero.u32.lo = 0;
+ c1 = pj_elapsed_cycle(&zero, &e1);
+ c2 = pj_elapsed_cycle(&zero, &e2);
+
+ if (c1 < c2) {
+ PJ_LOG(3,("", " info: pj_stricmp_alnum is slower than pj_stricmp!"));
+ //return -700;
+ }
+
+ /* Avoid division by zero */
+ if (c2 == 0) c2=1;
+
+ PJ_LOG(3, ("", " time: stricmp=%u, stricmp_alnum=%u (speedup=%d.%02dx)",
+ c1, c2,
+ (c1 * 100 / c2) / 100,
+ (c1 * 100 / c2) % 100));
+ return 0;
+#undef STRTEST
+}
+
+/* This tests pj_strcmp(), pj_strcmp2(), pj_strncmp(), pj_strncmp2() */
+static int strcmp_test(void)
+{
+#define STR_TEST(res,S1,S2,code) \
+ do { \
+ s1.ptr=S1; s1.slen=S1?len:0; \
+ s2.ptr=S2; s2.slen=S2?len:0; \
+ if (C(pj_strcmp(&s1,&s2),res)) return code; \
+ if (C(pj_strcmp2(&s1,S2),res)) return code-1; \
+ if (C(pj_strncmp(&s1,&s2,len),res)) return code-2; \
+ if (C(pj_strncmp2(&s1,S2,len),res)) return code-3; \
+ } while (0)
+
+ pj_str_t s1, s2;
+ int len;
+
+ /* Test with length == 0 */
+ len=0;
+ STR_TEST(0, "", "", -400);
+ STR_TEST(0, SNULL, "", -405);
+ STR_TEST(0, "", SNULL, -410);
+ STR_TEST(0, SNULL, SNULL, -415);
+ STR_TEST(0, "hello", "", -420);
+ STR_TEST(0, "hello", SNULL, -425);
+
+ /* Test with length != 0 */
+ len = 2;
+ STR_TEST(0, "12", "12", -430);
+ STR_TEST(1, "12", "1", -435);
+ STR_TEST(-1, "1", "12", -440);
+ STR_TEST(-1, SNULL, "12", -445);
+ STR_TEST(1, "12", SNULL, -450);
+
+ return 0;
+
+#undef STR_TEST
+}
+
+int string_test(void)
+{
+ const pj_str_t hello_world = { HELLO_WORLD, HELLO_WORLD_LEN };
+ const pj_str_t just_hello = { JUST_HELLO, JUST_HELLO_LEN };
+ pj_str_t s1, s2, s3, s4, s5;
+ enum { RCOUNT = 10, RLEN = 16 };
+ pj_str_t random[RCOUNT];
+ pj_pool_t *pool;
+ int i;
+
+ pool = pj_pool_create(mem, SNULL, 4096, 0, SNULL);
+ if (!pool) return -5;
+
+ /*
+ * pj_str(), pj_strcmp(), pj_stricmp(), pj_strlen(),
+ * pj_strncmp(), pj_strchr()
+ */
+ s1 = pj_str(HELLO_WORLD);
+ if (pj_strcmp(&s1, &hello_world) != 0)
+ return -10;
+ if (pj_stricmp(&s1, &hello_world) != 0)
+ return -20;
+ if (pj_strcmp(&s1, &just_hello) <= 0)
+ return -30;
+ if (pj_stricmp(&s1, &just_hello) <= 0)
+ return -40;
+ if (pj_strlen(&s1) != strlen(HELLO_WORLD))
+ return -50;
+ if (pj_strncmp(&s1, &hello_world, 5) != 0)
+ return -60;
+ if (pj_strnicmp(&s1, &hello_world, 5) != 0)
+ return -70;
+ if (pj_strchr(&s1, HELLO_WORLD[1]) != s1.ptr+1)
+ return -80;
+
+ /*
+ * pj_strdup()
+ */
+ if (!pj_strdup(pool, &s2, &s1))
+ return -100;
+ if (pj_strcmp(&s1, &s2) != 0)
+ return -110;
+
+ /*
+ * pj_strcpy(), pj_strcat()
+ */
+ s3.ptr = (char*) pj_pool_alloc(pool, 256);
+ if (!s3.ptr)
+ return -200;
+ pj_strcpy(&s3, &s2);
+ pj_strcat(&s3, &just_hello);
+
+ if (pj_strcmp2(&s3, HELLO_WORLD JUST_HELLO) != 0)
+ return -210;
+
+ /*
+ * pj_strdup2(), pj_strtrim().
+ */
+ pj_strdup2(pool, &s4, " " HELLO_WORLD "\t ");
+ pj_strtrim(&s4);
+ if (pj_strcmp2(&s4, HELLO_WORLD) != 0)
+ return -250;
+
+ /*
+ * pj_utoa()
+ */
+ s5.ptr = (char*) pj_pool_alloc(pool, 16);
+ if (!s5.ptr)
+ return -270;
+ s5.slen = pj_utoa(UL_VALUE, s5.ptr);
+
+ /*
+ * pj_strtoul()
+ */
+ if (pj_strtoul(&s5) != UL_VALUE)
+ return -280;
+
+ /*
+ * pj_strtoul2()
+ */
+ s5 = pj_str("123456");
+
+ pj_strtoul2(&s5, SNULL, 10); /* Crash test */
+
+ if (pj_strtoul2(&s5, &s4, 10) != 123456UL)
+ return -290;
+ if (s4.slen != 0)
+ return -291;
+ if (pj_strtoul2(&s5, &s4, 16) != 0x123456UL)
+ return -292;
+
+ s5 = pj_str("0123ABCD");
+ if (pj_strtoul2(&s5, &s4, 10) != 123)
+ return -293;
+ if (s4.slen != 4)
+ return -294;
+ if (s4.ptr == SNULL || *s4.ptr != 'A')
+ return -295;
+ if (pj_strtoul2(&s5, &s4, 16) != 0x123ABCDUL)
+ return -296;
+ if (s4.slen != 0)
+ return -297;
+
+ /*
+ * pj_create_random_string()
+ * Check that no duplicate strings are returned.
+ */
+ for (i=0; i<RCOUNT; ++i) {
+ int j;
+
+ random[i].ptr = (char*) pj_pool_alloc(pool, RLEN);
+ if (!random[i].ptr)
+ return -320;
+
+ random[i].slen = RLEN;
+ pj_create_random_string(random[i].ptr, RLEN);
+
+ for (j=0; j<i; ++j) {
+ if (pj_strcmp(&random[i], &random[j])==0)
+ return -330;
+ }
+ }
+
+ /* Done. */
+ pj_pool_release(pool);
+
+ /* Case sensitive comparison test. */
+ i = strcmp_test();
+ if (i != 0)
+ return i;
+
+ /* Caseless comparison test. */
+ i = stricmp_test();
+ if (i != 0)
+ return i;
+
+ return 0;
+}
+
+#else
+/* To prevent warning about "translation unit is empty"
+ * when this test is disabled.
+ */
+int dummy_string_test;
+#endif /* INCLUDE_STRING_TEST */
+
diff --git a/jni/pjproject-android/.svn/pristine/e5/e5e36d3af0c9629cdc3986f2cbea4bf47da0019a.svn-base b/jni/pjproject-android/.svn/pristine/e5/e5e36d3af0c9629cdc3986f2cbea4bf47da0019a.svn-base
new file mode 100644
index 0000000..f9beb05
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/e5/e5e36d3af0c9629cdc3986f2cbea4bf47da0019a.svn-base
@@ -0,0 +1,30 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+# Some non-SIP URI's in Contact header
+#
+complete_msg = \
+"""SUBSCRIBE sip:localhost SIP/2.0
+Via: SIP/2.0/UDP 192.168.0.14:5060;rport;branch=z9hG4bKPj9db9
+Max-Forwards: 70
+From: <sip:192.168.0.14>;tag=08cd5bfc2d8a4fddb1f5e59c6961d298
+To: <sip:localhost>
+Call-ID: 3373d9eb32aa458db7e69c7ea51e0bd7
+CSeq: 0 SUBSCRIBE
+Contact: mailto:dontspam@pjsip.org
+Contact: <mailto:dontspam@pjsip.org>
+Contact: http://www.pjsip.org/the%20path.cgi?pname=pvalue
+Event: presence
+Expires: 600
+Accept: application/pidf+xml, application/xpidf+xml
+Allow-Events: presence, refer
+User-Agent: PJSUA v0.9.0-trunk/win32
+Content-Length: 0
+"""
+
+
+sendto_cfg = sip.SendtoCfg( "Non SIP URI in Contact",
+ "--null-audio --auto-answer 200",
+ "", 400, complete_msg=complete_msg)
+