* #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/c1/c104703dbf982e00ab557955fee3b725365fc958.svn-base b/jni/pjproject-android/.svn/pristine/c1/c104703dbf982e00ab557955fee3b725365fc958.svn-base
new file mode 100644
index 0000000..2f5b5a9
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c104703dbf982e00ab557955fee3b725365fc958.svn-base
@@ -0,0 +1,11 @@
+# $Id$
+#
+import inc_const as const
+
+PJSUA = ["--null-audio --max-calls=1 --id sip:pjsua@localhost --add-buddy $SIPP_URI"]
+
+PJSUA_EXPECTS = [[0, "", "s"],
+		 [0, "Subscribe presence of:", "1"],
+		 [0, "status is Online", ""],
+		 [0, "subscription state is TERMINATED", ""]
+		 ]
diff --git a/jni/pjproject-android/.svn/pristine/c1/c10ea18d1b1c6e019bd7d1713a6bdddf82dbf0f5.svn-base b/jni/pjproject-android/.svn/pristine/c1/c10ea18d1b1c6e019bd7d1713a6bdddf82dbf0f5.svn-base
new file mode 100644
index 0000000..9b92238
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c10ea18d1b1c6e019bd7d1713a6bdddf82dbf0f5.svn-base
@@ -0,0 +1,6 @@
+QMAKE_TARGET  = PjsuaBB
+PROJECT_DIR	  := $(dir $(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST)))
+I18N_DIR	  := $(PROJECT_DIR)/translations
+
+include mk/cs-base.mk
+
diff --git a/jni/pjproject-android/.svn/pristine/c1/c11a749c7858af8fab05e76dbc082b8ad604db01.svn-base b/jni/pjproject-android/.svn/pristine/c1/c11a749c7858af8fab05e76dbc082b8ad604db01.svn-base
new file mode 100644
index 0000000..76539e1
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c11a749c7858af8fab05e76dbc082b8ad604db01.svn-base
@@ -0,0 +1,46 @@
+Dialog's Contact Address Problems
+
+
+Background
+
+When creating a dialog (UAC or UAS dialog), application needs to specify local address to be put in the Contact header generated by the dialog. This address normally is derived from the transport address created by the application.
+
+This can be a complicated thing to do, because application needs to select the appropriate address based on the transport being used to contact remote peer, and it's not so easy especially when multiple transports are created, or when multiple interfaces are present in the host (multihoming).
+
+(Note: also similarly for client registration).
+
+So a change is being/to be made to allow the dialog to automate this process. If application specify NULL as the value of the local contact when creating a dialog, then the dialog should choose the best transport address according to the following rules.
+
+
+1a. UAC
+
+UAC SHOULD select the Contact address based on the transport to be used to send initial request to target (this can be deduced by the ";transport" param in the target URI).  For example, if initial transport is UDP, then the Contact SHOULD specify the appropriate UDP transport address.
+
+When there are multiple transports available to reach the destination (such as multiple UDP transports, although this is not really tested/supported), then which transport to use follows the policy used by the transport manager.
+
+Note that target can be the URI in the request URI, or the first route in the route set. Because initial route set is specified AFTER dialog is created, the Contact header generation is done when the initial request is created/sent.
+
+Unsolved problem(s):
+ - what if the remote Contact header in the 2xx response indicates different transport? Ideally the local Contact needs to be updated too, but this is quite a complicated problem, because if we change the local Contact, then remote may change its Contact too, and this can result in an endles loop.
+
+
+1b. UAS
+
+UAS MUST select the Contact address based on the value of Contact header and the Record-Route set in the incoming request.
+
+
+
+
+2. Multihoming
+
+Problem:
+If application does not specify the address to be used when creating SIP transport, then transport address is calculated based on the primary IP address of the local host. Sometimes this is not the correct IP to be used by the dialog, especially when there are multiple interfaces in the host. If this "incorrect" address is specified in the Contact, then remote would not be able to send request to local host.
+
+
+Workaround:
+Change the behavior of determining local IP. Instead of calling gethostbyname() for local host, the local interface IP is determined by creating an UDP socket, do UDP connect() to some public host, and get the local IP address of the socket.
+
+Although this does not fully solve the problem, hopefully it solves many problems in typical desktop systems, where an "unwanted" adapter takes precendence over the "wanted" adapter on the host/address resolution.
+
+A fully working solution would probably involve having a table to track which interface to use based on the destination, or to query the host's routing table.
+
diff --git a/jni/pjproject-android/.svn/pristine/c1/c11b9028b6ab29365dfb8252a4a01be155ecf2f4.svn-base b/jni/pjproject-android/.svn/pristine/c1/c11b9028b6ab29365dfb8252a4a01be155ecf2f4.svn-base
new file mode 100644
index 0000000..25ca90a
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c11b9028b6ab29365dfb8252a4a01be155ecf2f4.svn-base
@@ -0,0 +1,491 @@
+/*
+ * cipher_driver.c
+ *
+ * A driver for the generic cipher type
+ *
+ * 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 <stdio.h>           /* for printf() */
+#include <stdlib.h>          /* for rand() */
+#include <string.h>          /* for memset() */
+#include <unistd.h>          /* for getopt() */
+#include "cipher.h"
+#include "aes_icm.h"
+#include "null_cipher.h"
+
+#define PRINT_DEBUG 0
+
+void
+cipher_driver_test_throughput(cipher_t *c);
+
+err_status_t
+cipher_driver_self_test(cipher_type_t *ct);
+
+
+/*
+ * cipher_driver_test_buffering(ct) tests the cipher's output
+ * buffering for correctness by checking the consistency of succesive
+ * calls
+ */
+
+err_status_t
+cipher_driver_test_buffering(cipher_t *c);
+
+
+/*
+ * functions for testing cipher cache thrash
+ */
+err_status_t
+cipher_driver_test_array_throughput(cipher_type_t *ct, 
+				    int klen, int num_cipher);
+
+void
+cipher_array_test_throughput(cipher_t *ca[], int num_cipher);
+
+uint64_t
+cipher_array_bits_per_second(cipher_t *cipher_array[], int num_cipher, 
+			     unsigned octets_in_buffer, int num_trials);
+
+err_status_t
+cipher_array_delete(cipher_t *cipher_array[], int num_cipher);
+
+err_status_t
+cipher_array_alloc_init(cipher_t ***cipher_array, int num_ciphers,
+			cipher_type_t *ctype, int klen);
+
+void
+usage(char *prog_name) {
+  printf("usage: %s [ -t | -v | -a ]\n", prog_name);
+  exit(255);
+}
+
+void
+check_status(err_status_t s) {
+  if (s) {
+    printf("error (code %d)\n", s);
+    exit(s);
+  }
+  return;
+}
+
+/*
+ * null_cipher, aes_icm, and aes_cbc are the cipher meta-objects
+ * defined in the files in crypto/cipher subdirectory.  these are
+ * declared external so that we can use these cipher types here
+ */
+
+extern cipher_type_t null_cipher;
+extern cipher_type_t aes_icm;
+extern cipher_type_t aes_cbc;
+
+int
+main(int argc, char *argv[]) {
+  cipher_t *c = NULL;
+  err_status_t status;
+  unsigned char test_key[20] = {
+    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
+    0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+    0x10, 0x11, 0x12, 0x13
+  };
+  int q;
+  unsigned do_timing_test = 0;
+  unsigned do_validation = 0;
+  unsigned do_array_timing_test = 0;
+
+  /* process input arguments */
+  while (1) {
+    q = getopt(argc, argv, "tva");
+    if (q == -1) 
+      break;
+    switch (q) {
+    case 't':
+      do_timing_test = 1;
+      break;
+    case 'v':
+      do_validation = 1;
+      break;
+    case 'a':
+      do_array_timing_test = 1;
+      break;
+    default:
+      usage(argv[0]);
+    }    
+  }
+   
+  printf("cipher test driver\n"
+	 "David A. McGrew\n"
+	 "Cisco Systems, Inc.\n");
+
+  if (!do_validation && !do_timing_test && !do_array_timing_test)
+    usage(argv[0]);
+
+   /* arry timing (cache thrash) test */
+  if (do_array_timing_test) {
+    int max_num_cipher = 1 << 16;   /* number of ciphers in cipher_array */
+    int num_cipher;
+    
+    for (num_cipher=1; num_cipher < max_num_cipher; num_cipher *=8)
+      cipher_driver_test_array_throughput(&null_cipher, 0, num_cipher); 
+
+    for (num_cipher=1; num_cipher < max_num_cipher; num_cipher *=8)
+      cipher_driver_test_array_throughput(&aes_icm, 30, num_cipher); 
+
+    for (num_cipher=1; num_cipher < max_num_cipher; num_cipher *=8)
+      cipher_driver_test_array_throughput(&aes_cbc, 16, num_cipher); 
+ 
+  }
+
+  if (do_validation) {
+    cipher_driver_self_test(&null_cipher);
+    cipher_driver_self_test(&aes_icm);
+    cipher_driver_self_test(&aes_cbc);
+  }
+
+  /* do timing and/or buffer_test on null_cipher */
+  status = cipher_type_alloc(&null_cipher, &c, 0); 
+  check_status(status);
+
+  status = cipher_init(c, NULL, direction_encrypt);
+  check_status(status);
+
+  if (do_timing_test) 
+    cipher_driver_test_throughput(c);
+  if (do_validation) {
+    status = cipher_driver_test_buffering(c);
+    check_status(status);
+  }
+  status = cipher_dealloc(c);
+  check_status(status);
+  
+
+  /* run the throughput test on the aes_icm cipher */
+    status = cipher_type_alloc(&aes_icm, &c, 30);  
+    if (status) {
+      fprintf(stderr, "error: can't allocate cipher\n");
+      exit(status);
+    }
+
+    status = cipher_init(c, test_key, direction_encrypt);
+    check_status(status);
+
+    if (do_timing_test)
+      cipher_driver_test_throughput(c);
+    
+    if (do_validation) {
+      status = cipher_driver_test_buffering(c);
+      check_status(status);
+    }
+    
+    status = cipher_dealloc(c);
+    check_status(status);
+  
+  return 0;
+}
+
+void
+cipher_driver_test_throughput(cipher_t *c) {
+  int i;
+  int min_enc_len = 32;     
+  int max_enc_len = 2048;   /* should be a power of two */
+  int num_trials = 100000;  
+  
+  printf("timing %s throughput:\n", c->type->description);
+  fflush(stdout);
+  for (i=min_enc_len; i <= max_enc_len; i = i * 2)
+    printf("msg len: %d\tgigabits per second: %f\n",
+	   i, cipher_bits_per_second(c, i, num_trials) / 1e9);
+
+}
+
+err_status_t
+cipher_driver_self_test(cipher_type_t *ct) {
+  err_status_t status;
+  
+  printf("running cipher self-test for %s...", ct->description);
+  status = cipher_type_self_test(ct);
+  if (status) {
+    printf("failed with error code %d\n", status);
+    exit(status);
+  }
+  printf("passed\n");
+  
+  return err_status_ok;
+}
+
+/*
+ * cipher_driver_test_buffering(ct) tests the cipher's output
+ * buffering for correctness by checking the consistency of succesive
+ * calls
+ */
+
+err_status_t
+cipher_driver_test_buffering(cipher_t *c) {
+  int i, j, num_trials = 1000;
+  unsigned len, buflen = 1024;
+  uint8_t buffer0[buflen], buffer1[buflen], *current, *end;
+  uint8_t idx[16] = { 
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
+    0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0x34
+  };
+  err_status_t status;
+  
+  printf("testing output buffering for cipher %s...",
+	 c->type->description);
+
+  for (i=0; i < num_trials; i++) {
+
+   /* set buffers to zero */
+    for (j=0; j < buflen; j++) 
+      buffer0[j] = buffer1[j] = 0;
+    
+    /* initialize cipher  */
+    status = cipher_set_iv(c, idx);
+    if (status)
+      return status;
+
+    /* generate 'reference' value by encrypting all at once */
+    status = cipher_encrypt(c, buffer0, &buflen);
+    if (status)
+      return status;
+
+    /* re-initialize cipher */
+    status = cipher_set_iv(c, idx);
+    if (status)
+      return status;
+    
+    /* now loop over short lengths until buffer1 is encrypted */
+    current = buffer1;
+    end = buffer1 + buflen;
+    while (current < end) {
+
+      /* choose a short length */
+      len = rand() & 0x01f;
+
+      /* make sure that len doesn't cause us to overreach the buffer */
+      if (current + len > end)
+	len = end - current;
+
+      status = cipher_encrypt(c, current, &len);
+      if (status) 
+	return status;
+      
+      /* advance pointer into buffer1 to reflect encryption */
+      current += len;
+      
+      /* if buffer1 is all encrypted, break out of loop */
+      if (current == end)
+	break;
+    }
+
+    /* compare buffers */
+    for (j=0; j < buflen; j++)
+      if (buffer0[j] != buffer1[j]) {
+#if PRINT_DEBUG
+	printf("test case %d failed at byte %d\n", i, j);
+	printf("computed: %s\n", octet_string_hex_string(buffer1, buflen));
+	printf("expected: %s\n", octet_string_hex_string(buffer0, buflen));
+#endif 
+	return err_status_algo_fail;
+      }
+  }
+  
+  printf("passed\n");
+
+  return err_status_ok;
+}
+
+
+/*
+ * The function cipher_test_throughput_array() tests the effect of CPU
+ * cache thrash on cipher throughput.  
+ *
+ * cipher_array_alloc_init(ctype, array, num_ciphers) creates an array
+ * of cipher_t of type ctype
+ */
+
+err_status_t
+cipher_array_alloc_init(cipher_t ***ca, int num_ciphers,
+			cipher_type_t *ctype, int klen) {
+  int i, j;
+  err_status_t status;
+  uint8_t *key;
+  cipher_t **cipher_array;
+
+  /* allocate array of pointers to ciphers */
+  cipher_array = (cipher_t **) malloc(sizeof(cipher_t *) * num_ciphers);
+  if (cipher_array == NULL)
+    return err_status_alloc_fail;
+
+  /* set ca to location of cipher_array */
+  *ca = cipher_array;
+
+  /* allocate key */
+  key = crypto_alloc(klen);
+  if (key == NULL) {
+    free(cipher_array);
+    return err_status_alloc_fail;
+  }
+  
+  /* allocate and initialize an array of ciphers */
+  for (i=0; i < num_ciphers; i++) {
+
+    /* allocate cipher */
+    status = cipher_type_alloc(ctype, cipher_array, klen);
+    if (status)
+      return status;
+    
+    /* generate random key and initialize cipher */
+    for (j=0; j < klen; j++)
+      key[j] = (uint8_t) rand();
+    status = cipher_init(*cipher_array, key, direction_encrypt);
+    if (status)
+      return status;
+
+/*     printf("%dth cipher is at %p\n", i, *cipher_array); */
+/*     printf("%dth cipher description: %s\n", i,  */
+/* 	   (*cipher_array)->type->description); */
+    
+    /* advance cipher array pointer */
+    cipher_array++;
+  }
+
+  return err_status_ok;
+}
+
+err_status_t
+cipher_array_delete(cipher_t *cipher_array[], int num_cipher) {
+  int i;
+  
+  for (i=0; i < num_cipher; i++) {
+    cipher_dealloc(cipher_array[i]);
+  }
+
+  free(cipher_array);
+  
+  return err_status_ok;
+}
+
+
+/*
+ * cipher_array_bits_per_second(c, l, t) computes (an estimate of) the
+ * number of bits that a cipher implementation can encrypt in a second
+ * when distinct keys are used to encrypt distinct messages
+ * 
+ * c is a cipher (which MUST be allocated an initialized already), l
+ * is the length in octets of the test data to be encrypted, and t is
+ * the number of trials
+ *
+ * if an error is encountered, the value 0 is returned
+ */
+
+uint64_t
+cipher_array_bits_per_second(cipher_t *cipher_array[], int num_cipher, 
+			      unsigned octets_in_buffer, int num_trials) {
+  int i;
+  v128_t nonce;
+  clock_t timer;
+  unsigned char *enc_buf;
+  int cipher_index = 0;
+
+
+  enc_buf = crypto_alloc(octets_in_buffer);
+  if (enc_buf == NULL)
+    return 0;  /* indicate bad parameters by returning null */
+  
+  /* time repeated trials */
+  v128_set_to_zero(&nonce);
+  timer = clock();
+  for(i=0; i < num_trials; i++, nonce.v32[3] = i) {
+
+    /* choose a cipher at random from the array*/
+    cipher_index = (*((uint32_t *)enc_buf)) % num_cipher;
+
+    /* encrypt buffer with cipher */
+    cipher_set_iv(cipher_array[cipher_index], &nonce);
+    cipher_encrypt(cipher_array[cipher_index], enc_buf, &octets_in_buffer);
+  }
+  timer = clock() - timer;
+
+  free(enc_buf);
+
+  if (timer == 0) {
+    /* Too fast! */
+    return 0;
+  }
+
+  return CLOCKS_PER_SEC * num_trials * 8 * octets_in_buffer / timer;
+}
+
+void
+cipher_array_test_throughput(cipher_t *ca[], int num_cipher) {
+  int i;
+  int min_enc_len = 16;     
+  int max_enc_len = 2048;   /* should be a power of two */
+  int num_trials = 10000;
+
+  printf("timing %s throughput with array size %d:\n", 
+	 (ca[0])->type->description, num_cipher);
+  fflush(stdout);
+  for (i=min_enc_len; i <= max_enc_len; i = i * 4)
+    printf("msg len: %d\tgigabits per second: %f\n", i,
+	   cipher_array_bits_per_second(ca, num_cipher, i, num_trials) / 1e9);
+
+}
+
+err_status_t
+cipher_driver_test_array_throughput(cipher_type_t *ct, 
+				    int klen, int num_cipher) {
+  cipher_t **ca = NULL;
+  err_status_t status;
+
+  status = cipher_array_alloc_init(&ca, num_cipher, ct, klen);
+  if (status) {
+    printf("error: cipher_array_alloc_init() failed with error code %d\n",
+	   status);
+    return status;
+  }
+  
+  cipher_array_test_throughput(ca, num_cipher);
+  
+  cipher_array_delete(ca, num_cipher);    
+ 
+  return err_status_ok;
+}
diff --git a/jni/pjproject-android/.svn/pristine/c1/c13a40b05165f72c0892a340d5fa86e2098a5101.svn-base b/jni/pjproject-android/.svn/pristine/c1/c13a40b05165f72c0892a340d5fa86e2098a5101.svn-base
new file mode 100644
index 0000000..739d88a
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c13a40b05165f72c0892a340d5fa86e2098a5101.svn-base
@@ -0,0 +1,224 @@
+//
+//  ipjsuaAppDelegate.m
+//  ipjsua
+//
+//  Created by Liong Sauw Ming on 13/3/13.
+//  Copyright (c) 2013 Teluu. All rights reserved.
+//
+
+#import "ipjsuaAppDelegate.h"
+#import <pjlib.h>
+#import <pjsua.h>
+#import <pj/log.h>
+
+#include "../../pjsua_app.h"
+#include "../../pjsua_app_config.h"
+
+#import "ipjsuaViewController.h"
+
+@implementation ipjsuaAppDelegate
+
+#define THIS_FILE	"ipjsuaAppDelegate.m"
+
+#define KEEP_ALIVE_INTERVAL 600
+
+ipjsuaAppDelegate      *app;
+static pjsua_app_cfg_t  app_cfg;
+static bool             isShuttingDown;
+static char           **restartArgv;
+static int              restartArgc;
+static pj_thread_desc   a_thread_desc;
+static pj_thread_t     *a_thread;
+
+static void displayMsg(const char *msg)
+{
+    NSString *str = [NSString stringWithFormat:@"%s", msg];
+    [app performSelectorOnMainThread:@selector(displayMsg:) withObject:str
+                       waitUntilDone:NO];
+}
+
+static void pjsuaOnStartedCb(pj_status_t status, const char* msg)
+{
+    char errmsg[PJ_ERR_MSG_SIZE];
+    
+    if (status != PJ_SUCCESS && (!msg || !*msg)) {
+	pj_strerror(status, errmsg, sizeof(errmsg));
+	PJ_LOG(3,(THIS_FILE, "Error: %s", errmsg));
+	msg = errmsg;
+    } else {
+	PJ_LOG(3,(THIS_FILE, "Started: %s", msg));
+    }
+
+    displayMsg(msg);
+}
+
+static void pjsuaOnStoppedCb(pj_bool_t restart,
+                             int argc, char** argv)
+{
+    PJ_LOG(3,("ipjsua", "CLI %s request", (restart? "restart" : "shutdown")));
+    if (restart) {
+        displayMsg("Restarting..");
+	pj_thread_sleep(100);
+        app_cfg.argc = argc;
+        app_cfg.argv = argv;
+    } else {
+        displayMsg("Shutting down..");
+	pj_thread_sleep(100);
+        isShuttingDown = true;
+    }
+}
+
+static void pjsuaOnAppConfigCb(pjsua_app_config *cfg)
+{
+    PJ_UNUSED_ARG(cfg);
+}
+
+- (void)displayMsg:(NSString *)str
+{
+    app.viewController.textLabel.text = str;
+}
+
+- (void)pjsuaStart
+{
+    // TODO: read from config?
+    const char **argv = pjsua_app_def_argv;
+    int argc = PJ_ARRAY_SIZE(pjsua_app_def_argv) -1;
+    pj_status_t status;
+    
+    isShuttingDown = false;
+    displayMsg("Starting..");
+    
+    pj_bzero(&app_cfg, sizeof(app_cfg));
+    if (restartArgc) {
+	app_cfg.argc = restartArgc;
+	app_cfg.argv = restartArgv;
+    } else {
+	app_cfg.argc = argc;
+	app_cfg.argv = (char**)argv;
+    }
+    app_cfg.on_started = &pjsuaOnStartedCb;
+    app_cfg.on_stopped = &pjsuaOnStoppedCb;
+    app_cfg.on_config_init = &pjsuaOnAppConfigCb;
+    
+    while (!isShuttingDown) {
+        status = pjsua_app_init(&app_cfg);
+        if (status != PJ_SUCCESS) {
+            char errmsg[PJ_ERR_MSG_SIZE];
+            pj_strerror(status, errmsg, sizeof(errmsg));
+            displayMsg(errmsg);
+            pjsua_app_destroy();
+            return;
+        }
+    
+        status = pjsua_app_run(PJ_TRUE);
+        if (status != PJ_SUCCESS) {
+            char errmsg[PJ_ERR_MSG_SIZE];
+            pj_strerror(status, errmsg, sizeof(errmsg));
+            displayMsg(errmsg);
+        }
+    
+        pjsua_app_destroy();
+    }
+    
+    restartArgv = NULL;
+    restartArgc = 0;
+}
+
+- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
+{
+    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
+    // Override point for customization after application launch.
+    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
+        self.viewController = [[ipjsuaViewController alloc] initWithNibName:@"ipjsuaViewController_iPhone" bundle:nil];
+    } else {
+        self.viewController = [[ipjsuaViewController alloc] initWithNibName:@"ipjsuaViewController_iPad" bundle:nil];
+    }
+    self.window.rootViewController = self.viewController;
+    [self.window makeKeyAndVisible];
+    
+    app = self;
+    
+    /* Start pjsua app thread */
+    [NSThread detachNewThreadSelector:@selector(pjsuaStart) toTarget:self withObject:nil];
+
+    return YES;
+}
+
+- (void)applicationWillResignActive:(UIApplication *)application
+{
+    // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
+    // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
+}
+
+- (void)keepAlive {
+    int i, timeout = KEEP_ALIVE_INTERVAL;
+    
+    if (!pj_thread_is_registered())
+    {
+	pj_thread_register("ipjsua", a_thread_desc, &a_thread);
+    }
+    
+    for (i = 0; i < (int)pjsua_acc_get_count(); ++i) {
+        if (pjsua_acc_is_valid(i)) {
+            pjsua_acc_config acc_cfg;
+
+	    pjsua_acc_get_config(i, &acc_cfg);
+            if (!acc_cfg.reg_uri.slen)
+                continue;
+            if (acc_cfg.reg_timeout < timeout) {
+                acc_cfg.reg_timeout = timeout;
+                pjsua_acc_modify(i, &acc_cfg);
+            } else {
+                pjsua_acc_set_registration(i, PJ_TRUE);
+            }
+        }
+    }
+}
+
+- (void)applicationDidEnterBackground:(UIApplication *)application
+{
+    // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 
+    // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
+    [self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
+    [application setKeepAliveTimeout:KEEP_ALIVE_INTERVAL handler: ^{
+	[self performSelectorOnMainThread:@selector(keepAlive) withObject:nil waitUntilDone:YES];
+    }];
+}
+
+- (void)applicationWillEnterForeground:(UIApplication *)application
+{
+    // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
+}
+
+- (void)applicationDidBecomeActive:(UIApplication *)application
+{
+    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
+}
+
+- (void)applicationWillTerminate:(UIApplication *)application
+{
+    // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
+}
+
+
+pj_bool_t showNotification(pjsua_call_id call_id)
+{
+    // Create a new notification
+    UILocalNotification* alert = [[UILocalNotification alloc] init];
+    if (alert)
+    {
+	alert.repeatInterval = 0;
+	alert.alertBody = @"Incoming call received...";
+        /* This action just brings the app to the FG, it doesn't
+         * automatically answer the call (unless you specify the
+         * --auto-answer option).
+         */
+	alert.alertAction = @"Activate app";
+	
+	[[UIApplication sharedApplication] presentLocalNotificationNow:alert];
+    }
+    
+    return PJ_FALSE;
+}
+
+@end
diff --git a/jni/pjproject-android/.svn/pristine/c1/c13bcb5aeae17cabd424e21ee0045abb232d0c2b.svn-base b/jni/pjproject-android/.svn/pristine/c1/c13bcb5aeae17cabd424e21ee0045abb232d0c2b.svn-base
new file mode 100644
index 0000000..5ca0a69
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c13bcb5aeae17cabd424e21ee0045abb232d0c2b.svn-base
@@ -0,0 +1,298 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioProject

+	ProjectType="Visual C++"

+	Version="7.10"

+	Name="libSRTP"

+	ProjectGUID="{7E1E1308-F82E-4DD3-B25C-CD12756A1DD9}"

+	Keyword="Win32Proj">

+	<Platforms>

+		<Platform

+			Name="Win32"/>

+	</Platforms>

+	<Configurations>

+		<Configuration

+			Name="Debug|Win32"

+			OutputDirectory="Debug"

+			IntermediateDirectory="Debug"

+			ConfigurationType="1"

+			CharacterSet="2">

+			<Tool

+				Name="VCCLCompilerTool"

+				Optimization="0"

+				InlineFunctionExpansion="0"

+				AdditionalIncludeDirectories="C:\dev\foo\srtp;&quot;$(SolutionDir)&quot;;.\include;.\crypto\include;&quot;..\..\OpenSSL\openssl-0.9.7i\inc32&quot;;&quot;C:Library\OpenSSL\openssl-0.9.8\inc32&quot;"

+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;DEBUG"

+				ExceptionHandling="FALSE"

+				BasicRuntimeChecks="0"

+				RuntimeLibrary="1"

+				UsePrecompiledHeader="0"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="TRUE"

+				DebugInformationFormat="4"

+				CompileAs="1"/>

+			<Tool

+				Name="VCCustomBuildTool"/>

+			<Tool

+				Name="VCLinkerTool"

+				AdditionalDependencies="Ws2_32.lib libeay32.lib ssleay32.lib"

+				AdditionalLibraryDirectories="&quot;Library\OpenSSL\openssl-0.9.8\libs&quot;"

+				GenerateDebugInformation="TRUE"/>

+			<Tool

+				Name="VCMIDLTool"/>

+			<Tool

+				Name="VCPostBuildEventTool"/>

+			<Tool

+				Name="VCPreBuildEventTool"/>

+			<Tool

+				Name="VCPreLinkEventTool"/>

+			<Tool

+				Name="VCResourceCompilerTool"/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"/>

+			<Tool

+				Name="VCWebDeploymentTool"/>

+			<Tool

+				Name="VCManagedWrapperGeneratorTool"/>

+			<Tool

+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

+		</Configuration>

+		<Configuration

+			Name="Release|Win32"

+			OutputDirectory="Release"

+			IntermediateDirectory="Release"

+			ConfigurationType="4"

+			CharacterSet="2">

+			<Tool

+				Name="VCCLCompilerTool"

+				AdditionalIncludeDirectories="&quot;.\include&quot;;&quot;.\crypto\include&quot;;&quot;..\..\OpenSSL\openssl-0.9.7i\inc32&quot;"

+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"

+				BasicRuntimeChecks="0"

+				RuntimeLibrary="0"

+				UsePrecompiledHeader="0"

+				ObjectFile="$(IntDir)/"

+				WarningLevel="3"

+				Detect64BitPortabilityProblems="TRUE"

+				DebugInformationFormat="3"/>

+			<Tool

+				Name="VCCustomBuildTool"/>

+			<Tool

+				Name="VCLibrarianTool"/>

+			<Tool

+				Name="VCMIDLTool"/>

+			<Tool

+				Name="VCPostBuildEventTool"/>

+			<Tool

+				Name="VCPreBuildEventTool"/>

+			<Tool

+				Name="VCPreLinkEventTool"/>

+			<Tool

+				Name="VCResourceCompilerTool"/>

+			<Tool

+				Name="VCWebServiceProxyGeneratorTool"/>

+			<Tool

+				Name="VCXMLDataGeneratorTool"/>

+			<Tool

+				Name="VCManagedWrapperGeneratorTool"/>

+			<Tool

+				Name="VCAuxiliaryManagedWrapperGeneratorTool"/>

+		</Configuration>

+	</Configurations>

+	<References>

+	</References>

+	<Files>

+		<Filter

+			Name="Source Files"

+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"

+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">

+			<File

+				RelativePath=".\test\getopt.c">

+			</File>

+			<File

+				RelativePath=".\srtp\srtp.c">

+			</File>

+			<File

+				RelativePath=".\test\srtp_driver.c">

+			</File>

+			<Filter

+				Name="Kernel">

+				<File

+					RelativePath=".\crypto\kernel\alloc.c">

+				</File>

+				<File

+					RelativePath=".\crypto\kernel\crypto_kernel.c">

+				</File>

+				<File

+					RelativePath=".\crypto\rng\ctr_prng.c">

+				</File>

+				<File

+					RelativePath=".\crypto\kernel\err.c">

+				</File>

+				<File

+					RelativePath=".\crypto\kernel\key.c">

+				</File>

+				<File

+					RelativePath=".\crypto\rng\prng.c">

+				</File>

+				<File

+					RelativePath=".\crypto\rng\rand_source.c">

+				</File>

+			</Filter>

+			<Filter

+				Name="Ciphers">

+				<File

+					RelativePath=".\crypto\cipher\aes.c">

+				</File>

+				<File

+					RelativePath=".\crypto\cipher\aes_cbc.c">

+				</File>

+				<File

+					RelativePath=".\crypto\cipher\aes_icm.c">

+				</File>

+				<File

+					RelativePath=".\crypto\cipher\cipher.c">

+				</File>

+				<File

+					RelativePath=".\crypto\cipher\null_cipher.c">

+				</File>

+			</Filter>

+			<Filter

+				Name="Hashes">

+				<File

+					RelativePath=".\crypto\hash\auth.c">

+				</File>

+				<File

+					RelativePath=".\crypto\hash\hmac.c">

+				</File>

+				<File

+					RelativePath=".\crypto\hash\null_auth.c">

+				</File>

+				<File

+					RelativePath=".\crypto\hash\sha1.c">

+				</File>

+			</Filter>

+			<Filter

+				Name="Replay">

+				<File

+					RelativePath=".\crypto\replay\rdb.c">

+				</File>

+				<File

+					RelativePath=".\crypto\replay\rdbx.c">

+				</File>

+				<File

+					RelativePath=".\crypto\replay\ut_sim.c">

+				</File>

+			</Filter>

+			<Filter

+				Name="Math">

+				<File

+					RelativePath=".\crypto\math\datatypes.c">

+				</File>

+				<File

+					RelativePath=".\crypto\math\stat.c">

+				</File>

+			</Filter>

+		</Filter>

+		<Filter

+			Name="Header Files"

+			Filter="h;hpp;hxx;hm;inl;inc;xsd"

+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">

+			<File

+				RelativePath=".\crypto\include\aes.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\aes_cbc.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\aes_icm.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\alloc.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\auth.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\cipher.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\config.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\crypto.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\crypto_kernel.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\crypto_math.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\crypto_types.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\cryptoalg.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\datatypes.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\err.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\gf2_8.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\hmac.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\integers.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\kernel_compat.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\key.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\null_auth.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\null_cipher.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\prng.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\rand_source.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\rdb.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\rdbx.h">

+			</File>

+			<File

+				RelativePath=".\include\rtp.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\sha1.h">

+			</File>

+			<File

+				RelativePath=".\include\srtp.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\stat.h">

+			</File>

+			<File

+				RelativePath=".\include\ut_sim.h">

+			</File>

+			<File

+				RelativePath=".\crypto\include\xfm.h">

+			</File>

+		</Filter>

+	</Files>

+	<Globals>

+	</Globals>

+</VisualStudioProject>

diff --git a/jni/pjproject-android/.svn/pristine/c1/c14e7ad78a9da16c1df3ae46751097a29142a8c9.svn-base b/jni/pjproject-android/.svn/pristine/c1/c14e7ad78a9da16c1df3ae46751097a29142a8c9.svn-base
new file mode 100644
index 0000000..58e42a1
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c14e7ad78a9da16c1df3ae46751097a29142a8c9.svn-base
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="Windows-1252"?>

+<VisualStudioPropertySheet

+	ProjectType="Visual C++"

+	Version="8.00"

+	Name="pjproject-vs8-win32-common-defaults"

+	>

+	<Tool

+		Name="VCCLCompilerTool"

+		PreprocessorDefinitions="WIN32;PJ_WIN32=1;PJ_M_I386=1;"

+	/>

+	<Tool

+		Name="VCLinkerTool"

+		SubSystem="1"

+		TargetMachine="1"

+	/>

+	<UserMacro

+		Name="TargetCPU"

+		Value="i386"

+	/>

+</VisualStudioPropertySheet>

diff --git a/jni/pjproject-android/.svn/pristine/c1/c16f52e2b7919c311b4fa2a89323cef5762296f8.svn-base b/jni/pjproject-android/.svn/pristine/c1/c16f52e2b7919c311b4fa2a89323cef5762296f8.svn-base
new file mode 100644
index 0000000..bc56567
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c16f52e2b7919c311b4fa2a89323cef5762296f8.svn-base
@@ -0,0 +1,21 @@
+export CC = @CC@ -c
+export CXX = @CXX@ -c
+export AR = @AR@
+export LD = @LD@
+export LDOUT = -o 
+export RANLIB = @RANLIB@
+
+export OBJEXT := .@OBJEXT@
+export LIBEXT := .@LIBEXT@
+export LIBEXT2 := @LIBEXT2@
+
+export CC_OUT := @CC_OUT@
+export CC_INC := @CC_INC@
+export CC_DEF := @CC_DEF@
+export CC_OPTIMIZE := @CC_OPTIMIZE@
+export CC_LIB := -l
+
+export CC_SOURCES :=
+export CC_CFLAGS := @CC_CFLAGS@
+export CC_LDFLAGS :=
+
diff --git a/jni/pjproject-android/.svn/pristine/c1/c179ef8600f05ede1ad8edeff32d7e379aa71077.svn-base b/jni/pjproject-android/.svn/pristine/c1/c179ef8600f05ede1ad8edeff32d7e379aa71077.svn-base
new file mode 100644
index 0000000..3bee66b
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c179ef8600f05ede1ad8edeff32d7e379aa71077.svn-base
@@ -0,0 +1,10 @@
+#ifdef APSTUDIO_INVOKED

+	#error this file is not editable by Microsoft Visual C++

+#endif //APSTUDIO_INVOKED

+

+

+/////////////////////////////////////////////////////////////////////////////

+// Add manually edited resources here...

+

+

+/////////////////////////////////////////////////////////////////////////////

diff --git a/jni/pjproject-android/.svn/pristine/c1/c1ad885a2d985270fd6a7e2562659fb276a26373.svn-base b/jni/pjproject-android/.svn/pristine/c1/c1ad885a2d985270fd6a7e2562659fb276a26373.svn-base
new file mode 100644
index 0000000..b4af09c
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c1ad885a2d985270fd6a7e2562659fb276a26373.svn-base
@@ -0,0 +1,57 @@
+/* $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 
+ */
+#ifndef __PJ_COMPAT_CC_ARMCC_H__
+#define __PJ_COMPAT_CC_ARMCC_H__
+
+/**
+ * @file cc_armcc.h
+ * @brief Describes ARMCC compiler specifics.
+ */
+
+#ifndef __ARMCC__
+#  error "This file is only for armcc!"
+#endif
+
+#define PJ_CC_NAME		"armcc"
+#define PJ_CC_VER_1             (__ARMCC_VERSION/100000)
+#define PJ_CC_VER_2             ((__ARMCC_VERSION%100000)/10000)
+#define PJ_CC_VER_3             (__ARMCC_VERSION%10000)
+
+#ifdef __cplusplus
+#  define PJ_INLINE_SPECIFIER	inline
+#else
+#  define PJ_INLINE_SPECIFIER	static __inline
+#endif
+
+#define PJ_THREAD_FUNC	
+#define PJ_NORETURN		
+#define PJ_ATTR_NORETURN	__attribute__ ((noreturn))
+
+#define PJ_HAS_INT64		1
+
+typedef long long pj_int64_t;
+typedef unsigned long long pj_uint64_t;
+
+#define PJ_INT64_FMT		"L"
+
+#define PJ_UNREACHED(x)	    	
+
+#endif	/* __PJ_COMPAT_CC_ARMCC_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/c1/c1d8912999d93371d68e81e13ab414d3f8197a39.svn-base b/jni/pjproject-android/.svn/pristine/c1/c1d8912999d93371d68e81e13ab414d3f8197a39.svn-base
new file mode 100644
index 0000000..806733f
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c1d8912999d93371d68e81e13ab414d3f8197a39.svn-base
@@ -0,0 +1,211 @@
+/* $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 <pjsip/sip_errno.h>
+#include <pjsip/sip_msg.h>
+#include <pj/string.h>
+#include <pj/errno.h>
+
+/* PJSIP's own error codes/messages 
+ * MUST KEEP THIS ARRAY SORTED!!
+ */
+
+#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING != 0)
+
+static const struct 
+{
+    int code;
+    const char *msg;
+} err_str[] = 
+{
+    /* Generic SIP errors */
+    PJ_BUILD_ERR( PJSIP_EBUSY,		"Object is busy" ),
+    PJ_BUILD_ERR( PJSIP_ETYPEEXISTS ,	"Object with the same type exists" ),
+    PJ_BUILD_ERR( PJSIP_ESHUTDOWN,	"SIP stack shutting down" ),
+    PJ_BUILD_ERR( PJSIP_ENOTINITIALIZED,"SIP object is not initialized." ),
+    PJ_BUILD_ERR( PJSIP_ENOROUTESET,	"Missing route set (for tel: URI)" ),
+
+    /* Messaging errors */
+    PJ_BUILD_ERR( PJSIP_EINVALIDMSG,	"Invalid message/syntax error" ),
+    PJ_BUILD_ERR( PJSIP_ENOTREQUESTMSG,	"Expecting request message"),
+    PJ_BUILD_ERR( PJSIP_ENOTRESPONSEMSG,"Expecting response message"),
+    PJ_BUILD_ERR( PJSIP_EMSGTOOLONG,	"Message too long" ),
+    PJ_BUILD_ERR( PJSIP_EPARTIALMSG,	"Partial message" ),
+
+    PJ_BUILD_ERR( PJSIP_EINVALIDSTATUS,	"Invalid/unexpected SIP status code"),
+
+    PJ_BUILD_ERR( PJSIP_EINVALIDURI,	"Invalid URI" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDSCHEME,	"Invalid URI scheme" ),
+    PJ_BUILD_ERR( PJSIP_EMISSINGREQURI,	"Missing Request-URI" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDREQURI,	"Invalid Request URI" ),
+    PJ_BUILD_ERR( PJSIP_EURITOOLONG,	"URI is too long" ), 
+
+    PJ_BUILD_ERR( PJSIP_EMISSINGHDR,	"Missing required header(s)" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDHDR,	"Invalid header field"),
+    PJ_BUILD_ERR( PJSIP_EINVALIDVIA,	"Invalid Via header" ),
+    PJ_BUILD_ERR( PJSIP_EMULTIPLEVIA,	"Multiple Via headers in response" ),
+
+    PJ_BUILD_ERR( PJSIP_EMISSINGBODY,	"Missing message body" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDMETHOD,	"Invalid/unexpected method" ),
+
+    /* Transport errors */
+    PJ_BUILD_ERR( PJSIP_EUNSUPTRANSPORT,"Unsupported transport"),
+    PJ_BUILD_ERR( PJSIP_EPENDINGTX,	"Transmit buffer already pending"),
+    PJ_BUILD_ERR( PJSIP_ERXOVERFLOW,	"Rx buffer overflow"),
+    PJ_BUILD_ERR( PJSIP_EBUFDESTROYED,	"Buffer destroyed"),
+    PJ_BUILD_ERR( PJSIP_ETPNOTSUITABLE,	"Unsuitable transport selected"),
+    PJ_BUILD_ERR( PJSIP_ETPNOTAVAIL,	"Transport not available for use"),
+
+    /* Transaction errors */
+    PJ_BUILD_ERR( PJSIP_ETSXDESTROYED,	"Transaction has been destroyed"),
+    PJ_BUILD_ERR( PJSIP_ENOTSX,		"No transaction is associated with the object "
+					"(expecting stateful processing)" ),
+
+    /* URI comparison status */
+    PJ_BUILD_ERR( PJSIP_ECMPSCHEME,	"URI scheme mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPUSER,	"URI user part mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPPASSWD,	"URI password part mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPHOST,	"URI host part mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPPORT,	"URI port mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPTRANSPORTPRM,"URI transport param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPTTLPARAM,	"URI ttl param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPUSERPARAM,	"URI user param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPMETHODPARAM,"URI method param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPMADDRPARAM,	"URI maddr param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPOTHERPARAM,	"URI other param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPHEADERPARAM,"URI header parameter mismatch" ),
+
+    /* Authentication. */
+    PJ_BUILD_ERR( PJSIP_EFAILEDCREDENTIAL, "Credential failed to authenticate"),
+    PJ_BUILD_ERR( PJSIP_ENOCREDENTIAL,	   "No suitable credential"),
+    PJ_BUILD_ERR( PJSIP_EINVALIDALGORITHM, "Invalid/unsupported digest algorithm" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDQOP,	   "Invalid/unsupported digest qop" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDAUTHSCHEME,"Unsupported authentication scheme" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHNOPREVCHAL,   "No previous challenge" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHNOAUTH,	   "No suitable authorization header" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHACCNOTFOUND,  "Account or credential not found" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHACCDISABLED,  "Account or credential is disabled" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHINVALIDREALM, "Invalid authorization realm"),
+    PJ_BUILD_ERR( PJSIP_EAUTHINVALIDDIGEST,"Invalid authorization digest" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHSTALECOUNT,   "Maximum number of stale retries exceeded"),
+    PJ_BUILD_ERR( PJSIP_EAUTHINNONCE,	   "Invalid nonce value in authentication challenge"),
+    PJ_BUILD_ERR( PJSIP_EAUTHINAKACRED,	   "Invalid AKA credential"),
+    PJ_BUILD_ERR( PJSIP_EAUTHNOCHAL,	   "No challenge is found"),
+
+    /* UA/dialog layer. */
+    PJ_BUILD_ERR( PJSIP_EMISSINGTAG,	"Missing From/To tag parameter" ),
+    PJ_BUILD_ERR( PJSIP_ENOTREFER,	"Expecting REFER request") ,
+    PJ_BUILD_ERR( PJSIP_ENOREFERSESSION,"Not associated with REFER subscription"),
+
+    /* Invite session. */
+    PJ_BUILD_ERR( PJSIP_ESESSIONTERMINATED, "INVITE session already terminated" ),
+    PJ_BUILD_ERR( PJSIP_ESESSIONSTATE,      "Invalid INVITE session state" ),
+    PJ_BUILD_ERR( PJSIP_ESESSIONINSECURE,   "Require secure session/transport"),
+
+    /* SSL errors */
+    PJ_BUILD_ERR( PJSIP_TLS_EUNKNOWN,	"Unknown TLS error" ),
+    PJ_BUILD_ERR( PJSIP_TLS_EINVMETHOD,	"Invalid SSL protocol method" ),
+    PJ_BUILD_ERR( PJSIP_TLS_ECACERT,	"Error loading/verifying SSL CA list file"),
+    PJ_BUILD_ERR( PJSIP_TLS_ECERTFILE,	"Error loading SSL certificate chain file"),
+    PJ_BUILD_ERR( PJSIP_TLS_EKEYFILE,	"Error adding private key from SSL certificate file"),
+    PJ_BUILD_ERR( PJSIP_TLS_ECIPHER,	"Error setting SSL cipher list"),
+    PJ_BUILD_ERR( PJSIP_TLS_ECTX,	"Error creating SSL context"),
+    PJ_BUILD_ERR( PJSIP_TLS_ESSLCONN,	"Error creating SSL connection object"),
+    PJ_BUILD_ERR( PJSIP_TLS_ECONNECT,	"Unknown error when performing SSL connect()"),
+    PJ_BUILD_ERR( PJSIP_TLS_EACCEPT,	"Unknown error when performing SSL accept()"),
+    PJ_BUILD_ERR( PJSIP_TLS_ESEND,	"Unknown error when sending SSL data"),
+    PJ_BUILD_ERR( PJSIP_TLS_EREAD,	"Unknown error when reading SSL data"),
+    PJ_BUILD_ERR( PJSIP_TLS_ETIMEDOUT,	"SSL negotiation has timed out"),
+    PJ_BUILD_ERR( PJSIP_TLS_ECERTVERIF,	"SSL certificate verification error"),
+};
+
+
+#endif	/* PJ_HAS_ERROR_STRING */
+
+
+/*
+ * pjsip_strerror()
+ */
+PJ_DEF(pj_str_t) pjsip_strerror( pj_status_t statcode, 
+				 char *buf, pj_size_t bufsize )
+{
+    pj_str_t errstr;
+
+#if defined(PJ_HAS_ERROR_STRING) && (PJ_HAS_ERROR_STRING != 0)
+
+    if (statcode >= PJSIP_ERRNO_START && statcode < PJSIP_ERRNO_START+800) 
+    {
+	/* Status code. */
+	const pj_str_t *status_text = 
+	    pjsip_get_status_text(PJSIP_ERRNO_TO_SIP_STATUS(statcode));
+
+	errstr.ptr = buf;
+	pj_strncpy_with_null(&errstr, status_text, bufsize);
+	return errstr;
+    }
+    else if (statcode >= PJSIP_ERRNO_START_PJSIP && 
+	     statcode < PJSIP_ERRNO_START_PJSIP + 1000)
+    {
+	/* Find the error in the table.
+	 * Use binary search!
+	 */
+	int first = 0;
+	int n = PJ_ARRAY_SIZE(err_str);
+
+	while (n > 0) {
+	    int half = n/2;
+	    int mid = first + half;
+
+	    if (err_str[mid].code < statcode) {
+		first = mid+1;
+		n -= (half+1);
+	    } else if (err_str[mid].code > statcode) {
+		n = half;
+	    } else {
+		first = mid;
+		break;
+	    }
+	}
+
+
+	if (PJ_ARRAY_SIZE(err_str) && err_str[first].code == statcode) {
+	    pj_str_t msg;
+	    
+	    msg.ptr = (char*)err_str[first].msg;
+	    msg.slen = pj_ansi_strlen(err_str[first].msg);
+
+	    errstr.ptr = buf;
+	    pj_strncpy_with_null(&errstr, &msg, bufsize);
+	    return errstr;
+
+	} 
+    }
+
+#endif	/* PJ_HAS_ERROR_STRING */
+
+    /* Error not found. */
+    errstr.ptr = buf;
+    errstr.slen = pj_ansi_snprintf(buf, bufsize, 
+				   "Unknown pjsip error %d",
+				   statcode);
+
+    return errstr;
+
+}
+
diff --git a/jni/pjproject-android/.svn/pristine/c1/c1e9991e8c0df14404a311f2178d6305558bb236.svn-base b/jni/pjproject-android/.svn/pristine/c1/c1e9991e8c0df14404a311f2178d6305558bb236.svn-base
new file mode 100644
index 0000000..62927ca
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c1/c1e9991e8c0df14404a311f2178d6305558bb236.svn-base
@@ -0,0 +1,118 @@
+/* $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
+ */
+#ifndef __PJSIP_SIMPLE_ERRNO_H__
+#define __PJSIP_SIMPLE_ERRNO_H__
+
+#include <pjsip/sip_errno.h>
+
+PJ_BEGIN_DECL
+
+/**
+ * Start of error code relative to PJ_ERRNO_START_USER.
+ */
+#define PJSIP_SIMPLE_ERRNO_START  (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE*2)
+
+
+/************************************************************
+ * EVENT PACKAGE ERRORS
+ ***********************************************************/
+/**
+ * @hideinitializer
+ * No event package with the specified name.
+ */
+#define PJSIP_SIMPLE_ENOPKG	    (PJSIP_SIMPLE_ERRNO_START+1)    /*270001*/
+/**
+ * @hideinitializer
+ * Event package already exists.
+ */
+#define PJSIP_SIMPLE_EPKGEXISTS	    (PJSIP_SIMPLE_ERRNO_START+2)    /*270002*/
+
+
+/************************************************************
+ * PRESENCE ERROR
+ ***********************************************************/
+/**
+ * @hideinitializer
+ * Expecting SUBSCRIBE request
+ */
+#define PJSIP_SIMPLE_ENOTSUBSCRIBE  (PJSIP_SIMPLE_ERRNO_START+20)   /*270020*/
+/**
+ * @hideinitializer
+ * No presence associated with subscription
+ */
+#define PJSIP_SIMPLE_ENOPRESENCE    (PJSIP_SIMPLE_ERRNO_START+21)   /*270021*/
+/**
+ * @hideinitializer
+ * No presence info in server subscription
+ */
+#define PJSIP_SIMPLE_ENOPRESENCEINFO (PJSIP_SIMPLE_ERRNO_START+22)  /*270022*/
+/**
+ * @hideinitializer
+ * Bad Content-Type
+ */
+#define PJSIP_SIMPLE_EBADCONTENT    (PJSIP_SIMPLE_ERRNO_START+23)   /*270023*/
+/**
+ * @hideinitializer
+ * Bad PIDF Message
+ */
+#define PJSIP_SIMPLE_EBADPIDF	    (PJSIP_SIMPLE_ERRNO_START+24)   /*270024*/
+/**
+ * @hideinitializer
+ * Bad XPIDF Message
+ */
+#define PJSIP_SIMPLE_EBADXPIDF	    (PJSIP_SIMPLE_ERRNO_START+25)   /*270025*/
+/**
+ * @hideinitializer
+ * Bad RPID Message
+ */
+#define PJSIP_SIMPLE_EBADRPID	    (PJSIP_SIMPLE_ERRNO_START+26)   /*270026*/
+
+
+/************************************************************
+ * ISCOMPOSING ERRORS
+ ***********************************************************/
+/**
+ * @hideinitializer
+ * Bad isComposing XML message.
+ */
+#define PJSIP_SIMPLE_EBADISCOMPOSE  (PJSIP_SIMPLE_ERRNO_START+40)   /*270040*/
+
+/**
+ * Get error message for the specified error code. Note that this
+ * function is only able to decode PJSIP-SIMPLE specific error code.
+ * Application should use pj_strerror(), which should be able to
+ * decode all error codes belonging to all subsystems (e.g. pjlib,
+ * pjmedia, pjsip, etc).
+ *
+ * @param status    The error code.
+ * @param buffer    The buffer where to put the error message.
+ * @param bufsize   Size of the buffer.
+ *
+ * @return	    The error message as NULL terminated string,
+ *                  wrapped with pj_str_t.
+ */
+PJ_DECL(pj_str_t) pjsipsimple_strerror(pj_status_t status, 
+				       char *buffer, pj_size_t bufsize);
+
+
+PJ_END_DECL
+
+#endif	/* __PJSIP_SIMPLE_ERRNO_H__ */
+