* #36737: switch back to svn repo, remove assert in sip_transaction.c
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d0632aabc99dc2a862ea71babf472d90d997147.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d0632aabc99dc2a862ea71babf472d90d997147.svn-base
new file mode 100644
index 0000000..7371092
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d0632aabc99dc2a862ea71babf472d90d997147.svn-base
@@ -0,0 +1,31 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+sdp = \
+"""
+v=0
+o=- 0 0 IN IP4 127.0.0.1
+s=pjmedia
+c=IN IP4 127.0.0.1
+t=0 0
+m=audio 4000 RTP/AVP 0 101
+a=rtcp:4382 IN IP4 192.168.0.4
+a=ice-ufrag:1234
+a=ice-pwd:5678
+a=rtpmap:0 PCMU/8000
+a=sendrecv
+a=rtpmap:101 telephone-event/8000
+a=fmtp:101 0-15
+a=candidate:XX 1 UDP 1234 127.0.0.1 4000 typ host
+a=candidate:XX 2 UDP 1234 127.0.0.1 4000 typ host
+"""
+
+args = "--null-audio --use-ice --auto-answer 200 --max-calls 1"
+include = ["a=ice-mismatch"]
+exclude = []
+
+sendto_cfg = sip.SendtoCfg( "caller sends mismatched offer for comp 2", 
+			    pjsua_args=args, sdp=sdp, resp_code=200, 
+			    resp_inc=include, resp_exc=exclude)
+
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d0ef4ae652f1c44819c2b205ecc45e80f64cd2a.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d0ef4ae652f1c44819c2b205ecc45e80f64cd2a.svn-base
new file mode 100644
index 0000000..3ab73f9
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d0ef4ae652f1c44819c2b205ecc45e80f64cd2a.svn-base
@@ -0,0 +1,11 @@
+# $Id$
+#
+from inc_cfg import *
+
+test_param = TestParam(
+		"Callee=optional (with duplicated offer) SRTP, caller=mandatory SRTP",
+		[
+			InstanceParam("callee", "--null-audio --use-srtp=3 --srtp-secure=0 --max-calls=1"),
+			InstanceParam("caller", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1")
+		]
+		)
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d1d40844e0f5df810d43bd4ae21ec60ab6edb73.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d1d40844e0f5df810d43bd4ae21ec60ab6edb73.svn-base
new file mode 100644
index 0000000..8df7da0
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d1d40844e0f5df810d43bd4ae21ec60ab6edb73.svn-base
@@ -0,0 +1,183 @@
+.\"
+.\" Copyright 1992-1995 by Jutta Degener and Carsten Bormann, Technische
+.\" Universitaet Berlin.  See the accompanying file "COPYRIGHT" for
+.\" details.  THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
+.\"
+.PU
+.TH GSM_OPTION 3 
+.SH NAME
+gsm_option \(em customizing the GSM 06.10 implementation
+.SH SYNOPSIS
+#include "gsm.h"
+.PP
+int gsm_option(handle, option, valueP);
+.br
+gsm handle;
+.br
+int option;
+.br
+int * valueP;
+.SH "DESCRIPTION"
+The gsm library is an implementation of the final draft GSM 06.10
+standard for full-rate speech transcoding, a lossy
+speech compression algorithm.
+.PP
+The gsm_option() function can be used to set and query various
+options or flags that are not needed for regular GSM 06.10 encoding
+or decoding, but might be of interest in special cases.
+.PP
+The second argument to gsm_option specifies what parameter
+should be changed or queried.
+The third argument is either a null pointer, in which case
+the current value of that parameter is returned;
+or it is a pointer to an integer containing the value
+you want to set, in which case the previous value will
+be returned.
+.PP
+The following options are defined:
+.PP
+.I GSM_OPT_VERBOSE
+Verbosity level.
+.br
+.in+5
+This option is only supported if the library was compiled
+with debugging turned on, and may be used by developers of
+compression algorithms to aid debugging.
+.br
+The verbosity level can be changed at any time during encoding or decoding.
+.in-5
+.sp
+.PP
+.I GSM_OPT_FAST
+Faster compression algorithm.
+.br
+.in+5
+This implementation offers a not strictly standard-compliant, but
+faster compression algorithm that is compatible with the regular
+method and does not noticably degrade audio quality.
+.br
+The value passed to 
+.br
+.nf
+	gsm_option(handle, GSM_OPT_FAST, & value)
+.fi
+.br 
+functions as a boolean flag; if it is zero, the regular algorithm
+will be used, if not, the faster version will be used.
+.br
+The availability of this option depends on the hardware used;
+if it is not available, gsm_option will return -1 on an attempt
+to set or query it.
+.br
+This option can be set any time during encoding or decoding.
+.in-5
+.ne 5
+.sp
+.PP
+.I GSM_OPT_LTP_CUT
+Enable, disable, or query the LTP cut-off optimization.
+.br
+.in+5
+During encoding, the search for the long-term correlation
+lag forms the bottleneck of the algorithm. 
+The ltp-cut option enables an approximation that disregards most
+of the samples for purposes of finding that correlation,
+and hence speeds up the encoding at a noticable loss in quality.
+.br
+The value passed to 
+.br
+.nf
+	gsm_option(handle, GSM_OPT_LTP_CUT, & value)
+.fi
+.br 
+turns the optimization on if nonzero, and off if zero.
+.br
+This option can be set any time during encoding
+or decoding; it will only affect the encoding pass, not
+the decoding.
+.sp
+.PP
+.I GSM_OPT_WAV49
+WAV-style byte ordering.
+.br
+.in+5
+A WAV file of type #49 contains GSM 06.10-encoded frames.
+Unfortunately, the framing and code ordering of the WAV version
+are incompatible with the native ones of this GSM 06.10 library.
+The GSM_OPT_WAV49 option turns on a different packing
+algorithm that produces alternating frames of 32 and 33 bytes
+(or makes it consume alternating frames of 33 and 32 bytes, note
+the opposite order of the two numbers) which, when concatenated,
+can be used in the body of a WAV #49 frame.
+It is up to the user program to write a WAV header, if any;
+neither the library itself nor the toast program produce
+complete WAV files.
+.br
+The value passed to 
+.br
+.nf
+	gsm_option(handle, GSM_OPT_WAV49, & value)
+.fi
+.br 
+functions as a boolean flag; if it is zero, the library's native
+framing algorithm will be used, if nonzero, WAV-type packing is in effect.
+.br
+This option should be used before any frames are encoded.
+Whether or not it is supported at all depends on a
+compile-time switch, WAV49.
+Both option and compile time switch are new to the library
+as of patchlevel 9, and are considerably less tested than the
+well-worn rest of the it.
+.br
+Thanks to Jeff Chilton for the detective work and first free
+implementation of this version of the GSM 06.10 encoding.
+.sp
+.PP
+.I GSM_OPT_FRAME_CHAIN
+Query or set the chaining byte.
+.br
+.in+5
+Between the two frames of a WAV-style encoding, the GSM 06.10 library
+must keep track of one half-byte that is technically part of the first
+frame, but will be written as the first four bits of the second.
+This half-byte are the lowest four bits of the value returned by,
+and optionally set by,
+.br
+.nf
+	gsm_option(handle, GSM_OPT_FRAME_CHAIN, & value)
+.fi
+.br 
+This option can be queried and set at any time.
+.sp
+.PP
+.I GSM_OPT_FRAME_INDEX
+Query or set the current frame's index in a format's
+alternating list of frames.
+.br
+.in+5
+The WAV #49 framing uses two alternating types of frames.
+Which type the next GSM-coded frame belongs to can be queried, or,
+when decoding, announced, using
+.br
+.nf
+	gsm_option(handle, GSM_OPT_FRAME_INDEX, & value)
+.fi
+.br 
+For WAV-style framing, the value should be 0 or 1; the first frame
+of an encoding has an index of 0. 
+At library initialization, the index is set to zero.
+.br 
+The frame index can be queried and set at any time.
+Used in combination with the
+.IR GSM_OPT_FRAME_CHAIN ,
+option, it can be used to position on arbitrary GSM frames
+within a format like WAV #49 (not accounting for the lost
+internal GSM state).
+.in-5
+.SH "RETURN VALUE"
+gsm_option() returns -1 if an option is not supported, the
+previous value of the option otherwise.
+.SH BUGS
+Please direct bug reports to jutta@cs.tu-berlin.de and cabo@cs.tu-berlin.de.
+.SH "SEE ALSO"
+toast(1), gsm(3), gsm_explode(3), gsm_print(3)
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d238574f67113713337050cc654fa3251f6acb4.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d238574f67113713337050cc654fa3251f6acb4.svn-base
new file mode 100644
index 0000000..c3e7b76
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d238574f67113713337050cc654fa3251f6acb4.svn-base
@@ -0,0 +1,273 @@
+/*
+ * math.h
+ *
+ * crypto math operations and data types
+ *
+ * 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.
+ *
+ */
+
+#ifndef MATH_H
+#define MATH_H
+
+#include "datatypes.h"
+
+unsigned char
+v32_weight(v32_t a);
+
+unsigned char
+v32_distance(v32_t x, v32_t y);
+
+unsigned int
+v32_dot_product(v32_t a, v32_t b);
+
+char *
+v16_bit_string(v16_t x);
+
+char *
+v32_bit_string(v32_t x);
+
+char *
+v64_bit_string(const v64_t *x);
+
+char *
+octet_hex_string(uint8_t x);
+
+char *
+v16_hex_string(v16_t x);
+
+char *
+v32_hex_string(v32_t x);
+
+char *
+v64_hex_string(const v64_t *x);
+
+int
+hex_char_to_nibble(uint8_t c);
+
+int
+is_hex_string(char *s);
+
+v16_t
+hex_string_to_v16(char *s);
+
+v32_t
+hex_string_to_v32(char *s);
+
+v64_t
+hex_string_to_v64(char *s);
+
+/* the matrix A[] is stored in column format, i.e., A[i] is
+   the ith column of the matrix */
+
+uint8_t 
+A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+
+void
+v16_copy_octet_string(v16_t *x, const uint8_t s[2]);
+
+void
+v32_copy_octet_string(v32_t *x, const uint8_t s[4]);
+
+void
+v64_copy_octet_string(v64_t *x, const uint8_t s[8]);
+
+void
+v128_add(v128_t *z, v128_t *x, v128_t *y);
+
+int
+octet_string_is_eq(uint8_t *a, uint8_t *b, int len);
+
+void
+octet_string_set_to_zero(uint8_t *s, int len);
+
+
+
+/* 
+ * the matrix A[] is stored in column format, i.e., A[i] is the ith
+ * column of the matrix
+*/
+uint8_t 
+A_times_x_plus_b(uint8_t A[8], uint8_t x, uint8_t b);
+
+
+#if 0
+#if WORDS_BIGENDIAN
+
+#define _v128_add(z, x, y) {                    \
+  uint64_t tmp;					\
+    						\
+  tmp = x->v32[3] + y->v32[3];                  \
+  z->v32[3] = (uint32_t) tmp;			\
+  						\
+  tmp =  x->v32[2] + y->v32[2] + (tmp >> 32);	\
+  z->v32[2] = (uint32_t) tmp;                   \
+						\
+  tmp =  x->v32[1] + y->v32[1] + (tmp >> 32);	\
+  z->v32[1] = (uint32_t) tmp;			\
+                                                \
+  tmp =  x->v32[0] + y->v32[0] + (tmp >> 32);	\
+  z->v32[0] = (uint32_t) tmp;			\
+}
+
+#else /* assume little endian architecture */
+
+#define _v128_add(z, x, y) {                    \
+  uint64_t tmp;					\
+						\
+  tmp = htonl(x->v32[3]) + htonl(y->v32[3]);	\
+  z->v32[3] = ntohl((uint32_t) tmp);		\
+  						\
+  tmp =  htonl(x->v32[2]) + htonl(y->v32[2])	\
+       + htonl(tmp >> 32);			\
+  z->v32[2] = ntohl((uint32_t) tmp);		\
+                                                \
+  tmp =  htonl(x->v32[1]) + htonl(y->v32[1])	\
+       + htonl(tmp >> 32);			\
+  z->v32[1] = ntohl((uint32_t) tmp);		\
+  						\
+  tmp =  htonl(x->v32[0]) + htonl(y->v32[0])	\
+       + htonl(tmp >> 32);			\
+  z->v32[0] = ntohl((uint32_t) tmp);		\
+}
+						
+#endif /* WORDS_BIGENDIAN */                      
+#endif
+
+#ifdef DATATYPES_USE_MACROS  /* little functions are really macros */
+
+#define v128_set_to_zero(z)       _v128_set_to_zero(z)
+#define v128_copy(z, x)           _v128_copy(z, x)
+#define v128_xor(z, x, y)         _v128_xor(z, x, y)
+#define v128_and(z, x, y)         _v128_and(z, x, y)
+#define v128_or(z, x, y)          _v128_or(z, x, y)
+#define v128_complement(x)        _v128_complement(x) 
+#define v128_is_eq(x, y)          _v128_is_eq(x, y)
+#define v128_xor_eq(x, y)         _v128_xor_eq(x, y)
+#define v128_get_bit(x, i)        _v128_get_bit(x, i)
+#define v128_set_bit(x, i)        _v128_set_bit(x, i)
+#define v128_clear_bit(x, i)      _v128_clear_bit(x, i)
+#define v128_set_bit_to(x, i, y)  _v128_set_bit_to(x, i, y)
+
+#else
+
+void
+v128_set_to_zero(v128_t *x);
+
+int
+v128_is_eq(const v128_t *x, const v128_t *y);
+
+void
+v128_copy(v128_t *x, const v128_t *y);
+
+void
+v128_xor(v128_t *z, v128_t *x, v128_t *y);
+
+void
+v128_and(v128_t *z, v128_t *x, v128_t *y);
+
+void
+v128_or(v128_t *z, v128_t *x, v128_t *y); 
+
+void
+v128_complement(v128_t *x);
+
+int
+v128_get_bit(const v128_t *x, int i);
+
+void
+v128_set_bit(v128_t *x, int i) ;     
+
+void
+v128_clear_bit(v128_t *x, int i);    
+
+void
+v128_set_bit_to(v128_t *x, int i, int y);
+
+#endif /* DATATYPES_USE_MACROS */
+
+/*
+ * octet_string_is_eq(a,b, len) returns 1 if the length len strings a
+ * and b are not equal, returns 0 otherwise
+ */
+
+int
+octet_string_is_eq(uint8_t *a, uint8_t *b, int len);
+
+void
+octet_string_set_to_zero(uint8_t *s, int len);
+
+
+/*
+ * functions manipulating bit_vector_t 
+ *
+ * A bitvector_t consists of an array of words and an integer
+ * representing the number of significant bits stored in the array.
+ * The bits are packed as follows: the least significant bit is that
+ * of word[0], while the most significant bit is the nth most
+ * significant bit of word[m], where length = bits_per_word * m + n.
+ * 
+ */
+
+#define bits_per_word  32
+#define bytes_per_word 4
+
+typedef struct {
+  uint32_t length;   
+  uint32_t *word;
+} bitvector_t;
+
+int
+bitvector_alloc(bitvector_t *v, unsigned long length);
+
+void
+bitvector_set_bit(bitvector_t *v, int bit_index);
+
+int
+bitvector_get_bit(const bitvector_t *v, int bit_index);
+
+int
+bitvector_print_hex(const bitvector_t *v, FILE *stream);
+
+int
+bitvector_set_from_hex(bitvector_t *v, char *string);
+
+#endif /* MATH_H */
+
+
+
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d277a9b752c3ddb531152fd020fe571e2ab3d83.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d277a9b752c3ddb531152fd020fe571e2ab3d83.svn-base
new file mode 100644
index 0000000..aac10e6
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d277a9b752c3ddb531152fd020fe571e2ab3d83.svn-base
@@ -0,0 +1,602 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2011-2011 Teluu Inc. (http://www.teluu.com)
+ *
+ * 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 <pjsua-lib/pjsua.h>
+#include <pjsua-lib/pjsua_internal.h>
+
+#if defined(PJSUA_MEDIA_HAS_PJMEDIA) && PJSUA_MEDIA_HAS_PJMEDIA != 0
+#  error The PJSUA_MEDIA_HAS_PJMEDIA should be declared as zero
+#endif
+
+#if PJSUA_HAS_VIDEO
+
+#define THIS_FILE		"alt_pjsua_vid.c"
+#define UNIMPLEMENTED(func)	PJ_LOG(2,(THIS_FILE, "*** Call to unimplemented function %s ***", #func));
+
+/*****************************************************************************
+ * Our video codec descriptors
+ */
+struct alt_codec_desc
+{
+    /* Predefined info */
+    pjmedia_vid_codec_info       info;
+    pjmedia_format_id		 base_fmt_id;
+    pj_uint32_t			 avg_bps;
+    pj_uint32_t			 max_bps;
+    pjmedia_codec_fmtp		 dec_fmtp;
+} alt_vid_codecs[] =
+{
+    /* H.263+ */
+    {
+	{PJMEDIA_FORMAT_H263P, PJMEDIA_RTP_PT_H263P, {"H263-1998",9},
+	 {"H.263 codec", 11}, 90000, PJMEDIA_DIR_ENCODING_DECODING,
+	 0, {PJMEDIA_FORMAT_RGB24}, PJMEDIA_VID_PACKING_PACKETS
+	},
+	PJMEDIA_FORMAT_H263,	256000,    512000,
+	{2, { {{"CIF",3},   {"1",1}},
+	      {{"QCIF",4},  {"1",1}}, } },
+    }
+};
+
+static const struct alt_codec_desc* find_codec_desc_by_info(const pjmedia_vid_codec_info *info)
+{
+    unsigned i;
+    for (i=0; i<PJ_ARRAY_SIZE(alt_vid_codecs); ++i) {
+	struct alt_codec_desc *desc = &alt_vid_codecs[i];
+	if ((desc->info.fmt_id == info->fmt_id) &&
+            ((desc->info.dir & info->dir) == info->dir) &&
+	    (desc->info.pt == info->pt) &&
+	    (desc->info.packings & info->packings))
+        {
+            return desc;
+        }
+    }
+
+    return NULL;
+}
+
+static pj_status_t alt_vid_codec_test_alloc( pjmedia_vid_codec_factory *factory,
+                                             const pjmedia_vid_codec_info *id )
+{
+    const struct alt_codec_desc *desc = find_codec_desc_by_info(id);
+    return desc? PJ_SUCCESS : PJMEDIA_CODEC_EUNSUP;
+}
+
+static pj_status_t alt_vid_codec_default_attr( pjmedia_vid_codec_factory *factory,
+                                               const pjmedia_vid_codec_info *info,
+                                               pjmedia_vid_codec_param *attr )
+{
+    const struct alt_codec_desc *desc = find_codec_desc_by_info(info);
+    unsigned i;
+
+    if (!desc)
+        return PJMEDIA_CODEC_EUNSUP;
+
+    pj_bzero(attr, sizeof(pjmedia_vid_codec_param));
+
+    /* Scan the requested packings and use the lowest number */
+    attr->packing = 0;
+    for (i=0; i<15; ++i) {
+	unsigned packing = (1 << i);
+	if ((desc->info.packings & info->packings) & packing) {
+	    attr->packing = (pjmedia_vid_packing)packing;
+	    break;
+	}
+    }
+    if (attr->packing == 0) {
+	/* No supported packing in info */
+	return PJMEDIA_CODEC_EUNSUP;
+    }
+
+    /* Direction */
+    attr->dir = desc->info.dir;
+
+    /* Encoded format */
+    pjmedia_format_init_video(&attr->enc_fmt, desc->info.fmt_id,
+                              720, 480, 30000, 1001);
+
+    /* Decoded format */
+    pjmedia_format_init_video(&attr->dec_fmt, desc->info.dec_fmt_id[0],
+                              //352, 288, 30000, 1001);
+                              720, 576, 30000, 1001);
+
+    /* Decoding fmtp */
+    attr->dec_fmtp = desc->dec_fmtp;
+
+    /* Bitrate */
+    attr->enc_fmt.det.vid.avg_bps = desc->avg_bps;
+    attr->enc_fmt.det.vid.max_bps = desc->max_bps;
+
+    /* MTU */
+    attr->enc_mtu = PJMEDIA_MAX_MTU;
+
+    return PJ_SUCCESS;
+}
+
+
+static pj_status_t alt_vid_codec_enum_codecs( pjmedia_vid_codec_factory *factory,
+					      unsigned *count,
+					      pjmedia_vid_codec_info codecs[])
+{
+    unsigned i, max_cnt;
+
+    PJ_ASSERT_RETURN(codecs && *count > 0, PJ_EINVAL);
+
+    max_cnt = PJ_MIN(*count, PJ_ARRAY_SIZE(alt_vid_codecs));
+    *count = 0;
+
+    for (i=0; i<max_cnt; ++i) {
+	pj_memcpy(&codecs[*count], &alt_vid_codecs[i].info,
+		  sizeof(pjmedia_vid_codec_info));
+	(*count)++;
+    }
+
+    return PJ_SUCCESS;
+}
+
+
+static pj_status_t alt_vid_codec_alloc_codec( pjmedia_vid_codec_factory *factory,
+					      const pjmedia_vid_codec_info *info,
+					      pjmedia_vid_codec **p_codec)
+{
+    /* This will never get called since we won't be using this codec */
+    UNIMPLEMENTED(alt_vid_codec_alloc_codec)
+    return PJ_ENOTSUP;
+}
+
+
+static pj_status_t alt_vid_codec_dealloc_codec( pjmedia_vid_codec_factory *factory,
+                                                pjmedia_vid_codec *codec )
+{
+    /* This will never get called since we won't be using this codec */
+    UNIMPLEMENTED(alt_vid_codec_dealloc_codec)
+    return PJ_ENOTSUP;
+}
+
+static pjmedia_vid_codec_factory_op alt_vid_codec_factory_op =
+{
+    &alt_vid_codec_test_alloc,
+    &alt_vid_codec_default_attr,
+    &alt_vid_codec_enum_codecs,
+    &alt_vid_codec_alloc_codec,
+    &alt_vid_codec_dealloc_codec
+};
+
+static struct alt_vid_codec_factory {
+    pjmedia_vid_codec_factory    base;
+} alt_vid_codec_factory;
+
+/*****************************************************************************
+ * Video API implementation
+ */
+
+/* Initialize the video library */
+pj_status_t pjsua_vid_subsys_init(void)
+{
+    pjmedia_vid_codec_mgr *mgr;
+    pj_status_t status;
+
+    /* Format manager singleton is needed */
+    status = pjmedia_video_format_mgr_create(pjsua_var.pool, 64, 0, NULL);
+    if (status != PJ_SUCCESS) {
+	PJ_PERROR(1,(THIS_FILE, status,
+		     "Error creating PJMEDIA video format manager"));
+	return status;
+    }
+
+    /* Create video codec manager singleton */
+    status = pjmedia_vid_codec_mgr_create(pjsua_var.pool, &mgr);
+    if (status != PJ_SUCCESS) {
+	PJ_PERROR(1,(THIS_FILE, status,
+		     "Error creating PJMEDIA video codec manager"));
+	return status;
+    }
+
+    /* Register our codecs */
+    alt_vid_codec_factory.base.op = &alt_vid_codec_factory_op;
+    alt_vid_codec_factory.base.factory_data = NULL;
+
+    status = pjmedia_vid_codec_mgr_register_factory(mgr, &alt_vid_codec_factory.base);
+    if (status != PJ_SUCCESS)
+	return status;
+
+    /*
+     * TODO: put your 3rd party library initialization routine here
+     */
+
+    return PJ_SUCCESS;
+}
+
+/* Start the video library */
+pj_status_t pjsua_vid_subsys_start(void)
+{
+    /*
+     * TODO: put your 3rd party library startup routine here
+     */
+    return PJ_SUCCESS;
+}
+
+/* Cleanup and deinitialize the video library */
+pj_status_t pjsua_vid_subsys_destroy(void)
+{
+    if (pjmedia_vid_codec_mgr_instance())
+	pjmedia_vid_codec_mgr_destroy(NULL);
+
+    if (pjmedia_video_format_mgr_instance())
+	pjmedia_video_format_mgr_destroy(NULL);
+
+    /*
+     * TODO: put your 3rd party library cleanup routine here
+     */
+    return PJ_SUCCESS;
+}
+
+/* Initialize video call media */
+pj_status_t pjsua_vid_channel_init(pjsua_call_media *call_med)
+{
+    /*
+     * TODO: put call media initialization
+     */
+    return PJ_SUCCESS;
+}
+
+/* Internal function to stop video stream */
+void pjsua_vid_stop_stream(pjsua_call_media *call_med)
+{
+    PJ_LOG(4,(THIS_FILE, "Stopping video stream.."));
+
+    if (call_med->tp) {
+	pjmedia_transport_detach(call_med->tp, call_med);
+    }
+
+    /*
+     * TODO:
+     *   - stop your video stream here
+     */
+
+}
+
+/* Our callback to receive incoming RTP packets */
+static void vid_rtp_cb(void *user_data, void *pkt, pj_ssize_t size)
+{
+    pjsua_call_media *call_med = (pjsua_call_media*) user_data;
+
+    /* TODO: Do something with the packet */
+    PJ_LOG(4,(THIS_FILE, "RX %d bytes video RTP packet", (int)size));
+}
+
+/* Our callback to receive RTCP packets */
+static void vid_rtcp_cb(void *user_data, void *pkt, pj_ssize_t size)
+{
+    pjsua_call_media *call_med = (pjsua_call_media*) user_data;
+
+    /* TODO: Do something with the packet here */
+    PJ_LOG(4,(THIS_FILE, "RX %d bytes video RTCP packet", (int)size));
+}
+
+/* A demo function to send dummy "RTP" packets periodically. You would not
+ * need to have this function in the real app!
+ */
+static void timer_to_send_vid_rtp(void *user_data)
+{
+    pjsua_call_media *call_med = (pjsua_call_media*) user_data;
+    const char *pkt = "Not RTP packet";
+
+    if (!call_med->call || !call_med->call->inv || !call_med->tp) {
+	/* Call has been disconnected. There is race condition here as
+	 * this cb may be called sometime after call has been disconnected */
+	return;
+    }
+
+    pjmedia_transport_send_rtp(call_med->tp, pkt, strlen(pkt));
+
+    pjsua_schedule_timer2(&timer_to_send_vid_rtp, call_med, 2000);
+}
+
+static void timer_to_send_vid_rtcp(void *user_data)
+{
+    pjsua_call_media *call_med = (pjsua_call_media*) user_data;
+    const char *pkt = "Not RTCP packet";
+
+    if (!call_med->call || !call_med->call->inv || !call_med->tp) {
+	/* Call has been disconnected. There is race condition here as
+	 * this cb may be called sometime after call has been disconnected */
+	return;
+    }
+
+    pjmedia_transport_send_rtcp(call_med->tp, pkt, strlen(pkt));
+
+    pjsua_schedule_timer2(&timer_to_send_vid_rtcp, call_med, 5000);
+}
+
+/* update video channel after SDP negotiation */
+pj_status_t pjsua_vid_channel_update(pjsua_call_media *call_med,
+				     pj_pool_t *tmp_pool,
+				     pjmedia_vid_stream_info *si,
+				     const pjmedia_sdp_session *local_sdp,
+				     const pjmedia_sdp_session *remote_sdp)
+{
+    pj_status_t status;
+    
+    PJ_LOG(4,(THIS_FILE, "Video channel update.."));
+    pj_log_push_indent();
+
+    /* Check if no media is active */
+    if (si->dir != PJMEDIA_DIR_NONE) {
+	/* Attach our RTP and RTCP callbacks to the media transport */
+	status = pjmedia_transport_attach(call_med->tp, call_med,
+	                                  &si->rem_addr, &si->rem_rtcp,
+	                                  pj_sockaddr_get_len(&si->rem_addr),
+	                                  &vid_rtp_cb, &vid_rtcp_cb);
+	/*
+	 * TODO:
+	 *   - Create and start your video stream based on the parameters
+	 *     in si
+	 */
+
+	/* For a demonstration, let's use a timer to send "RTP" packet
+	 * periodically.
+	 */
+	pjsua_schedule_timer2(&timer_to_send_vid_rtp, call_med, 1000);
+	pjsua_schedule_timer2(&timer_to_send_vid_rtcp, call_med, 3500);
+    }
+
+    pj_log_pop_indent();
+    return PJ_SUCCESS;
+}
+
+
+/*****************************************************************************
+ * Preview
+ */
+
+PJ_DEF(void)
+pjsua_call_vid_strm_op_param_default(pjsua_call_vid_strm_op_param *param)
+{
+    pj_bzero(param, sizeof(*param));
+    param->med_idx = -1;
+    param->dir = PJMEDIA_DIR_ENCODING_DECODING;
+    param->cap_dev = PJMEDIA_VID_DEFAULT_CAPTURE_DEV;
+}
+
+PJ_DEF(void) pjsua_vid_preview_param_default(pjsua_vid_preview_param *p)
+{
+    p->rend_id = PJMEDIA_VID_DEFAULT_RENDER_DEV;
+    p->show = PJ_TRUE;
+}
+
+PJ_DEF(pjsua_vid_win_id) pjsua_vid_preview_get_win(pjmedia_vid_dev_index id)
+{
+    UNIMPLEMENTED(pjsua_vid_preview_get_win)
+    return PJSUA_INVALID_ID;
+}
+
+/* Reset internal window structure. Not sure if this is needed?. */
+PJ_DEF(void) pjsua_vid_win_reset(pjsua_vid_win_id wid)
+{
+    pjsua_vid_win *w = &pjsua_var.win[wid];
+    pj_pool_t *pool = w->pool;
+
+    pj_bzero(w, sizeof(*w));
+    if (pool) pj_pool_reset(pool);
+    w->ref_cnt = 0;
+    w->pool = pool;
+    w->preview_cap_id = PJMEDIA_VID_INVALID_DEV;
+}
+
+/* Does it have built-in preview support. */
+PJ_DEF(pj_bool_t) pjsua_vid_preview_has_native(pjmedia_vid_dev_index id)
+{
+    UNIMPLEMENTED(pjsua_vid_preview_has_native)
+    return PJ_FALSE;
+}
+
+/* Start video preview window for the specified capture device. */
+PJ_DEF(pj_status_t) pjsua_vid_preview_start(pjmedia_vid_dev_index id,
+                                            const pjsua_vid_preview_param *prm)
+{
+    UNIMPLEMENTED(pjsua_vid_preview_start)
+    return PJ_ENOTSUP;
+}
+
+/* Stop video preview. */
+PJ_DEF(pj_status_t) pjsua_vid_preview_stop(pjmedia_vid_dev_index id)
+{
+    UNIMPLEMENTED(pjsua_vid_preview_stop)
+    return PJ_ENOTSUP;
+}
+
+
+/*****************************************************************************
+ * Devices.
+ */
+
+/* Get the number of video devices installed in the system. */
+PJ_DEF(unsigned) pjsua_vid_dev_count(void)
+{
+    UNIMPLEMENTED(pjsua_vid_dev_count)
+    return 0;
+}
+
+/* Retrieve the video device info for the specified device index. */
+PJ_DEF(pj_status_t) pjsua_vid_dev_get_info(pjmedia_vid_dev_index id,
+                                           pjmedia_vid_dev_info *vdi)
+{
+    UNIMPLEMENTED(pjsua_vid_dev_get_info)
+    return PJ_ENOTSUP;
+}
+
+/* Enum all video devices installed in the system. */
+PJ_DEF(pj_status_t) pjsua_vid_enum_devs(pjmedia_vid_dev_info info[],
+					unsigned *count)
+{
+    UNIMPLEMENTED(pjsua_vid_enum_devs)
+    return PJ_ENOTSUP;
+}
+
+
+/*****************************************************************************
+ * Codecs.
+ */
+
+/* Enum all supported video codecs in the system. */
+PJ_DEF(pj_status_t) pjsua_vid_enum_codecs( pjsua_codec_info id[],
+					   unsigned *p_count )
+{
+    pjmedia_vid_codec_info info[32];
+    unsigned i, j, count, prio[32];
+    pj_status_t status;
+
+    count = PJ_ARRAY_SIZE(info);
+    status = pjmedia_vid_codec_mgr_enum_codecs(NULL, &count, info, prio);
+    if (status != PJ_SUCCESS) {
+	*p_count = 0;
+	return status;
+    }
+    for (i=0, j=0; i<count && j<*p_count; ++i) {
+	if (info[i].packings & PJMEDIA_VID_PACKING_PACKETS) {
+	    pj_bzero(&id[j], sizeof(pjsua_codec_info));
+
+	    pjmedia_vid_codec_info_to_id(&info[i], id[j].buf_, sizeof(id[j].buf_));
+	    id[j].codec_id = pj_str(id[j].buf_);
+	    id[j].priority = (pj_uint8_t) prio[i];
+
+	    if (id[j].codec_id.slen < sizeof(id[j].buf_)) {
+		id[j].desc.ptr = id[j].codec_id.ptr + id[j].codec_id.slen + 1;
+		pj_strncpy(&id[j].desc, &info[i].encoding_desc,
+			   sizeof(id[j].buf_) - id[j].codec_id.slen - 1);
+	    }
+
+	    ++j;
+	}
+    }
+
+    *p_count = j;
+    return PJ_SUCCESS;
+}
+
+/* Change video codec priority. */
+PJ_DEF(pj_status_t) pjsua_vid_codec_set_priority( const pj_str_t *codec_id,
+						  pj_uint8_t priority )
+{
+    UNIMPLEMENTED(pjsua_vid_codec_set_priority)
+    return PJ_ENOTSUP;
+}
+
+/* Get video codec parameters. */
+PJ_DEF(pj_status_t) pjsua_vid_codec_get_param(
+					const pj_str_t *codec_id,
+					pjmedia_vid_codec_param *param)
+{
+    UNIMPLEMENTED(pjsua_vid_codec_get_param)
+    return PJ_ENOTSUP;
+}
+
+/* Set video codec parameters. */
+PJ_DEF(pj_status_t) pjsua_vid_codec_set_param(
+					const pj_str_t *codec_id,
+					const pjmedia_vid_codec_param *param)
+{
+    UNIMPLEMENTED(pjsua_vid_codec_set_param)
+    return PJ_ENOTSUP;
+}
+
+
+/*****************************************************************************
+ * Window
+ */
+
+/* Enumerates all video windows. */
+PJ_DEF(pj_status_t) pjsua_vid_enum_wins( pjsua_vid_win_id wids[],
+					 unsigned *count)
+{
+    UNIMPLEMENTED(pjsua_vid_enum_wins)
+    return PJ_ENOTSUP;
+}
+
+/* Get window info. */
+PJ_DEF(pj_status_t) pjsua_vid_win_get_info( pjsua_vid_win_id wid,
+                                            pjsua_vid_win_info *wi)
+{
+    UNIMPLEMENTED(pjsua_vid_win_get_info)
+    return PJ_ENOTSUP;
+}
+
+/* Show or hide window. */
+PJ_DEF(pj_status_t) pjsua_vid_win_set_show( pjsua_vid_win_id wid,
+                                            pj_bool_t show)
+{
+    UNIMPLEMENTED(pjsua_vid_win_set_show)
+    return PJ_ENOTSUP;
+}
+
+/* Set video window position. */
+PJ_DEF(pj_status_t) pjsua_vid_win_set_pos( pjsua_vid_win_id wid,
+                                           const pjmedia_coord *pos)
+{
+    UNIMPLEMENTED(pjsua_vid_win_set_pos)
+    return PJ_ENOTSUP;
+}
+
+/* Resize window. */
+PJ_DEF(pj_status_t) pjsua_vid_win_set_size( pjsua_vid_win_id wid,
+                                            const pjmedia_rect_size *size)
+{
+    UNIMPLEMENTED(pjsua_vid_win_set_size)
+    return PJ_ENOTSUP;
+}
+
+/* Set video orientation. */
+PJ_DEF(pj_status_t) pjsua_vid_win_rotate( pjsua_vid_win_id wid,
+                                          int angle)
+{
+    UNIMPLEMENTED(pjsua_vid_win_rotate)
+    return PJ_ENOTSUP;
+}
+
+/* Start, stop, and/or manipulate video transmission for the specified call. */
+PJ_DEF(pj_status_t) pjsua_call_set_vid_strm (
+				pjsua_call_id call_id,
+				pjsua_call_vid_strm_op op,
+				const pjsua_call_vid_strm_op_param *param)
+{
+    UNIMPLEMENTED(pjsua_call_set_vid_strm)
+    return PJ_ENOTSUP;
+}
+
+
+/* Get the media stream index of the default video stream in the call. */
+PJ_DEF(int) pjsua_call_get_vid_stream_idx(pjsua_call_id call_id)
+{
+    UNIMPLEMENTED(pjsua_call_get_vid_stream_idx)
+    return -1;
+}
+
+/* Determine if video stream for the specified call is currently running
+ * for the specified direction.
+ */
+PJ_DEF(pj_bool_t) pjsua_call_vid_stream_is_running( pjsua_call_id call_id,
+                                                    int med_idx,
+                                                    pjmedia_dir dir)
+{
+    UNIMPLEMENTED(pjsua_call_vid_stream_is_running)
+    return PJ_FALSE;
+}
+
+#endif	/* PJSUA_HAS_VIDEO */
+
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d657f9cfb6a36cc0de4aabfa2b440d405988789.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d657f9cfb6a36cc0de4aabfa2b440d405988789.svn-base
new file mode 100644
index 0000000..fa27aac
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d657f9cfb6a36cc0de4aabfa2b440d405988789.svn-base
@@ -0,0 +1,4 @@
+export M_CFLAGS := $(CC_DEF)PJ_M_SPARC=1
+export M_CXXFLAGS :=
+export M_LDFLAGS :=
+export M_SOURCES :=
diff --git a/jni/pjproject-android/.svn/pristine/8d/8d9936a1a31365b30431794937762a3878c92c0a.svn-base b/jni/pjproject-android/.svn/pristine/8d/8d9936a1a31365b30431794937762a3878c92c0a.svn-base
new file mode 100644
index 0000000..dc2242d
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8d9936a1a31365b30431794937762a3878c92c0a.svn-base
@@ -0,0 +1,18 @@
+//
+//  main.m
+//  ipjsua
+//
+//  Created by Liong Sauw Ming on 13/3/13.
+//  Copyright (c) 2013 Teluu. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+#import "ipjsuaAppDelegate.h"
+
+int main(int argc, char *argv[])
+{
+    @autoreleasepool {
+        return UIApplicationMain(argc, argv, nil, NSStringFromClass([ipjsuaAppDelegate class]));
+    }
+}
diff --git a/jni/pjproject-android/.svn/pristine/8d/8dfb3d828e7ad371e51da3f7089598b848f215a0.svn-base b/jni/pjproject-android/.svn/pristine/8d/8dfb3d828e7ad371e51da3f7089598b848f215a0.svn-base
new file mode 100644
index 0000000..8605381
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/8d/8dfb3d828e7ad371e51da3f7089598b848f215a0.svn-base
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="ISO-8859-1" ?>
+<!DOCTYPE scenario SYSTEM "sipp.dtd">
+
+<!-- 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             -->
+<!--                                                                    -->
+<!--                 Sipp default 'uas' scenario.                       -->
+<!--                                                                    -->
+
+<scenario name="UAS answer multiple formats, UAS supports UPDATE method">
+  <!-- By adding rrs="true" (Record Route Sets), the route sets         -->
+  <!-- are saved and used for following messages sent. Useful to test   -->
+  <!-- against stateful SIP proxies/B2BUAs.                             -->
+  <recv request="INVITE" crlf="true">
+    <action>
+	<ereg regexp=".*" search_in="hdr" header="From" assign_to="3"/>
+	<ereg regexp="sip:(.*)>" search_in="hdr" header="Contact" assign_to="4,5"/>
+        <assign assign_to="4" variable="5" />
+    </action>
+  </recv>
+
+  <!-- The '[last_*]' keyword is replaced automatically by the          -->
+  <!-- specified header if it was present in the last message received  -->
+  <!-- (except if it was a retransmission). If the header was not       -->
+  <!-- present or if no message has been received, the '[last_*]'       -->
+  <!-- keyword is discarded, and all bytes until the end of the line    -->
+  <!-- are also discarded.                                              -->
+  <!--                                                                  -->
+  <!-- If the specified header was present several times in the         -->
+  <!-- message, all occurences are concatenated (CRLF seperated)        -->
+  <!-- to be used in place of the '[last_*]' keyword.                   -->
+
+  <send retrans="500">
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Content-Type: application/sdp
+      Content-Length: [len]
+      Allow: INVITE, UPDATE, ACK, BYE
+
+      v=0
+      o=- 3441953879 3441953879 IN IP4 192.168.0.15
+      s=pjmedia
+      c=IN IP4 192.168.0.15
+      t=0 0
+      m=audio 4004 RTP/AVP 0 8 3 111
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:8 PCMA/8000
+      a=rtpmap:3 GSM/8000
+      a=rtpmap:111 telephone-event/8000
+      a=fmtp:111 0-15
+
+    ]]>
+  </send>
+
+  <recv request="ACK" crlf="true">
+  </recv>
+
+
+
+  <recv request="UPDATE" crlf="true">
+  </recv>
+
+  <send>
+    <![CDATA[
+
+      SIP/2.0 200 OK
+      [last_Via:]
+      [last_From:]
+      [last_To:];tag=[call_number]
+      [last_Call-ID:]
+      [last_CSeq:]
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Content-Type: application/sdp
+      Content-Length: [len]
+      Allow: INVITE, UPDATE, ACK, BYE
+
+      v=0
+      o=- 3441953879 3441953879 IN IP4 192.168.0.15
+      s=pjmedia
+      c=IN IP4 192.168.0.15
+      t=0 0
+      m=audio 4004 RTP/AVP 0 111
+      a=rtpmap:0 PCMU/8000
+      a=rtpmap:111 telephone-event/8000
+      a=fmtp:111 0-15
+
+    ]]>
+  </send>
+
+  <pause milliseconds="2000"/>
+
+  <send retrans="500">
+    <![CDATA[
+
+      BYE sip:[$5] SIP/2.0
+      Via: SIP/2.0/[transport] [local_ip]:[local_port]
+      From: sipp  <sip:sipp@[local_ip]:[local_port]>;tag=[call_number]
+      To[$3]
+      Call-ID: [call_id]
+      Cseq: 1 BYE
+      Contact: sip:sipp@[local_ip]:[local_port]
+      Max-Forwards: 70
+      Content-Length: 0
+
+    ]]>
+  </send>
+
+  <recv response="200">
+  </recv>
+
+
+  <!-- definition of the response time repartition table (unit is ms)   -->
+  <ResponseTimeRepartition value="10, 20, 30, 40, 50, 100, 150, 200"/>
+
+  <!-- definition of the call length repartition table (unit is ms)     -->
+  <CallLengthRepartition value="10, 50, 100, 500, 1000, 5000, 10000"/>
+
+</scenario>
+