* #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/4b/4b0dcac7b27dbd11702aaa419a3114215a28155b.svn-base b/jni/pjproject-android/.svn/pristine/4b/4b0dcac7b27dbd11702aaa419a3114215a28155b.svn-base
new file mode 100644
index 0000000..911efbc
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4b0dcac7b27dbd11702aaa419a3114215a28155b.svn-base
@@ -0,0 +1,122 @@
+EXPORTS
+ pjsua_acc_add @ 1 NONAME
+ pjsua_acc_add_local @ 2 NONAME
+ pjsua_acc_config_default @ 3 NONAME
+ pjsua_acc_config_dup @ 4 NONAME
+ pjsua_acc_create_request @ 5 NONAME
+ pjsua_acc_create_uac_contact @ 6 NONAME
+ pjsua_acc_create_uas_contact @ 7 NONAME
+ pjsua_acc_del @ 8 NONAME
+ pjsua_acc_enum_info @ 9 NONAME
+ pjsua_acc_find_for_incoming @ 10 NONAME
+ pjsua_acc_find_for_outgoing @ 11 NONAME
+ pjsua_acc_get_count @ 12 NONAME
+ pjsua_acc_get_default @ 13 NONAME
+ pjsua_acc_get_info @ 14 NONAME
+ pjsua_acc_is_valid @ 15 NONAME
+ pjsua_acc_modify @ 16 NONAME
+ pjsua_acc_set_default @ 17 NONAME
+ pjsua_acc_set_online_status @ 18 NONAME
+ pjsua_acc_set_online_status2 @ 19 NONAME
+ pjsua_acc_set_registration @ 20 NONAME
+ pjsua_acc_set_transport @ 21 NONAME
+ pjsua_buddy_add @ 22 NONAME
+ pjsua_buddy_config_default @ 23 NONAME
+ pjsua_buddy_del @ 24 NONAME
+ pjsua_buddy_get_info @ 25 NONAME
+ pjsua_buddy_is_valid @ 26 NONAME
+ pjsua_buddy_subscribe_pres @ 27 NONAME
+ pjsua_buddy_update_pres @ 28 NONAME
+ pjsua_call_answer @ 29 NONAME
+ pjsua_call_dial_dtmf @ 30 NONAME
+ pjsua_call_dump @ 31 NONAME
+ pjsua_call_get_conf_port @ 32 NONAME
+ pjsua_call_get_count @ 33 NONAME
+ pjsua_call_get_info @ 34 NONAME
+ pjsua_call_get_max_count @ 35 NONAME
+ pjsua_call_get_rem_nat_type @ 36 NONAME
+ pjsua_call_get_user_data @ 37 NONAME
+ pjsua_call_hangup @ 38 NONAME
+ pjsua_call_hangup_all @ 39 NONAME
+ pjsua_call_has_media @ 40 NONAME
+ pjsua_call_is_active @ 41 NONAME
+ pjsua_call_make_call @ 42 NONAME
+ pjsua_call_reinvite @ 43 NONAME
+ pjsua_call_send_im @ 44 NONAME
+ pjsua_call_send_request @ 45 NONAME
+ pjsua_call_send_typing_ind @ 46 NONAME
+ pjsua_call_set_hold @ 47 NONAME
+ pjsua_call_set_user_data @ 48 NONAME
+ pjsua_call_update @ 49 NONAME
+ pjsua_call_xfer @ 50 NONAME
+ pjsua_call_xfer_replaces @ 51 NONAME
+ pjsua_codec_get_param @ 52 NONAME
+ pjsua_codec_set_param @ 53 NONAME
+ pjsua_codec_set_priority @ 54 NONAME
+ pjsua_conf_add_port @ 55 NONAME
+ pjsua_conf_adjust_rx_level @ 56 NONAME
+ pjsua_conf_adjust_tx_level @ 57 NONAME
+ pjsua_conf_connect @ 58 NONAME
+ pjsua_conf_disconnect @ 59 NONAME
+ pjsua_conf_get_active_ports @ 60 NONAME
+ pjsua_conf_get_max_ports @ 61 NONAME
+ pjsua_conf_get_port_info @ 62 NONAME
+ pjsua_conf_get_signal_level @ 63 NONAME
+ pjsua_conf_remove_port @ 64 NONAME
+ pjsua_config_default @ 65 NONAME
+ pjsua_config_dup @ 66 NONAME
+ pjsua_create @ 67 NONAME
+ pjsua_destroy @ 68 NONAME
+ pjsua_detect_nat_type @ 69 NONAME
+ pjsua_dump @ 70 NONAME
+ pjsua_enum_accs @ 71 NONAME
+ pjsua_enum_buddies @ 72 NONAME
+ pjsua_enum_calls @ 73 NONAME
+ pjsua_enum_codecs @ 74 NONAME
+ pjsua_enum_conf_ports @ 75 NONAME
+ pjsua_enum_snd_devs @ 76 NONAME
+ pjsua_enum_transports @ 77 NONAME
+ pjsua_get_buddy_count @ 78 NONAME
+ pjsua_get_ec_tail @ 79 NONAME
+ pjsua_get_nat_type @ 80 NONAME
+ pjsua_get_pjmedia_endpt @ 81 NONAME
+ pjsua_get_pjsip_endpt @ 82 NONAME
+ pjsua_get_pool_factory @ 83 NONAME
+ pjsua_get_snd_dev @ 84 NONAME
+ pjsua_get_var @ 85 NONAME
+ pjsua_handle_events @ 86 NONAME
+ pjsua_im_send @ 87 NONAME
+ pjsua_im_typing @ 88 NONAME
+ pjsua_init @ 89 NONAME
+ pjsua_logging_config_default @ 90 NONAME
+ pjsua_logging_config_dup @ 91 NONAME
+ pjsua_media_config_default @ 92 NONAME
+ pjsua_media_transports_create @ 93 NONAME
+ pjsua_msg_data_init @ 94 NONAME
+ pjsua_perror @ 95 NONAME
+ pjsua_player_create @ 96 NONAME
+ pjsua_player_destroy @ 97 NONAME
+ pjsua_player_get_conf_port @ 98 NONAME
+ pjsua_player_get_port @ 99 NONAME
+ pjsua_player_set_pos @ 100 NONAME
+ pjsua_playlist_create @ 101 NONAME
+ pjsua_pool_create @ 102 NONAME
+ pjsua_pres_dump @ 103 NONAME
+ pjsua_reconfigure_logging @ 104 NONAME
+ pjsua_recorder_create @ 105 NONAME
+ pjsua_recorder_destroy @ 106 NONAME
+ pjsua_recorder_get_conf_port @ 107 NONAME
+ pjsua_recorder_get_port @ 108 NONAME
+ pjsua_set_ec @ 109 NONAME
+ pjsua_set_no_snd_dev @ 110 NONAME
+ pjsua_set_null_snd_dev @ 111 NONAME
+ pjsua_set_snd_dev @ 112 NONAME
+ pjsua_start @ 113 NONAME
+ pjsua_transport_close @ 114 NONAME
+ pjsua_transport_config_default @ 115 NONAME
+ pjsua_transport_config_dup @ 116 NONAME
+ pjsua_transport_create @ 117 NONAME
+ pjsua_transport_get_info @ 118 NONAME
+ pjsua_transport_register @ 119 NONAME
+ pjsua_transport_set_enable @ 120 NONAME
+ pjsua_verify_sip_url @ 121 NONAME
diff --git a/jni/pjproject-android/.svn/pristine/4b/4b1998f48b21fabcfa80bf3b1dce2abd62b3d0c7.svn-base b/jni/pjproject-android/.svn/pristine/4b/4b1998f48b21fabcfa80bf3b1dce2abd62b3d0c7.svn-base
new file mode 100644
index 0000000..78e56fd
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4b1998f48b21fabcfa80bf3b1dce2abd62b3d0c7.svn-base
@@ -0,0 +1,34 @@
+
+include ../../../build.mak
+
+
+###############################################################################
+# Gather all flags.
+#
+export _CFLAGS := $(PJ_CFLAGS) $(CFLAGS)
+export _CXXFLAGS:= $(PJ_CXXFLAGS)
+export _LDFLAGS := $(PJ_LDFLAGS) $(PJ_LDLIBS) $(LDFLAGS)
+
+OBJS = alt_pjsua_aud.o alt_pjsua_vid.o pjsua_app.o main.o
+
+all: alt_pjsua
+
+alt_pjsua: $(OBJS)
+ $(PJ_CC) -o $@ $(OBJS) $(_CFLAGS) $(_LDFLAGS)
+
+pjsua_app.o: ../pjsua/pjsua_app.c
+ $(PJ_CC) $(_CFLAGS) -c -o $@ $<
+
+main.o: ../pjsua/main.c
+ $(PJ_CC) $(_CFLAGS) -c -o $@ $<
+
+%.o: %.c
+ $(PJ_CC) $(_CFLAGS) -c -o $@ $<
+
+depend:
+
+clean:
+ rm -f *.o alt_pjsua
+
+distclean realclean: clean
+
diff --git a/jni/pjproject-android/.svn/pristine/4b/4b40e22aa6cc59c92ee98e9ba2a90b5a6f7a71fb.svn-base b/jni/pjproject-android/.svn/pristine/4b/4b40e22aa6cc59c92ee98e9ba2a90b5a6f7a71fb.svn-base
new file mode 100644
index 0000000..503bc24
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4b40e22aa6cc59c92ee98e9ba2a90b5a6f7a71fb.svn-base
@@ -0,0 +1,141 @@
+/* $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_UNICODE_H__
+#define __PJ_UNICODE_H__
+
+#include <pj/types.h>
+
+
+/**
+ * @defgroup PJ_UNICODE Unicode Support
+ * @ingroup PJ_MISC
+ * @{
+ */
+
+PJ_BEGIN_DECL
+
+
+/**
+ * @file unicode.h
+ * @brief Provides Unicode conversion for Unicode OSes
+ */
+
+/**
+ * Convert ANSI strings to Unicode strings.
+ *
+ * @param str The ANSI string to be converted.
+ * @param len The length of the input string.
+ * @param wbuf Buffer to hold the Unicode string output.
+ * @param wbuf_count Buffer size, in number of elements (not bytes).
+ *
+ * @return The Unicode string, NULL terminated.
+ */
+PJ_DECL(wchar_t*) pj_ansi_to_unicode(const char *str, int len,
+ wchar_t *wbuf, int wbuf_count);
+
+
+/**
+ * Convert Unicode string to ANSI string.
+ *
+ * @param wstr The Unicode string to be converted.
+ * @param len The length of the input string.
+ * @param buf Buffer to hold the ANSI string output.
+ * @param buf_size Size of the output buffer.
+ *
+ * @return The ANSI string, NULL terminated.
+ */
+PJ_DECL(char*) pj_unicode_to_ansi(const wchar_t *wstr, pj_ssize_t len,
+ char *buf, int buf_size);
+
+
+#if defined(PJ_NATIVE_STRING_IS_UNICODE) && PJ_NATIVE_STRING_IS_UNICODE!=0
+
+/**
+ * This macro is used to declare temporary Unicode buffer for ANSI to
+ * Unicode conversion, and should be put in declaration section of a block.
+ * When PJ_NATIVE_STRING_IS_UNICODE macro is not defined, this
+ * macro will expand to nothing.
+ */
+# define PJ_DECL_UNICODE_TEMP_BUF(buf,size) wchar_t buf[size];
+
+/**
+ * This macro will convert ANSI string to native, when the platform's
+ * native string is Unicode (PJ_NATIVE_STRING_IS_UNICODE is non-zero).
+ */
+# define PJ_STRING_TO_NATIVE(s,buf,max) pj_ansi_to_unicode( \
+ s, strlen(s), \
+ buf, max)
+
+/**
+ * This macro is used to declare temporary ANSI buffer for Unicode to
+ * ANSI conversion, and should be put in declaration section of a block.
+ * When PJ_NATIVE_STRING_IS_UNICODE macro is not defined, this
+ * macro will expand to nothing.
+ */
+# define PJ_DECL_ANSI_TEMP_BUF(buf,size) char buf[size];
+
+
+/**
+ * This macro will convert Unicode string to ANSI, when the platform's
+ * native string is Unicode (PJ_NATIVE_STRING_IS_UNICODE is non-zero).
+ */
+# define PJ_NATIVE_TO_STRING(cs,buf,max) pj_unicode_to_ansi( \
+ cs, wcslen(cs), \
+ buf, max)
+
+#else
+
+/**
+ * This macro is used to declare temporary Unicode buffer for ANSI to
+ * Unicode conversion, and should be put in declaration section of a block.
+ * When PJ_NATIVE_STRING_IS_UNICODE macro is not defined, this
+ * macro will expand to nothing.
+ */
+# define PJ_DECL_UNICODE_TEMP_BUF(var,size)
+/**
+ * This macro will convert ANSI string to native, when the platform's
+ * native string is Unicode (PJ_NATIVE_STRING_IS_UNICODE is non-zero).
+ */
+# define PJ_STRING_TO_NATIVE(s,buf,max) ((char*)s)
+/**
+ * This macro is used to declare temporary ANSI buffer for Unicode to
+ * ANSI conversion, and should be put in declaration section of a block.
+ * When PJ_NATIVE_STRING_IS_UNICODE macro is not defined, this
+ * macro will expand to nothing.
+ */
+# define PJ_DECL_ANSI_TEMP_BUF(buf,size)
+/**
+ * This macro will convert Unicode string to ANSI, when the platform's
+ * native string is Unicode (PJ_NATIVE_STRING_IS_UNICODE is non-zero).
+ */
+# define PJ_NATIVE_TO_STRING(cs,buf,max) ((char*)(const char*)cs)
+
+#endif
+
+
+
+PJ_END_DECL
+
+/*
+ * @}
+ */
+
+
+#endif /* __PJ_UNICODE_H__ */
diff --git a/jni/pjproject-android/.svn/pristine/4b/4b5b8bc6606fecb2a9ebc87cf091615f16fc7173.svn-base b/jni/pjproject-android/.svn/pristine/4b/4b5b8bc6606fecb2a9ebc87cf091615f16fc7173.svn-base
new file mode 100644
index 0000000..7d350ed
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4b5b8bc6606fecb2a9ebc87cf091615f16fc7173.svn-base
@@ -0,0 +1,95 @@
+/* $Id$ */
+/*
+ * Copyright (C) 2009-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 <pj/sock_qos.h>
+#include "os_symbian.h"
+
+PJ_DEF(pj_status_t) pj_sock_set_qos_params(pj_sock_t sock,
+ pj_qos_params *param)
+{
+ PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL);
+
+ CPjSocket *pjsock = (CPjSocket*)sock;
+ RSocket & rsock = pjsock->Socket();
+ pj_status_t last_err = PJ_ENOTSUP;
+
+ /* SO_PRIORITY and WMM are not supported */
+ param->flags &= ~(PJ_QOS_PARAM_HAS_SO_PRIO | PJ_QOS_PARAM_HAS_WMM);
+
+ if (param->flags & PJ_QOS_PARAM_HAS_DSCP) {
+ TInt err;
+
+ err = rsock.SetOpt(KSoIpTOS, KProtocolInetIp,
+ (param->dscp_val << 2));
+ if (err != KErrNone) {
+ last_err = PJ_RETURN_OS_ERROR(err);
+ param->flags &= ~(PJ_QOS_PARAM_HAS_DSCP);
+ }
+ }
+
+ return param->flags ? PJ_SUCCESS : last_err;
+}
+
+PJ_DEF(pj_status_t) pj_sock_set_qos_type(pj_sock_t sock,
+ pj_qos_type type)
+{
+ pj_qos_params param;
+ pj_status_t status;
+
+ status = pj_qos_get_params(type, ¶m);
+ if (status != PJ_SUCCESS)
+ return status;
+
+ return pj_sock_set_qos_params(sock, ¶m);
+}
+
+
+PJ_DEF(pj_status_t) pj_sock_get_qos_params(pj_sock_t sock,
+ pj_qos_params *p_param)
+{
+ PJ_ASSERT_RETURN(sock!=0 && sock!=PJ_INVALID_SOCKET, PJ_EINVAL);
+
+ CPjSocket *pjsock = (CPjSocket*)sock;
+ RSocket & rsock = pjsock->Socket();
+ TInt err, dscp;
+
+ pj_bzero(p_param, sizeof(*p_param));
+
+ err = rsock.GetOpt(KSoIpTOS, KProtocolInetIp, dscp);
+ if (err == KErrNone) {
+ p_param->flags |= PJ_QOS_PARAM_HAS_DSCP;
+ p_param->dscp_val = (dscp >> 2);
+ return PJ_SUCCESS;
+ } else {
+ return PJ_RETURN_OS_ERROR(err);
+ }
+}
+
+PJ_DEF(pj_status_t) pj_sock_get_qos_type(pj_sock_t sock,
+ pj_qos_type *p_type)
+{
+ pj_qos_params param;
+ pj_status_t status;
+
+ status = pj_sock_get_qos_params(sock, ¶m);
+ if (status != PJ_SUCCESS)
+ return status;
+
+ return pj_qos_get_type(¶m, p_type);
+}
+
diff --git a/jni/pjproject-android/.svn/pristine/4b/4b8b36ef660e97d579b73dd654bb28b62981f654.svn-base b/jni/pjproject-android/.svn/pristine/4b/4b8b36ef660e97d579b73dd654bb28b62981f654.svn-base
new file mode 100644
index 0000000..5b1609c
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4b8b36ef660e97d579b73dd654bb28b62981f654.svn-base
@@ -0,0 +1 @@
+#include "../../../portaudio/src/hostapi/coreaudio/pa_mac_core.c"
diff --git a/jni/pjproject-android/.svn/pristine/4b/4bb17c98e54788bb0110d1e856b4bbb8cf1cd997.svn-base b/jni/pjproject-android/.svn/pristine/4b/4bb17c98e54788bb0110d1e856b4bbb8cf1cd997.svn-base
new file mode 100644
index 0000000..97a8b3b
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4bb17c98e54788bb0110d1e856b4bbb8cf1cd997.svn-base
@@ -0,0 +1,457 @@
+/* $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 __PJNATH_STUN_AUTH_H__
+#define __PJNATH_STUN_AUTH_H__
+
+/**
+ * @file stun_auth.h
+ * @brief STUN authentication.
+ */
+
+#include <pjnath/stun_msg.h>
+
+
+PJ_BEGIN_DECL
+
+
+/* **************************************************************************/
+/**
+ * @defgroup PJNATH_STUN_AUTH STUN Authentication
+ * @brief STUN authentication helper
+ * @ingroup PJNATH_STUN_BASE
+ * @{
+ */
+
+/**
+ * Type of authentication.
+ */
+typedef enum pj_stun_auth_type
+{
+ /**
+ * No authentication.
+ */
+ PJ_STUN_AUTH_NONE = 0,
+
+ /**
+ * Authentication using short term credential.
+ */
+ PJ_STUN_AUTH_SHORT_TERM = 1,
+
+ /**
+ * Authentication using long term credential.
+ */
+ PJ_STUN_AUTH_LONG_TERM = 2
+
+} pj_stun_auth_type;
+
+
+/**
+ * Type of authentication data in the credential.
+ */
+typedef enum pj_stun_auth_cred_type
+{
+ /**
+ * The credential data contains a static credential to be matched
+ * against the credential in the message. A static credential can be
+ * used as both client side or server side authentication.
+ */
+ PJ_STUN_AUTH_CRED_STATIC,
+
+ /**
+ * The credential data contains callbacks to be called to verify the
+ * credential in the message. A dynamic credential is suitable when
+ * performing server side authentication where server does not know
+ * in advance the identity of the user requesting authentication.
+ */
+ PJ_STUN_AUTH_CRED_DYNAMIC
+
+} pj_stun_auth_cred_type;
+
+
+/**
+ * Type of encoding applied to the password stored in the credential.
+ */
+typedef enum pj_stun_passwd_type
+{
+ /**
+ * Plain text password.
+ */
+ PJ_STUN_PASSWD_PLAIN = 0,
+
+ /**
+ * Hashed password, valid for long term credential only. The hash value
+ * of the password is calculated as MD5(USERNAME ":" REALM ":" PASSWD)
+ * with all quotes removed from the username and realm values.
+ */
+ PJ_STUN_PASSWD_HASHED = 1
+
+} pj_stun_passwd_type;
+
+
+/**
+ * This structure contains the descriptions needed to perform server side
+ * authentication. Depending on the \a type set in the structure, application
+ * may specify a static username/password combination, or to have callbacks
+ * called by the function to authenticate the credential dynamically.
+ */
+typedef struct pj_stun_auth_cred
+{
+ /**
+ * The type of authentication information in this structure.
+ */
+ pj_stun_auth_cred_type type;
+
+ /**
+ * This union contains the authentication data.
+ */
+ union
+ {
+ /**
+ * This structure contains static data for performing authentication.
+ * A non-empty realm indicates whether short term or long term
+ * credential is used.
+ */
+ struct
+ {
+ /**
+ * If not-empty, it indicates that this is a long term credential.
+ */
+ pj_str_t realm;
+
+ /**
+ * The username of the credential.
+ */
+ pj_str_t username;
+
+ /**
+ * Data type to indicate the type of password in the \a data field.
+ */
+ pj_stun_passwd_type data_type;
+
+ /**
+ * The data, which depends depends on the value of \a data_type
+ * field. When \a data_type is zero, this field will contain the
+ * plaintext password.
+ */
+ pj_str_t data;
+
+ /**
+ * Optional NONCE.
+ */
+ pj_str_t nonce;
+
+ } static_cred;
+
+ /**
+ * This structure contains callback to be called by the framework
+ * to authenticate the incoming message.
+ */
+ struct
+ {
+ /**
+ * User data which will be passed back to callback functions.
+ */
+ void *user_data;
+
+ /**
+ * This callback is called by pj_stun_verify_credential() when
+ * server needs to challenge the request with 401 response.
+ *
+ * @param user_data The user data as specified in the credential.
+ * @param pool Pool to allocate memory.
+ * @param realm On return, the function should fill in with
+ * realm if application wants to use long term
+ * credential. Otherwise application should set
+ * empty string for the realm.
+ * @param nonce On return, if application wants to use long
+ * term credential, it MUST fill in the nonce
+ * with some value. Otherwise if short term
+ * credential is wanted, it MAY set this value.
+ * If short term credential is wanted and the
+ * application doesn't want to include NONCE,
+ * then it must set this to empty string.
+ *
+ * @return The callback should return PJ_SUCCESS, or
+ * otherwise response message will not be
+ * created.
+ */
+ pj_status_t (*get_auth)(void *user_data,
+ pj_pool_t *pool,
+ pj_str_t *realm,
+ pj_str_t *nonce);
+
+ /**
+ * Get the credential to be put in outgoing request.
+ *
+ * @param msg The outgoing message where the credential is
+ * to be applied.
+ * @param user_data The user data as specified in the credential.
+ * @param pool Pool where the callback can allocate memory
+ * to fill in the credential.
+ * @param realm On return, the callback may specify the realm
+ * if long term credential is desired, otherwise
+ * this string must be set to empty.
+ * @param username On return, the callback must fill in with the
+ * username.
+ * @param nonce On return, the callback may optionally fill in
+ * this argument with NONCE value if desired,
+ * otherwise this argument must be set to empty.
+ * @param data_type On return, the callback must set this argument
+ * with the type of password in the data argument.
+ * @param data On return, the callback must set this with
+ * the password, encoded according to data_type
+ * argument.
+ *
+ * @return The callback must return PJ_SUCCESS, otherwise
+ * the message transmission will be cancelled.
+ */
+ pj_status_t (*get_cred)(const pj_stun_msg *msg,
+ void *user_data,
+ pj_pool_t *pool,
+ pj_str_t *realm,
+ pj_str_t *username,
+ pj_str_t *nonce,
+ pj_stun_passwd_type *data_type,
+ pj_str_t *data);
+
+ /**
+ * Get the password for the specified username. This function
+ * is also used to check whether the username is valid.
+ *
+ * @param msg The STUN message where the password will be
+ * applied to.
+ * @param user_data The user data as specified in the credential.
+ * @param realm The realm as specified in the message.
+ * @param username The username as specified in the message.
+ * @param pool Pool to allocate memory when necessary.
+ * @param data_type On return, application should fill up this
+ * argument with the type of data (which should
+ * be zero if data is a plaintext password).
+ * @param data On return, application should fill up this
+ * argument with the password according to
+ * data_type.
+ *
+ * @return The callback should return PJ_SUCCESS if
+ * username has been successfully verified
+ * and password was obtained. If non-PJ_SUCCESS
+ * is returned, it is assumed that the
+ * username is not valid.
+ */
+ pj_status_t (*get_password)(const pj_stun_msg *msg,
+ void *user_data,
+ const pj_str_t *realm,
+ const pj_str_t *username,
+ pj_pool_t *pool,
+ pj_stun_passwd_type *data_type,
+ pj_str_t *data);
+
+ /**
+ * This callback will be called to verify that the NONCE given
+ * in the message can be accepted. If this callback returns
+ * PJ_FALSE, 438 (Stale Nonce) response will be created.
+ *
+ * This callback is optional.
+ *
+ * @param msg The STUN message where the nonce was received.
+ * @param user_data The user data as specified in the credential.
+ * @param realm The realm as specified in the message.
+ * @param username The username as specified in the message.
+ * @param nonce The nonce to be verified.
+ *
+ * @return The callback MUST return non-zero if the
+ * NONCE can be accepted.
+ */
+ pj_bool_t (*verify_nonce)(const pj_stun_msg *msg,
+ void *user_data,
+ const pj_str_t *realm,
+ const pj_str_t *username,
+ const pj_str_t *nonce);
+
+ } dyn_cred;
+
+ } data;
+
+} pj_stun_auth_cred;
+
+
+/**
+ * This structure contains the credential information that is found and
+ * used to authenticate incoming requests. Application may use this
+ * information when generating authentication for the outgoing response.
+ */
+typedef struct pj_stun_req_cred_info
+{
+ /**
+ * The REALM value found in the incoming request. If short term
+ * credential is used, the value will be empty.
+ */
+ pj_str_t realm;
+
+ /**
+ * The USERNAME value found in the incoming request.
+ */
+ pj_str_t username;
+
+ /**
+ * Optional NONCE.
+ */
+ pj_str_t nonce;
+
+ /**
+ * Authentication key that was used to authenticate the incoming
+ * request. This key is created with #pj_stun_create_key(), and
+ * it can be used to encode the credential of the outgoing
+ * response.
+ */
+ pj_str_t auth_key;
+
+} pj_stun_req_cred_info;
+
+
+/**
+ * Duplicate authentication credential.
+ *
+ * @param pool Pool to be used to allocate memory.
+ * @param dst Destination credential.
+ * @param src Source credential.
+ */
+PJ_DECL(void) pj_stun_auth_cred_dup(pj_pool_t *pool,
+ pj_stun_auth_cred *dst,
+ const pj_stun_auth_cred *src);
+
+/**
+ * Duplicate request credential.
+ *
+ * @param pool Pool to be used to allocate memory.
+ * @param dst Destination credential.
+ * @param src Source credential.
+ */
+PJ_DECL(void) pj_stun_req_cred_info_dup(pj_pool_t *pool,
+ pj_stun_req_cred_info *dst,
+ const pj_stun_req_cred_info *src);
+
+
+/**
+ * Create authentication key to be used for encoding the message with
+ * MESSAGE-INTEGRITY. If short term credential is used (i.e. the realm
+ * argument is NULL or empty), the key will be copied from the password.
+ * If long term credential is used, the key will be calculated from the
+ * MD5 hash of the realm, username, and password.
+ *
+ * @param pool Pool to allocate memory for the key.
+ * @param key String to receive the key.
+ * @param realm The realm of the credential, if long term credential
+ * is to be used. If short term credential is wanted,
+ * application can put NULL or empty string here.
+ * @param username The username.
+ * @param data_type Password encoding.
+ * @param data The password.
+ */
+PJ_DECL(void) pj_stun_create_key(pj_pool_t *pool,
+ pj_str_t *key,
+ const pj_str_t *realm,
+ const pj_str_t *username,
+ pj_stun_passwd_type data_type,
+ const pj_str_t *data);
+
+/**
+ * Verify credential in the STUN request. Note that before calling this
+ * function, application must have checked that the message contains
+ * PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute by calling pj_stun_msg_find_attr()
+ * function, because this function will reject the message with 401 error
+ * if it doesn't contain PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute.
+ *
+ * @param pkt The original packet which has been parsed into
+ * the message. This packet MUST NOT have been modified
+ * after the parsing.
+ * @param pkt_len The length of the packet.
+ * @param msg The parsed message to be verified.
+ * @param cred Pointer to credential to be used to authenticate
+ * the message.
+ * @param pool If response is to be created, then memory will
+ * be allocated from this pool.
+ * @param info Optional pointer to receive authentication information
+ * found in the request and the credential that is used
+ * to authenticate the request.
+ * @param p_response Optional pointer to receive the response message
+ * then the credential in the request fails to
+ * authenticate.
+ *
+ * @return PJ_SUCCESS if credential is verified successfully.
+ * If the verification fails and \a p_response is not
+ * NULL, an appropriate response will be returned in
+ * \a p_response.
+ */
+PJ_DECL(pj_status_t) pj_stun_authenticate_request(const pj_uint8_t *pkt,
+ unsigned pkt_len,
+ const pj_stun_msg *msg,
+ pj_stun_auth_cred *cred,
+ pj_pool_t *pool,
+ pj_stun_req_cred_info *info,
+ pj_stun_msg **p_response);
+
+
+/**
+ * Determine if STUN message can be authenticated. Some STUN error
+ * responses cannot be authenticated since they cannot contain STUN
+ * MESSAGE-INTEGRITY attribute. STUN Indication messages also cannot
+ * be authenticated.
+ *
+ * @param msg The STUN message.
+ *
+ * @return Non-zero if the STUN message can be authenticated.
+ */
+PJ_DECL(pj_bool_t) pj_stun_auth_valid_for_msg(const pj_stun_msg *msg);
+
+
+/**
+ * Verify credential in the STUN response. Note that before calling this
+ * function, application must have checked that the message contains
+ * PJ_STUN_ATTR_MESSAGE_INTEGRITY attribute by calling pj_stun_msg_find_attr()
+ * function, because otherwise this function will report authentication
+ * failure.
+ *
+ * @param pkt The original packet which has been parsed into
+ * the message. This packet MUST NOT have been modified
+ * after the parsing.
+ * @param pkt_len The length of the packet.
+ * @param msg The parsed message to be verified.
+ * @param key Authentication key to calculate MESSAGE-INTEGRITY
+ * value. Application can create this key by using
+ * #pj_stun_create_key() function.
+ *
+ * @return PJ_SUCCESS if credential is verified successfully.
+ */
+PJ_DECL(pj_status_t) pj_stun_authenticate_response(const pj_uint8_t *pkt,
+ unsigned pkt_len,
+ const pj_stun_msg *msg,
+ const pj_str_t *key);
+
+
+/**
+ * @}
+ */
+
+
+PJ_END_DECL
+
+
+#endif /* __PJNATH_STUN_AUTH_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/4b/4bca93f9826d81c080c05d7e02cc664f088bb86f.svn-base b/jni/pjproject-android/.svn/pristine/4b/4bca93f9826d81c080c05d7e02cc664f088bb86f.svn-base
new file mode 100644
index 0000000..8cce880
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/4b/4bca93f9826d81c080c05d7e02cc664f088bb86f.svn-base
@@ -0,0 +1,63 @@
+/* $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 __PJLIB_H__
+#define __PJLIB_H__
+
+/**
+ * @file pjlib.h
+ * @brief Include all PJLIB header files.
+ */
+
+#include <pj/activesock.h>
+#include <pj/addr_resolv.h>
+#include <pj/array.h>
+#include <pj/assert.h>
+#include <pj/ctype.h>
+#include <pj/errno.h>
+#include <pj/except.h>
+#include <pj/fifobuf.h>
+#include <pj/file_access.h>
+#include <pj/file_io.h>
+#include <pj/guid.h>
+#include <pj/hash.h>
+#include <pj/ioqueue.h>
+#include <pj/ip_helper.h>
+#include <pj/list.h>
+#include <pj/lock.h>
+#include <pj/log.h>
+#include <pj/math.h>
+#include <pj/os.h>
+#include <pj/pool.h>
+#include <pj/pool_buf.h>
+#include <pj/rand.h>
+#include <pj/rbtree.h>
+#include <pj/sock.h>
+#include <pj/sock_qos.h>
+#include <pj/sock_select.h>
+#include <pj/ssl_sock.h>
+#include <pj/string.h>
+#include <pj/timer.h>
+#include <pj/unicode.h>
+
+#include <pj/compat/high_precision.h>
+
+#endif /* __PJLIB_H__ */
+