* #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/c3/c3005422ec99ac6a68c66b66c849c4b11762aead.svn-base b/jni/pjproject-android/.svn/pristine/c3/c3005422ec99ac6a68c66b66c849c4b11762aead.svn-base
new file mode 100644
index 0000000..88dc78d
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c3005422ec99ac6a68c66b66c849c4b11762aead.svn-base
@@ -0,0 +1,753 @@
+/* $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_SESSION_H__
+#define __PJNATH_STUN_SESSION_H__
+
+/**
+ * @file stun_session.h
+ * @brief STUN session management for client/server.
+ */
+
+#include <pjnath/stun_msg.h>
+#include <pjnath/stun_auth.h>
+#include <pjnath/stun_config.h>
+#include <pjnath/stun_transaction.h>
+#include <pj/list.h>
+#include <pj/lock.h>
+#include <pj/timer.h>
+
+PJ_BEGIN_DECL
+
+
+/* **************************************************************************/
+/**
+ * @addtogroup PJNATH_STUN_SESSION
+ * @{
+ *
+ * This is is a transport-independent object to manage a client or server 
+ * STUN session. It has the following features:
+ * 
+ *  - <b>transport independent</b>:\n
+ *    the object does not have it's own socket, but rather it provides
+ *    functions and callbacks to send and receive packets. This way the
+ *    object can be used by different transport types (e.g. UDP, TCP, 
+ *    TLS, etc.) as well as better integration to application which
+ *    already has its own means to send and receive packets.
+ * 
+ *  - <b>authentication management</b>:\n
+ *    the object manages STUN authentication throughout the lifetime of
+ *    the session. For client sessions, once it's given a credential to
+ *    authenticate itself with the server, the object will automatically
+ *    add authentication info (the MESSAGE-INTEGRITY) to the request as
+ *    well as authenticate the response. It will also handle long-term 
+ *    authentication challenges, including handling of nonce expiration,
+ *    and retry the request automatically. For server sessions, it can 
+ *    be configured to authenticate incoming requests automatically.
+ *  
+ *  - <b>static or dynamic credential</b>:\n
+ *    application may specify static or dynamic credential to be used by
+ *    the STUN session. Static credential means a static combination of
+ *    username and password (and these cannot change during the session
+ *    duration), while dynamic credential provides callback to ask the
+ *    application about which username/password to use everytime
+ *    authentication is about to be performed.
+ *    
+ *  - <b>client transaction management</b>:\n
+ *    outgoing requests may be sent with a STUN transaction for reliability,
+ *    and the object will manage the transaction internally (including
+ *    performing retransmissions). Application will be notified about the
+ *    result of the request when the response arrives (or the transaction
+ *    times out). When the request is challenged with authentication, the
+ *    object will retry the request with new authentication info, and 
+ *    application will be notified about the final result of this request.
+ * 
+ *  - <b>server transaction management</b>:\n
+ *    application may ask response to incoming requests to be cached by
+ *    the object, and in this case the object will check for cached
+ *    response everytime request is received. The cached response will be
+ *    deleted once a timer expires.
+ *
+ * \section using_stun_sess_sec Using the STUN session
+ *
+ * The following steps describes how to use the STUN session:
+ *
+ *  - <b>create the object configuration</b>:\n
+ *    The #pj_stun_config contains the configuration to create the STUN
+ *    session, such as the timer heap to register internal timers and
+ *    various STUN timeout values. You can initialize this structure by
+ *    calling #pj_stun_config_init()
+ *
+ *  - <b>create the STUN session</b>:\n
+ *    by calling #pj_stun_session_create(). Among other things, this
+ *    function requires the instance of #pj_stun_config and also 
+ *    #pj_stun_session_cb structure which stores callbacks to send
+ *    outgoing packets as well as to notify application about incoming
+ *    STUN requests, responses, and indicates and other events.
+ *
+ *  - <b>configure credential:</b>\n
+ *    if authentication is required for the session, configure the
+ *    credential with #pj_stun_session_set_credential()
+ *
+ *  - <b>configuring other settings:</b>\n
+ *    several APIs are provided to configure the behavior of the STUN
+ *    session (for example, to set the SOFTWARE attribute value, controls
+ *    the logging behavior, fine tune the mutex locking, etc.). Please see
+ *    the API reference for more info.
+ *
+ *  - <b>creating outgoing STUN requests or indications:</b>\n
+ *    create the STUN message by using #pj_stun_session_create_req() or
+ *    #pj_stun_session_create_ind(). This will create a transmit data
+ *    buffer containing a blank STUN request or indication. You will then
+ *    typically need to add STUN attributes that are relevant to the
+ *    request or indication, but note that some default attributes will
+ *    be added by the session later when the message is sent (such as
+ *    SOFTWARE attribute and attributes related to authentication).
+ *    The message is now ready to be sent.
+ *
+ *  - <b>sending outgoing message:</b>\n
+ *    use #pj_stun_session_send_msg() to send outgoing STUN messages (this
+ *    includes STUN requests, indications, and responses). The function has
+ *    options whether to retransmit the request (for non reliable transports)
+ *    or to cache the response if we're sending response. This function in 
+ *    turn will call the \a on_send_msg() callback of #pj_stun_session_cb 
+ *    to request the application to send the packet.
+ *
+ *  - <b>handling incoming packet:</b>\n
+ *    call #pj_stun_session_on_rx_pkt() everytime the application receives
+ *    a STUN packet. This function will decode the packet and process the
+ *    packet according to the message, and normally this will cause one
+ *    of the callback in the #pj_stun_session_cb to be called to notify
+ *    the application about the event.
+ *
+ *  - <b>handling incoming requests:</b>\n
+ *    incoming requests are notified to application in the \a on_rx_request
+ *    callback of the #pj_stun_session_cb. If authentication is enabled in
+ *    the session, the application will only receive this callback after
+ *    the incoming request has been authenticated (if the authentication
+ *    fails, the session would respond automatically with 401 error and
+ *    the callback will not be called). Application now must create and
+ *    send response for this request.
+ *
+ *  - <b>creating and sending response:</b>\n
+ *    create the STUN response with #pj_stun_session_create_res(). This will
+ *    create a transmit data buffer containing a blank STUN response. You 
+ *    will then typically need to add STUN attributes that are relevant to
+ *    the response, but note that some default attributes will
+ *    be added by the session later when the message is sent (such as
+ *    SOFTWARE attribute and attributes related to authentication).
+ *    The message is now ready to be sent. Use #pj_stun_session_send_msg()
+ *    (as explained above) to send the response.
+ *
+ *  - <b>convenient way to send response:</b>\n
+ *    the #pj_stun_session_respond() is provided as a convenient way to
+ *    create and send simple STUN responses, such as error responses.
+ *    
+ *  - <b>destroying the session:</b>\n
+ *    once the session is done, use #pj_stun_session_destroy() to destroy
+ *    the session.
+ */
+
+
+/** Forward declaration for pj_stun_tx_data */
+typedef struct pj_stun_tx_data pj_stun_tx_data;
+
+/** Forward declaration for pj_stun_rx_data */
+typedef struct pj_stun_rx_data pj_stun_rx_data;
+
+/** Forward declaration for pj_stun_session */
+typedef struct pj_stun_session pj_stun_session;
+
+
+/**
+ * This is the callback to be registered to pj_stun_session, to send
+ * outgoing message and to receive various notifications from the STUN
+ * session.
+ */
+typedef struct pj_stun_session_cb
+{
+    /**
+     * Callback to be called by the STUN session to send outgoing message.
+     *
+     * @param sess	    The STUN session.
+     * @param token	    The token associated with this outgoing message
+     *			    and was set by the application. This token was 
+     *			    set by application in pj_stun_session_send_msg()
+     *			    for outgoing messages that are initiated by the
+     *			    application, or in pj_stun_session_on_rx_pkt()
+     *			    if this message is a response that was internally
+     *			    generated by the STUN session (for example, an
+     *			    401/Unauthorized response). Application may use
+     *			    this facility for any purposes.
+     * @param pkt	    Packet to be sent.
+     * @param pkt_size	    Size of the packet to be sent.
+     * @param dst_addr	    The destination address.
+     * @param addr_len	    Length of destination address.
+     *
+     * @return		    The callback should return the status of the
+     *			    packet sending.
+     */
+    pj_status_t (*on_send_msg)(pj_stun_session *sess,
+			       void *token,
+			       const void *pkt,
+			       pj_size_t pkt_size,
+			       const pj_sockaddr_t *dst_addr,
+			       unsigned addr_len);
+
+    /** 
+     * Callback to be called on incoming STUN request message. This function
+     * is called when application calls pj_stun_session_on_rx_pkt() and when
+     * the STUN session has detected that the incoming STUN message is a
+     * STUN request message. In the 
+     * callback processing, application MUST create a response by calling
+     * pj_stun_session_create_response() function and send the response
+     * with pj_stun_session_send_msg() function, before returning from
+     * the callback.
+     *
+     * @param sess	    The STUN session.
+     * @param pkt	    Pointer to the original STUN packet.
+     * @param pkt_len	    Length of the STUN packet.
+     * @param rdata	    Data containing incoming request message.
+     * @param token	    The token that was set by the application when
+     *			    calling pj_stun_session_on_rx_pkt() function.
+     * @param src_addr	    Source address of the packet.
+     * @param src_addr_len  Length of the source address.
+     *
+     * @return		    The return value of this callback will be
+     *			    returned back to pj_stun_session_on_rx_pkt()
+     *			    function.
+     */
+    pj_status_t (*on_rx_request)(pj_stun_session *sess,
+				 const pj_uint8_t *pkt,
+				 unsigned pkt_len,
+				 const pj_stun_rx_data *rdata,
+				 void *token,
+				 const pj_sockaddr_t *src_addr,
+				 unsigned src_addr_len);
+
+    /**
+     * Callback to be called when response is received or the transaction 
+     * has timed out. This callback is called either when application calls
+     * pj_stun_session_on_rx_pkt() with the packet containing a STUN
+     * response for the client transaction, or when the internal timer of
+     * the STUN client transaction has timed-out before a STUN response is
+     * received.
+     *
+     * @param sess	    The STUN session.
+     * @param status	    Status of the request. If the value if not
+     *			    PJ_SUCCESS, the transaction has timed-out
+     *			    or other error has occurred, and the response
+     *			    argument may be NULL.
+     *			    Note that when the status is not success, the
+     *			    response may contain non-NULL value if the 
+     *			    response contains STUN ERROR-CODE attribute.
+     * @param token	    The token that was set by the application  when
+     *			    calling pj_stun_session_send_msg() function.
+     *			    Please not that this token IS NOT the token
+     *			    that was given in pj_stun_session_on_rx_pkt().
+     * @param tdata	    The original STUN request.
+     * @param response	    The response message, on successful transaction,
+     *			    or otherwise MAY BE NULL if status is not success.
+     *			    Note that when the status is not success, this
+     *			    argument may contain non-NULL value if the 
+     *			    response contains STUN ERROR-CODE attribute.
+     * @param src_addr	    The source address where the response was 
+     *			    received, or NULL if the response is NULL.
+     * @param src_addr_len  The length of the source  address.
+     */
+    void (*on_request_complete)(pj_stun_session *sess,
+			        pj_status_t status,
+				void *token,
+			        pj_stun_tx_data *tdata,
+			        const pj_stun_msg *response,
+				const pj_sockaddr_t *src_addr,
+				unsigned src_addr_len);
+
+
+    /**
+     * Callback to be called on incoming STUN request message. This function
+     * is called when application calls pj_stun_session_on_rx_pkt() and when
+     * the STUN session has detected that the incoming STUN message is a
+     * STUN indication message.
+     *
+     * @param sess	    The STUN session.
+     * @param pkt	    Pointer to the original STUN packet.
+     * @param pkt_len	    Length of the STUN packet.
+     * @param msg	    The parsed STUN indication.
+     * @param token	    The token that was set by the application when
+     *			    calling pj_stun_session_on_rx_pkt() function.
+     * @param src_addr	    Source address of the packet.
+     * @param src_addr_len  Length of the source address.
+     *
+     * @return		    The return value of this callback will be
+     *			    returned back to pj_stun_session_on_rx_pkt()
+     *			    function.
+     */
+    pj_status_t (*on_rx_indication)(pj_stun_session *sess,
+				    const pj_uint8_t *pkt,
+				    unsigned pkt_len,
+				    const pj_stun_msg *msg,
+				    void *token,
+				    const pj_sockaddr_t *src_addr,
+				    unsigned src_addr_len);
+
+} pj_stun_session_cb;
+
+
+/**
+ * This structure describes incoming request message.
+ */
+struct pj_stun_rx_data
+{
+    /**
+     * The parsed request message.
+     */
+    pj_stun_msg		    *msg;
+
+    /**
+     * Credential information that is found and used to authenticate 
+     * incoming request. Application may use this information when 
+     * generating  authentication for the outgoing response.
+     */
+    pj_stun_req_cred_info   info;
+};
+
+
+/**
+ * This structure describe the outgoing STUN transmit data to carry the
+ * message to be sent.
+ */
+struct pj_stun_tx_data
+{
+    /** PJLIB list interface */
+    PJ_DECL_LIST_MEMBER(struct pj_stun_tx_data);
+
+    pj_pool_t		*pool;		/**< Pool.			    */
+    pj_stun_session	*sess;		/**< The STUN session.		    */
+    pj_stun_msg		*msg;		/**< The STUN message.		    */
+
+    void		*token;		/**< The token.			    */
+
+    pj_stun_client_tsx	*client_tsx;	/**< Client STUN transaction.	    */
+    pj_bool_t		 retransmit;	/**< Retransmit request?	    */
+    pj_uint32_t		 msg_magic;	/**< Message magic.		    */
+    pj_uint8_t		 msg_key[12];	/**< Message/transaction key.	    */
+
+    pj_stun_req_cred_info auth_info;	/**< Credential info		    */
+
+    void		*pkt;		/**< The STUN packet.		    */
+    unsigned		 max_len;	/**< Length of packet buffer.	    */
+    pj_size_t		 pkt_size;	/**< The actual length of STUN pkt. */
+
+    unsigned		 addr_len;	/**< Length of destination address. */
+    const pj_sockaddr_t	*dst_addr;	/**< Destination address.	    */
+
+    pj_timer_entry	 res_timer;	/**< Response cache timer.	    */
+};
+
+
+/**
+ * These are the flags to control the message logging in the STUN session.
+ */
+typedef enum pj_stun_sess_msg_log_flag
+{
+    PJ_STUN_SESS_LOG_TX_REQ=1,	/**< Log outgoing STUN requests.    */
+    PJ_STUN_SESS_LOG_TX_RES=2,	/**< Log outgoing STUN responses.   */
+    PJ_STUN_SESS_LOG_TX_IND=4,	/**< Log outgoing STUN indications. */
+
+    PJ_STUN_SESS_LOG_RX_REQ=8,	/**< Log incoming STUN requests.    */
+    PJ_STUN_SESS_LOG_RX_RES=16,	/**< Log incoming STUN responses    */
+    PJ_STUN_SESS_LOG_RX_IND=32	/**< Log incoming STUN indications  */
+} pj_stun_sess_msg_log_flag;
+
+
+/**
+ * Create a STUN session.
+ *
+ * @param cfg		The STUN endpoint, to be used to register timers etc.
+ * @param name		Optional name to be associated with this instance. The
+ *			name will be used for example for logging purpose.
+ * @param cb		Session callback.
+ * @param fingerprint	Enable message fingerprint for outgoing messages.
+ * @param grp_lock	Optional group lock to be used by this session.
+ * 			If NULL, the session will create one itself.
+ * @param p_sess	Pointer to receive STUN session instance.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_create(pj_stun_config *cfg,
+					    const char *name,
+					    const pj_stun_session_cb *cb,
+					    pj_bool_t fingerprint,
+					    pj_grp_lock_t *grp_lock,
+					    pj_stun_session **p_sess);
+
+/**
+ * Destroy the STUN session and all objects created in the context of
+ * this session.
+ *
+ * @param sess	    The STUN session instance.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ *		    This function will return PJ_EPENDING if the operation
+ *		    cannot be performed immediately because callbacks are
+ *		    being called; in this case the session will be destroyed
+ *		    as soon as the last callback returns.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_destroy(pj_stun_session *sess);
+
+/**
+ * Associated an arbitrary data with this STUN session. The user data may
+ * be retrieved later with pj_stun_session_get_user_data() function.
+ *
+ * @param sess	    The STUN session instance.
+ * @param user_data The user data.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_set_user_data(pj_stun_session *sess,
+						   void *user_data);
+
+/**
+ * Retrieve the user data previously associated to this STUN session with
+ * pj_stun_session_set_user_data().
+ *
+ * @param sess	    The STUN session instance.
+ *
+ * @return	    The user data associated with this STUN session.
+ */
+PJ_DECL(void*) pj_stun_session_get_user_data(pj_stun_session *sess);
+
+/**
+ * Set SOFTWARE name to be included in all requests and responses.
+ *
+ * @param sess	    The STUN session instance.
+ * @param sw	    Software name string. If this argument is NULL or
+ *		    empty, the session will not include SOFTWARE attribute
+ *		    in STUN requests and responses.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_set_software_name(pj_stun_session *sess,
+						       const pj_str_t *sw);
+
+/**
+ * Set credential to be used by this session. Once credential is set, all
+ * outgoing messages will include MESSAGE-INTEGRITY, and all incoming
+ * message will be authenticated against this credential.
+ *
+ * To disable authentication after it has been set, call this function
+ * again with NULL as the argument.
+ *
+ * @param sess	    The STUN session instance.
+ * @param auth_type Type of authentication.
+ * @param cred	    The credential to be used by this session. If NULL
+ *		    is specified, authentication will be disabled.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_set_credential(pj_stun_session *sess,
+						pj_stun_auth_type auth_type,
+						const pj_stun_auth_cred *cred);
+/**
+ * Configure message logging. By default all flags are enabled.
+ *
+ * @param sess	    The STUN session instance.
+ * @param flags	    Bitmask combination of #pj_stun_sess_msg_log_flag
+ */
+PJ_DECL(void) pj_stun_session_set_log(pj_stun_session *sess,
+				      unsigned flags);
+/**
+ * Configure whether the STUN session should utilize FINGERPRINT in
+ * outgoing messages.
+ *
+ * @param sess	    The STUN session instance.
+ * @param use	    Boolean for the setting.
+ *
+ * @return	    The previous configured value of FINGERPRINT
+ *		    utilization of the sessoin.
+ */
+PJ_DECL(pj_bool_t) pj_stun_session_use_fingerprint(pj_stun_session *sess,
+						   pj_bool_t use);
+
+/**
+ * Create a STUN request message. After the message has been successfully
+ * created, application can send the message by calling 
+ * pj_stun_session_send_msg().
+ *
+ * @param sess	    The STUN session instance.
+ * @param msg_type  The STUN request message type, from pj_stun_method_e or
+ *		    from pj_stun_msg_type.
+ * @param magic	    STUN magic, use PJ_STUN_MAGIC.
+ * @param tsx_id    Optional transaction ID.
+ * @param p_tdata   Pointer to receive STUN transmit data instance containing
+ *		    the request.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_create_req(pj_stun_session *sess,
+						int msg_type,
+						pj_uint32_t magic,
+						const pj_uint8_t tsx_id[12],
+						pj_stun_tx_data **p_tdata);
+
+/**
+ * Create a STUN Indication message. After the message  has been successfully
+ * created, application can send the message by calling 
+ * pj_stun_session_send_msg().
+ *
+ * @param sess	    The STUN session instance.
+ * @param msg_type  The STUN request message type, from pj_stun_method_e or
+ *		    from pj_stun_msg_type. This function will add the
+ *		    indication bit as necessary.
+ * @param p_tdata   Pointer to receive STUN transmit data instance containing
+ *		    the message.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_create_ind(pj_stun_session *sess,
+						int msg_type,
+					        pj_stun_tx_data **p_tdata);
+
+/**
+ * Create a STUN response message. After the message has been 
+ * successfully created, application can send the message by calling 
+ * pj_stun_session_send_msg(). Alternatively application may use
+ * pj_stun_session_respond() to create and send response in one function
+ * call.
+ *
+ * @param sess	    The STUN session instance.
+ * @param rdata	    The STUN request where the response is to be created.
+ * @param err_code  Error code to be set in the response, if error response
+ *		    is to be created, according to pj_stun_status enumeration.
+ *		    This argument MUST be zero if successful response is
+ *		    to be created.
+ * @param err_msg   Optional pointer for the error message string, when
+ *		    creating error response. If the value is NULL and the
+ *		    \a err_code is non-zero, then default error message will
+ *		    be used.
+ * @param p_tdata   Pointer to receive the response message created.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_create_res(pj_stun_session *sess,
+						const pj_stun_rx_data *rdata,
+						unsigned err_code,
+						const pj_str_t *err_msg,
+						pj_stun_tx_data **p_tdata);
+
+/**
+ * Send STUN message to the specified destination. This function will encode
+ * the pj_stun_msg instance to a packet buffer, and add credential or
+ * fingerprint if necessary. If the message is a request, the session will
+ * also create and manage a STUN client transaction to be used to manage the
+ * retransmission of the request. After the message has been encoded and
+ * transaction is setup, the \a on_send_msg() callback of pj_stun_session_cb
+ * (which is registered when the STUN session is created) will be called
+ * to actually send the message to the wire.
+ *
+ * @param sess	    The STUN session instance.
+ * @param token	    Optional token which will be given back to application in
+ *		    \a on_send_msg() callback and \a on_request_complete()
+ *		    callback, if the message is a STUN request message. 
+ *		    Internally this function will put the token in the 
+ *		    \a token field of pj_stun_tx_data, hence it will
+ *		    overwrite any value that the application puts there.
+ * @param cache_res If the message is a response message for an incoming
+ *		    request, specify PJ_TRUE to instruct the STUN session
+ *		    to cache this response for subsequent incoming request
+ *		    retransmission. Otherwise this parameter will be ignored
+ *		    for non-response message.
+ * @param retransmit If the message is a request message, specify whether the
+ *		    request should be retransmitted. Normally application will
+ *		    specify TRUE if the underlying transport is UDP and FALSE
+ *		    if the underlying transport is TCP or TLS.
+ * @param dst_addr  The destination socket address.
+ * @param addr_len  Length of destination address.
+ * @param tdata	    The STUN transmit data containing the STUN message to
+ *		    be sent.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ *		    This function will return PJNATH_ESTUNDESTROYED if 
+ *		    application has destroyed the session in 
+ *		    \a on_send_msg() callback.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_send_msg(pj_stun_session *sess,
+					      void *token,
+					      pj_bool_t cache_res,
+					      pj_bool_t retransmit,
+					      const pj_sockaddr_t *dst_addr,
+					      unsigned addr_len,
+					      pj_stun_tx_data *tdata);
+
+/**
+ * This is a utility function to create and send response for an incoming
+ * STUN request. Internally this function calls pj_stun_session_create_res()
+ * and pj_stun_session_send_msg(). It is provided here as a matter of
+ * convenience.
+ *
+ * @param sess	    The STUN session instance.
+ * @param rdata	    The STUN request message to be responded.
+ * @param code	    Error code to be set in the response, if error response
+ *		    is to be created, according to pj_stun_status enumeration.
+ *		    This argument MUST be zero if successful response is
+ *		    to be created.
+ * @param err_msg   Optional pointer for the error message string, when
+ *		    creating error response. If the value is NULL and the
+ *		    \a err_code is non-zero, then default error message will
+ *		    be used.
+ * @param token	    Optional token which will be given back to application in
+ *		    \a on_send_msg() callback and \a on_request_complete()
+ *		    callback, if the message is a STUN request message. 
+ *		    Internally this function will put the token in the 
+ *		    \a token field of pj_stun_tx_data, hence it will
+ *		    overwrite any value that the application puts there.
+ * @param cache	    Specify whether session should cache this response for
+ *		    future request retransmission. If TRUE, subsequent request
+ *		    retransmission will be handled by the session and it 
+ *		    will not call request callback.
+ * @param dst_addr  Destination address of the response (or equal to the
+ *		    source address of the original request).
+ * @param addr_len  Address length.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ *		    This function will return PJNATH_ESTUNDESTROYED if 
+ *		    application has destroyed the session in 
+ *		    \a on_send_msg() callback.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_respond(pj_stun_session *sess, 
+					     const pj_stun_rx_data *rdata,
+					     unsigned code, 
+					     const char *err_msg,
+					     void *token,
+					     pj_bool_t cache, 
+					     const pj_sockaddr_t *dst_addr, 
+					     unsigned addr_len);
+
+/**
+ * Cancel outgoing STUN transaction. This operation is only valid for outgoing
+ * STUN request, to cease retransmission of the request and destroy the
+ * STUN client transaction that is used to send the request.
+ *
+ * @param sess	    The STUN session instance.
+ * @param tdata	    The request message previously sent.
+ * @param notify    Specify whether \a on_request_complete() callback should
+ *		    be called.
+ * @param status    If \a on_request_complete() callback is to be called,
+ *		    specify the error status to be given when calling the
+ *		    callback. This error status MUST NOT be PJ_SUCCESS.
+ *
+ * @return	    PJ_SUCCESS if transaction is successfully cancelled.
+ *		    This function will return PJNATH_ESTUNDESTROYED if 
+ *		    application has destroyed the session in 
+ *		    \a on_request_complete() callback.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_cancel_req(pj_stun_session *sess,
+						pj_stun_tx_data *tdata,
+						pj_bool_t notify,
+						pj_status_t status);
+
+/**
+ * Explicitly request retransmission of the request. Normally application
+ * doesn't need to do this, but this functionality is needed by ICE to
+ * speed up connectivity check completion.
+ *
+ * @param sess	    The STUN session instance.
+ * @param tdata	    The request message previously sent.
+ * @param mod_count Boolean flag to indicate whether transmission count
+ *                  needs to be incremented.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error.
+ *		    This function will return PJNATH_ESTUNDESTROYED if 
+ *		    application has destroyed the session in \a on_send_msg()
+ *		    callback.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_retransmit_req(pj_stun_session *sess,
+						    pj_stun_tx_data *tdata,
+                                                    pj_bool_t mod_count);
+
+
+/**
+ * Application must call this function to notify the STUN session about
+ * the arrival of STUN packet. The STUN packet MUST have been checked
+ * first with #pj_stun_msg_check() to verify that this is indeed a valid
+ * STUN packet.
+ *
+ * The STUN session will decode the packet into pj_stun_msg, and process
+ * the message accordingly. If the message is a response, it will search
+ * through the outstanding STUN client transactions for a matching
+ * transaction ID and hand over the response to the transaction.
+ *
+ * On successful message processing, application will be notified about
+ * the message via one of the pj_stun_session_cb callback.
+ *
+ * @param sess		The STUN session instance.
+ * @param packet	The packet containing STUN message.
+ * @param pkt_size	Size of the packet.
+ * @param options	Options, from #pj_stun_decode_options.
+ * @param parsed_len	Optional pointer to receive the size of the parsed
+ *			STUN message (useful if packet is received via a
+ *			stream oriented protocol).
+ * @param token		Optional token which will be given back to application
+ *			in the \a on_rx_request(), \a on_rx_indication() and 
+ *			\a on_send_msg() callbacks. The token can be used to 
+ *			associate processing or incoming request or indication
+ *			with some context.
+ * @param src_addr	The source address of the packet, which will also
+ *			be given back to application callbacks, along with
+ *			source address length.
+ * @param src_addr_len	Length of the source address.
+ *
+ * @return		PJ_SUCCESS on success, or the appropriate error code.
+ *			This function will return PJNATH_ESTUNDESTROYED if 
+ *			application has destroyed the session in one of the
+ *			callback.
+ */
+PJ_DECL(pj_status_t) pj_stun_session_on_rx_pkt(pj_stun_session *sess,
+					       const void *packet,
+					       pj_size_t pkt_size,
+					       unsigned options,
+					       void *token,
+					       pj_size_t *parsed_len,
+					       const pj_sockaddr_t *src_addr,
+					       unsigned src_addr_len);
+
+/**
+ * Destroy the transmit data. Call this function only when tdata has been
+ * created but application doesn't want to send the message (perhaps
+ * because of other error).
+ *
+ * @param sess	    The STUN session.
+ * @param tdata	    The transmit data.
+ *
+ * @return	    PJ_SUCCESS on success, or the appropriate error code.
+ */
+PJ_DECL(void) pj_stun_msg_destroy_tdata(pj_stun_session *sess,
+					pj_stun_tx_data *tdata);
+
+
+/**
+ * @}
+ */
+
+
+PJ_END_DECL
+
+#endif	/* __PJNATH_STUN_SESSION_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/c3/c30121cfc567bfbb6224ab9634c63b325b4fc37e.svn-base b/jni/pjproject-android/.svn/pristine/c3/c30121cfc567bfbb6224ab9634c63b325b4fc37e.svn-base
new file mode 100644
index 0000000..6059030
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c30121cfc567bfbb6224ab9634c63b325b4fc37e.svn-base
@@ -0,0 +1,63 @@
+include ../../../build.mak
+include ../../../build/common.mak
+
+export LIBDIR := ../../lib
+
+RULES_MAK := $(PJDIR)/build/rules.mak
+
+export G7221_CODEC_LIB := ../../lib/libg7221codec-$(TARGET_NAME)$(LIBEXT)
+
+###############################################################################
+# Gather all flags.
+#
+export _CFLAGS 	:= $(CC_CFLAGS) $(OS_CFLAGS) $(HOST_CFLAGS) $(M_CFLAGS) \
+		   $(CFLAGS) $(CC_INC)../.. $(CC_INC)../../g7221/common \
+		   $(CC_INC)../../g7221/common/stl-files \
+		   $(CC_INC)../../../pjlib/include
+export _CXXFLAGS:= $(_CFLAGS) $(CC_CXXFLAGS) $(OS_CXXFLAGS) $(M_CXXFLAGS) \
+		   $(HOST_CXXFLAGS) $(CXXFLAGS)
+export _LDFLAGS := $(CC_LDFLAGS) $(OS_LDFLAGS) $(M_LDFLAGS) $(HOST_LDFLAGS) \
+		   $(LDFLAGS) 
+
+export G7221_CODEC_SRCDIR = ../../g7221
+export G7221_CODEC_OBJS = common/common.o common/huff_tab.o common/tables.o \
+                	common/basic_op.o  \
+                	decode/coef2sam.o decode/dct4_s.o decode/decoder.o \
+                	encode/dct4_a.o encode/sam2coef.o encode/encoder.o
+
+export G7221_CODEC_CFLAGS = $(_CFLAGS)
+
+
+export CC_OUT CC AR RANLIB HOST_MV HOST_RM HOST_RMDIR HOST_MKDIR OBJEXT LD LDOUT 
+###############################################################################
+# Main entry
+#
+# $(TARGET) is defined in os-$(OS_NAME).mak file in current directory.
+#
+TARGETS := libg7221codec
+
+all: $(TARGETS)
+
+doc:
+	cd .. && doxygen docs/doxygen.cfg
+
+dep: depend
+distclean: realclean
+
+.PHONY: dep depend libg7221codec clean realclean distclean
+
+libg7221codec:
+	$(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $(G7221_CODEC_LIB)
+
+clean print_lib:
+	$(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $@
+
+realclean:
+	$(subst @@,$(subst /,$(HOST_PSEP),.ilbc-$(TARGET_NAME).depend),$(HOST_RMR))
+	
+	$(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $@
+
+depend:
+	$(MAKE) -f $(RULES_MAK) APP=G7221_CODEC app=libg7221codec $@
+
+
diff --git a/jni/pjproject-android/.svn/pristine/c3/c305ea88c68e3b817faf67cd78e631c8fe7f9bfb.svn-base b/jni/pjproject-android/.svn/pristine/c3/c305ea88c68e3b817faf67cd78e631c8fe7f9bfb.svn-base
new file mode 100644
index 0000000..4385458
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c305ea88c68e3b817faf67cd78e631c8fe7f9bfb.svn-base
@@ -0,0 +1,543 @@
+
+   /******************************************************************
+
+       iLBC Speech Coder ANSI-C Source Code
+
+       iLBC_encode.c
+
+       Copyright (C) The Internet Society (2004).
+       All Rights Reserved.
+
+   ******************************************************************/
+
+   #include <math.h>
+   #include <stdlib.h>
+   #include <string.h>
+
+   #include "iLBC_define.h"
+   #include "LPCencode.h"
+   #include "FrameClassify.h"
+   #include "StateSearchW.h"
+   #include "StateConstructW.h"
+   #include "helpfun.h"
+   #include "constants.h"
+   #include "packing.h"
+   #include "iCBSearch.h"
+   #include "iCBConstruct.h"
+   #include "hpInput.h"
+   #include "anaFilter.h"
+   #include "syntFilter.h"
+
+   /*----------------------------------------------------------------*
+    *  Initiation of encoder instance.
+    *---------------------------------------------------------------*/
+
+   short initEncode(                   /* (o) Number of bytes
+                                              encoded */
+       iLBC_Enc_Inst_t *iLBCenc_inst,  /* (i/o) Encoder instance */
+       int mode                    /* (i) frame size mode */
+   ){
+       iLBCenc_inst->mode = mode;
+       if (mode==30) {
+           iLBCenc_inst->blockl = BLOCKL_30MS;
+           iLBCenc_inst->nsub = NSUB_30MS;
+           iLBCenc_inst->nasub = NASUB_30MS;
+           iLBCenc_inst->lpc_n = LPC_N_30MS;
+           iLBCenc_inst->no_of_bytes = NO_OF_BYTES_30MS;
+           iLBCenc_inst->no_of_words = NO_OF_WORDS_30MS;
+
+
+
+
+
+           iLBCenc_inst->state_short_len=STATE_SHORT_LEN_30MS;
+           /* ULP init */
+           iLBCenc_inst->ULP_inst=&ULP_30msTbl;
+       }
+       else if (mode==20) {
+           iLBCenc_inst->blockl = BLOCKL_20MS;
+           iLBCenc_inst->nsub = NSUB_20MS;
+           iLBCenc_inst->nasub = NASUB_20MS;
+           iLBCenc_inst->lpc_n = LPC_N_20MS;
+           iLBCenc_inst->no_of_bytes = NO_OF_BYTES_20MS;
+           iLBCenc_inst->no_of_words = NO_OF_WORDS_20MS;
+           iLBCenc_inst->state_short_len=STATE_SHORT_LEN_20MS;
+           /* ULP init */
+           iLBCenc_inst->ULP_inst=&ULP_20msTbl;
+       }
+       else {
+           exit(2);
+       }
+
+       memset((*iLBCenc_inst).anaMem, 0,
+           LPC_FILTERORDER*sizeof(float));
+       memcpy((*iLBCenc_inst).lsfold, lsfmeanTbl,
+           LPC_FILTERORDER*sizeof(float));
+       memcpy((*iLBCenc_inst).lsfdeqold, lsfmeanTbl,
+           LPC_FILTERORDER*sizeof(float));
+       memset((*iLBCenc_inst).lpc_buffer, 0,
+           (LPC_LOOKBACK+BLOCKL_MAX)*sizeof(float));
+       memset((*iLBCenc_inst).hpimem, 0, 4*sizeof(float));
+
+       return (short)(iLBCenc_inst->no_of_bytes);
+   }
+
+   /*----------------------------------------------------------------*
+    *  main encoder function
+    *---------------------------------------------------------------*/
+
+   void iLBC_encode(
+       unsigned char *bytes,           /* (o) encoded data bits iLBC */
+       float *block,                   /* (o) speech vector to
+                                              encode */
+       iLBC_Enc_Inst_t *iLBCenc_inst   /* (i/o) the general encoder
+                                              state */
+   ){
+
+       float data[BLOCKL_MAX];
+       float residual[BLOCKL_MAX], reverseResidual[BLOCKL_MAX];
+
+       int start, idxForMax, idxVec[STATE_LEN];
+
+
+
+
+
+       float reverseDecresidual[BLOCKL_MAX], mem[CB_MEML];
+       int n, k, meml_gotten, Nfor, Nback, i, pos;
+       int gain_index[CB_NSTAGES*NASUB_MAX],
+           extra_gain_index[CB_NSTAGES];
+       int cb_index[CB_NSTAGES*NASUB_MAX],extra_cb_index[CB_NSTAGES];
+       int lsf_i[LSF_NSPLIT*LPC_N_MAX];
+       unsigned char *pbytes;
+       int diff, start_pos, state_first;
+       float en1, en2;
+       int index, ulp, firstpart;
+       int subcount, subframe;
+       float weightState[LPC_FILTERORDER];
+       float syntdenum[NSUB_MAX*(LPC_FILTERORDER+1)];
+       float weightdenum[NSUB_MAX*(LPC_FILTERORDER+1)];
+       float decresidual[BLOCKL_MAX];
+
+       /* high pass filtering of input signal if such is not done
+              prior to calling this function */
+
+       hpInput(block, iLBCenc_inst->blockl,
+                   data, (*iLBCenc_inst).hpimem);
+
+       /* otherwise simply copy */
+
+       /*memcpy(data,block,iLBCenc_inst->blockl*sizeof(float));*/
+
+       /* LPC of hp filtered input data */
+
+       LPCencode(syntdenum, weightdenum, lsf_i, data, iLBCenc_inst);
+
+
+       /* inverse filter to get residual */
+
+       for (n=0; n<iLBCenc_inst->nsub; n++) {
+           anaFilter(&data[n*SUBL], &syntdenum[n*(LPC_FILTERORDER+1)],
+               SUBL, &residual[n*SUBL], iLBCenc_inst->anaMem);
+       }
+
+       /* find state location */
+
+       start = FrameClassify(iLBCenc_inst, residual);
+
+       /* check if state should be in first or last part of the
+       two subframes */
+
+       diff = STATE_LEN - iLBCenc_inst->state_short_len;
+       en1 = 0;
+       index = (start-1)*SUBL;
+
+
+
+
+
+       for (i = 0; i < iLBCenc_inst->state_short_len; i++) {
+           en1 += residual[index+i]*residual[index+i];
+       }
+       en2 = 0;
+       index = (start-1)*SUBL+diff;
+       for (i = 0; i < iLBCenc_inst->state_short_len; i++) {
+           en2 += residual[index+i]*residual[index+i];
+       }
+
+
+       if (en1 > en2) {
+           state_first = 1;
+           start_pos = (start-1)*SUBL;
+       } else {
+           state_first = 0;
+           start_pos = (start-1)*SUBL + diff;
+       }
+
+       /* scalar quantization of state */
+
+       StateSearchW(iLBCenc_inst, &residual[start_pos],
+           &syntdenum[(start-1)*(LPC_FILTERORDER+1)],
+           &weightdenum[(start-1)*(LPC_FILTERORDER+1)], &idxForMax,
+           idxVec, iLBCenc_inst->state_short_len, state_first);
+
+       StateConstructW(idxForMax, idxVec,
+           &syntdenum[(start-1)*(LPC_FILTERORDER+1)],
+           &decresidual[start_pos], iLBCenc_inst->state_short_len);
+
+       /* predictive quantization in state */
+
+       if (state_first) { /* put adaptive part in the end */
+
+           /* setup memory */
+
+           memset(mem, 0,
+               (CB_MEML-iLBCenc_inst->state_short_len)*sizeof(float));
+           memcpy(mem+CB_MEML-iLBCenc_inst->state_short_len,
+               decresidual+start_pos,
+               iLBCenc_inst->state_short_len*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+
+           /* encode sub-frames */
+
+           iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index,
+               &residual[start_pos+iLBCenc_inst->state_short_len],
+               mem+CB_MEML-stMemLTbl,
+               stMemLTbl, diff, CB_NSTAGES,
+
+
+
+
+
+               &weightdenum[start*(LPC_FILTERORDER+1)],
+               weightState, 0);
+
+           /* construct decoded vector */
+
+           iCBConstruct(
+               &decresidual[start_pos+iLBCenc_inst->state_short_len],
+               extra_cb_index, extra_gain_index,
+               mem+CB_MEML-stMemLTbl,
+               stMemLTbl, diff, CB_NSTAGES);
+
+       }
+       else { /* put adaptive part in the beginning */
+
+           /* create reversed vectors for prediction */
+
+           for (k=0; k<diff; k++) {
+               reverseResidual[k] = residual[(start+1)*SUBL-1
+                   -(k+iLBCenc_inst->state_short_len)];
+           }
+
+           /* setup memory */
+
+           meml_gotten = iLBCenc_inst->state_short_len;
+           for (k=0; k<meml_gotten; k++) {
+               mem[CB_MEML-1-k] = decresidual[start_pos + k];
+           }
+           memset(mem, 0, (CB_MEML-k)*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+
+           /* encode sub-frames */
+
+           iCBSearch(iLBCenc_inst, extra_cb_index, extra_gain_index,
+               reverseResidual, mem+CB_MEML-stMemLTbl, stMemLTbl,
+               diff, CB_NSTAGES,
+               &weightdenum[(start-1)*(LPC_FILTERORDER+1)],
+               weightState, 0);
+
+           /* construct decoded vector */
+
+           iCBConstruct(reverseDecresidual, extra_cb_index,
+               extra_gain_index, mem+CB_MEML-stMemLTbl, stMemLTbl,
+               diff, CB_NSTAGES);
+
+           /* get decoded residual from reversed vector */
+
+           for (k=0; k<diff; k++) {
+               decresidual[start_pos-1-k] = reverseDecresidual[k];
+
+
+
+
+
+           }
+       }
+
+       /* counter for predicted sub-frames */
+
+       subcount=0;
+
+       /* forward prediction of sub-frames */
+
+       Nfor = iLBCenc_inst->nsub-start-1;
+
+
+       if ( Nfor > 0 ) {
+
+           /* setup memory */
+
+           memset(mem, 0, (CB_MEML-STATE_LEN)*sizeof(float));
+           memcpy(mem+CB_MEML-STATE_LEN, decresidual+(start-1)*SUBL,
+               STATE_LEN*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+
+           /* loop over sub-frames to encode */
+
+           for (subframe=0; subframe<Nfor; subframe++) {
+
+               /* encode sub-frame */
+
+               iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES,
+                   gain_index+subcount*CB_NSTAGES,
+                   &residual[(start+1+subframe)*SUBL],
+                   mem+CB_MEML-memLfTbl[subcount],
+                   memLfTbl[subcount], SUBL, CB_NSTAGES,
+                   &weightdenum[(start+1+subframe)*
+                               (LPC_FILTERORDER+1)],
+                   weightState, subcount+1);
+
+               /* construct decoded vector */
+
+               iCBConstruct(&decresidual[(start+1+subframe)*SUBL],
+                   cb_index+subcount*CB_NSTAGES,
+                   gain_index+subcount*CB_NSTAGES,
+                   mem+CB_MEML-memLfTbl[subcount],
+                   memLfTbl[subcount], SUBL, CB_NSTAGES);
+
+               /* update memory */
+
+               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+               memcpy(mem+CB_MEML-SUBL,
+
+
+
+
+
+                   &decresidual[(start+1+subframe)*SUBL],
+                   SUBL*sizeof(float));
+               memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+
+               subcount++;
+           }
+       }
+
+
+       /* backward prediction of sub-frames */
+
+       Nback = start-1;
+
+
+       if ( Nback > 0 ) {
+
+           /* create reverse order vectors */
+
+           for (n=0; n<Nback; n++) {
+               for (k=0; k<SUBL; k++) {
+                   reverseResidual[n*SUBL+k] =
+                       residual[(start-1)*SUBL-1-n*SUBL-k];
+                   reverseDecresidual[n*SUBL+k] =
+                       decresidual[(start-1)*SUBL-1-n*SUBL-k];
+               }
+           }
+
+           /* setup memory */
+
+           meml_gotten = SUBL*(iLBCenc_inst->nsub+1-start);
+
+
+           if ( meml_gotten > CB_MEML ) {
+               meml_gotten=CB_MEML;
+           }
+           for (k=0; k<meml_gotten; k++) {
+               mem[CB_MEML-1-k] = decresidual[(start-1)*SUBL + k];
+           }
+           memset(mem, 0, (CB_MEML-k)*sizeof(float));
+           memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+
+           /* loop over sub-frames to encode */
+
+           for (subframe=0; subframe<Nback; subframe++) {
+
+               /* encode sub-frame */
+
+               iCBSearch(iLBCenc_inst, cb_index+subcount*CB_NSTAGES,
+
+
+
+
+
+                   gain_index+subcount*CB_NSTAGES,
+                   &reverseResidual[subframe*SUBL],
+                   mem+CB_MEML-memLfTbl[subcount],
+                   memLfTbl[subcount], SUBL, CB_NSTAGES,
+                   &weightdenum[(start-2-subframe)*
+                               (LPC_FILTERORDER+1)],
+                   weightState, subcount+1);
+
+               /* construct decoded vector */
+
+               iCBConstruct(&reverseDecresidual[subframe*SUBL],
+                   cb_index+subcount*CB_NSTAGES,
+                   gain_index+subcount*CB_NSTAGES,
+                   mem+CB_MEML-memLfTbl[subcount],
+                   memLfTbl[subcount], SUBL, CB_NSTAGES);
+
+               /* update memory */
+
+               memcpy(mem, mem+SUBL, (CB_MEML-SUBL)*sizeof(float));
+               memcpy(mem+CB_MEML-SUBL,
+                   &reverseDecresidual[subframe*SUBL],
+                   SUBL*sizeof(float));
+               memset(weightState, 0, LPC_FILTERORDER*sizeof(float));
+
+               subcount++;
+
+           }
+
+           /* get decoded residual from reversed vector */
+
+           for (i=0; i<SUBL*Nback; i++) {
+               decresidual[SUBL*Nback - i - 1] =
+                   reverseDecresidual[i];
+           }
+       }
+       /* end encoding part */
+
+       /* adjust index */
+       index_conv_enc(cb_index);
+
+       /* pack bytes */
+
+       pbytes=bytes;
+       pos=0;
+
+       /* loop over the 3 ULP classes */
+
+       for (ulp=0; ulp<3; ulp++) {
+
+
+
+
+
+
+           /* LSF */
+           for (k=0; k<LSF_NSPLIT*iLBCenc_inst->lpc_n; k++) {
+               packsplit(&lsf_i[k], &firstpart, &lsf_i[k],
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp],
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp]+
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+1]+
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp+2]);
+               dopack( &pbytes, firstpart,
+                   iLBCenc_inst->ULP_inst->lsf_bits[k][ulp], &pos);
+           }
+
+           /* Start block info */
+
+           packsplit(&start, &firstpart, &start,
+               iLBCenc_inst->ULP_inst->start_bits[ulp],
+               iLBCenc_inst->ULP_inst->start_bits[ulp]+
+               iLBCenc_inst->ULP_inst->start_bits[ulp+1]+
+               iLBCenc_inst->ULP_inst->start_bits[ulp+2]);
+           dopack( &pbytes, firstpart,
+               iLBCenc_inst->ULP_inst->start_bits[ulp], &pos);
+
+           packsplit(&state_first, &firstpart, &state_first,
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp],
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp]+
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp+1]+
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp+2]);
+           dopack( &pbytes, firstpart,
+               iLBCenc_inst->ULP_inst->startfirst_bits[ulp], &pos);
+
+           packsplit(&idxForMax, &firstpart, &idxForMax,
+               iLBCenc_inst->ULP_inst->scale_bits[ulp],
+               iLBCenc_inst->ULP_inst->scale_bits[ulp]+
+               iLBCenc_inst->ULP_inst->scale_bits[ulp+1]+
+               iLBCenc_inst->ULP_inst->scale_bits[ulp+2]);
+           dopack( &pbytes, firstpart,
+               iLBCenc_inst->ULP_inst->scale_bits[ulp], &pos);
+
+           for (k=0; k<iLBCenc_inst->state_short_len; k++) {
+               packsplit(idxVec+k, &firstpart, idxVec+k,
+                   iLBCenc_inst->ULP_inst->state_bits[ulp],
+                   iLBCenc_inst->ULP_inst->state_bits[ulp]+
+                   iLBCenc_inst->ULP_inst->state_bits[ulp+1]+
+                   iLBCenc_inst->ULP_inst->state_bits[ulp+2]);
+               dopack( &pbytes, firstpart,
+                   iLBCenc_inst->ULP_inst->state_bits[ulp], &pos);
+           }
+
+
+
+
+
+
+           /* 23/22 (20ms/30ms) sample block */
+
+           for (k=0;k<CB_NSTAGES;k++) {
+               packsplit(extra_cb_index+k, &firstpart,
+                   extra_cb_index+k,
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp],
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp]+
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+1]+
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp+2]);
+               dopack( &pbytes, firstpart,
+                   iLBCenc_inst->ULP_inst->extra_cb_index[k][ulp],
+                   &pos);
+           }
+
+           for (k=0;k<CB_NSTAGES;k++) {
+               packsplit(extra_gain_index+k, &firstpart,
+                   extra_gain_index+k,
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp],
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp]+
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+1]+
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp+2]);
+               dopack( &pbytes, firstpart,
+                   iLBCenc_inst->ULP_inst->extra_cb_gain[k][ulp],
+                   &pos);
+           }
+
+           /* The two/four (20ms/30ms) 40 sample sub-blocks */
+
+           for (i=0; i<iLBCenc_inst->nasub; i++) {
+               for (k=0; k<CB_NSTAGES; k++) {
+                   packsplit(cb_index+i*CB_NSTAGES+k, &firstpart,
+                       cb_index+i*CB_NSTAGES+k,
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp],
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp]+
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+1]+
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp+2]);
+                   dopack( &pbytes, firstpart,
+                       iLBCenc_inst->ULP_inst->cb_index[i][k][ulp],
+                       &pos);
+               }
+           }
+
+           for (i=0; i<iLBCenc_inst->nasub; i++) {
+               for (k=0; k<CB_NSTAGES; k++) {
+                   packsplit(gain_index+i*CB_NSTAGES+k, &firstpart,
+                       gain_index+i*CB_NSTAGES+k,
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp],
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp]+
+
+
+
+
+
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+1]+
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp+2]);
+                   dopack( &pbytes, firstpart,
+                       iLBCenc_inst->ULP_inst->cb_gain[i][k][ulp],
+                       &pos);
+               }
+           }
+       }
+
+       /* set the last bit to zero (otherwise the decoder
+          will treat it as a lost frame) */
+       dopack( &pbytes, 0, 1, &pos);
+   }
+
diff --git a/jni/pjproject-android/.svn/pristine/c3/c3139837af56084f00d20512a70990cf09ef0019.svn-base b/jni/pjproject-android/.svn/pristine/c3/c3139837af56084f00d20512a70990cf09ef0019.svn-base
new file mode 100644
index 0000000..c76ef68
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c3139837af56084f00d20512a70990cf09ef0019.svn-base
@@ -0,0 +1,108 @@
+// Microsoft Visual C++ generated resource script.

+//

+#include "resource.h"

+

+#define APSTUDIO_READONLY_SYMBOLS

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

+//

+// Generated from the TEXTINCLUDE 2 resource.

+//

+#include "afxres.h"

+

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

+#undef APSTUDIO_READONLY_SYMBOLS

+

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

+// English (U.S.) resources

+

+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)

+#ifdef _WIN32

+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US

+#pragma code_page(1252)

+#endif //_WIN32

+

+#ifdef APSTUDIO_INVOKED

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

+//

+// TEXTINCLUDE

+//

+

+1 TEXTINCLUDE 

+BEGIN

+    "resource.h\0"

+END

+

+2 TEXTINCLUDE 

+BEGIN

+    "#include ""afxres.h""\r\n"

+    "\0"

+END

+

+3 TEXTINCLUDE 

+BEGIN

+    "#include ""pjsystest_wince.rc2""\r\n"

+    "\r\n"

+    "\0"

+END

+

+#endif    // APSTUDIO_INVOKED

+

+

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

+//

+// Dialog

+//

+

+IDD_MAIN_DIALOG DIALOG  0, 0, 82, 73

+STYLE DS_SETFONT | WS_VISIBLE | WS_VSCROLL

+FONT 8, "MS Sans Serif"

+BEGIN

+    EDITTEXT        IDC_EDIT1,7,7,57,59,ES_MULTILINE | ES_AUTOVSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP

+END

+

+

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

+//

+// DESIGNINFO

+//

+

+#ifdef APSTUDIO_INVOKED

+GUIDELINES DESIGNINFO 

+BEGIN

+    IDD_MAIN_DIALOG, DIALOG

+    BEGIN

+        LEFTMARGIN, 7

+        RIGHTMARGIN, 64

+        TOPMARGIN, 7

+        BOTTOMMARGIN, 66

+    END

+END

+#endif    // APSTUDIO_INVOKED

+

+

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

+//

+// String Table

+//

+

+STRINGTABLE 

+BEGIN

+    IDS_MAIN_TITLE          "PJSYSTEST"

+END

+

+#endif    // English (U.S.) resources

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

+

+

+

+#ifndef APSTUDIO_INVOKED

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

+//

+// Generated from the TEXTINCLUDE 3 resource.

+//

+#include "pjsystest_wince.rc2"

+

+

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

+#endif    // not APSTUDIO_INVOKED

+

diff --git a/jni/pjproject-android/.svn/pristine/c3/c339cc19f804d3ae674c0080e5185dd2b5e6d468.svn-base b/jni/pjproject-android/.svn/pristine/c3/c339cc19f804d3ae674c0080e5185dd2b5e6d468.svn-base
new file mode 100644
index 0000000..187372d
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c339cc19f804d3ae674c0080e5185dd2b5e6d468.svn-base
@@ -0,0 +1,20 @@
+export CC := cl /c /nologo
+export AR := lib /NOLOGO /OUT:
+export LD := cl /nologo
+export LDOUT := /Fe
+export RANLIB := echo ranlib
+
+export OBJEXT := .obj
+export LIBEXT := .lib
+export LIBEXT2 := .LIB
+
+export CC_OUT := /Fo
+export CC_INC := /I
+export CC_DEF := /D
+export CC_OPTIMIZE := /Ox
+export CC_LIB :=
+
+export CC_SOURCES :=
+export CC_CFLAGS := /W4 /MT
+export CC_CXXFLAGS := /GX
+export CC_LDFLAGS := /MT 
diff --git a/jni/pjproject-android/.svn/pristine/c3/c3440e62909d24fe411c6c7b6d4060ff3c63f075.svn-base b/jni/pjproject-android/.svn/pristine/c3/c3440e62909d24fe411c6c7b6d4060ff3c63f075.svn-base
new file mode 100644
index 0000000..d73ff3d
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c3440e62909d24fe411c6c7b6d4060ff3c63f075.svn-base
@@ -0,0 +1,117 @@
+/* $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_UTIL_DNS_SERVER_H__
+#define __PJLIB_UTIL_DNS_SERVER_H__
+
+/**
+ * @file dns_server.h
+ * @brief Simple DNS server
+ */
+#include <pjlib-util/types.h>
+#include <pjlib-util/dns.h>
+
+PJ_BEGIN_DECL
+
+/**
+ * @defgroup PJ_DNS_SERVER Simple DNS Server
+ * @ingroup PJ_DNS
+ * @{
+ * This contains a simple but fully working DNS server implementation, 
+ * mostly for testing purposes. It supports serving various DNS resource 
+ * records such as SRV, CNAME, A, and AAAA.
+ */
+
+/**
+ * Opaque structure to hold DNS server instance.
+ */
+typedef struct pj_dns_server pj_dns_server;
+
+/**
+ * Create the DNS server instance. The instance will run immediately.
+ *
+ * @param pf	    The pool factory to create memory pools.
+ * @param ioqueue   Ioqueue instance where the server socket will be
+ *		    registered to.
+ * @param af	    Address family of the server socket (valid values
+ *		    are pj_AF_INET() for IPv4 and pj_AF_INET6() for IPv6).
+ * @param port	    The UDP port to listen.
+ * @param flags	    Flags, currently must be zero.
+ * @param p_srv	    Pointer to receive the DNS server instance.
+ *
+ * @return	    PJ_SUCCESS if server has been created successfully,
+ *		    otherwise the function will return the appropriate
+ *		    error code.
+ */
+PJ_DECL(pj_status_t) pj_dns_server_create(pj_pool_factory *pf,
+				          pj_ioqueue_t *ioqueue,
+					  int af,
+					  unsigned port,
+					  unsigned flags,
+				          pj_dns_server **p_srv);
+
+/**
+ * Destroy DNS server instance.
+ *
+ * @param srv	    The DNS server instance.
+ *
+ * @return	    PJ_SUCCESS on success or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_dns_server_destroy(pj_dns_server *srv);
+
+
+/**
+ * Add generic resource record entries to the server.
+ *
+ * @param srv	    The DNS server instance.
+ * @param count	    Number of records to be added.
+ * @param rr	    Array of records to be added.
+ *
+ * @return	    PJ_SUCCESS on success or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_dns_server_add_rec(pj_dns_server *srv,
+					   unsigned count,
+					   const pj_dns_parsed_rr rr[]);
+
+/**
+ * Remove the specified record from the server.
+ *
+ * @param srv	    The DNS server instance.
+ * @param dns_class The resource's DNS class. Valid value is PJ_DNS_CLASS_IN.
+ * @param type	    The resource type.
+ * @param name	    The resource name to be removed.
+ *
+ * @return	    PJ_SUCCESS on success or the appropriate error code.
+ */
+PJ_DECL(pj_status_t) pj_dns_server_del_rec(pj_dns_server *srv,
+					   int dns_class,
+					   pj_dns_type type,
+					   const pj_str_t *name);
+
+
+
+/**
+ * @}
+ */
+
+PJ_END_DECL
+
+
+#endif	/* __PJLIB_UTIL_DNS_SERVER_H__ */
+
diff --git a/jni/pjproject-android/.svn/pristine/c3/c35ca1e289f1e595c044b28fd784cfc62d0ab36a.svn-base b/jni/pjproject-android/.svn/pristine/c3/c35ca1e289f1e595c044b28fd784cfc62d0ab36a.svn-base
new file mode 100644
index 0000000..88fd249
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c35ca1e289f1e595c044b28fd784cfc62d0ab36a.svn-base
@@ -0,0 +1,25 @@
+# $Id$
+import inc_sip as sip
+import inc_sdp as sdp
+
+# Torture message from RFC 4475
+# 3.1.1.  Valid Messages
+# 3.1.1.2.  Wide Range of Valid Characters
+complete_msg = \
+"""!interesting-Method0123456789_*+`.%indeed'~ sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*:&it+has=1,weird!*pas$wo~d_too.(doesn't-it)@example.com SIP/2.0
+Via: SIP/2.0/UDP host1.example.com;rport;branch=z9hG4bK-.!%66*_+`'~
+To: "BEL:\\\x07 NUL:\\\x00 DEL:\\\x7F" <sip:1_unusual.URI~(to-be!sure)&isn't+it$/crazy?,/;;*@example.com>
+From: token1~` token2'+_ token3*%!.- <sip:mundane@example.com> ;fromParam''~+*_!.-%="\xD1\x80\xD0\xB0\xD0\xB1\xD0\xBE\xD1\x82\xD0\xB0\xD1\x8E\xD1\x89\xD0\xB8\xD0\xB9";tag=_token~1'+`*%!-.
+Call-ID: intmeth.word%ZK-!.*_+'@word`~)(><:\\/"][?}{
+CSeq: 139122385 !interesting-Method0123456789_*+`.%indeed'~
+Max-Forwards: 255
+extensionHeader-!.%*+_`'~: \xEF\xBB\xBF\xE5\xA4\xA7\xE5\x81\x9C\xE9\x9B\xBB
+Content-Length: 0
+
+"""
+
+
+sendto_cfg = sip.SendtoCfg( "RFC 4475 3.1.1.2", 
+			    "--null-audio --auto-answer 200", 
+			    "", 405, complete_msg=complete_msg)
+
diff --git a/jni/pjproject-android/.svn/pristine/c3/c35ed385f9d002b561067e18598488d535a32ce3.svn-base b/jni/pjproject-android/.svn/pristine/c3/c35ed385f9d002b561067e18598488d535a32ce3.svn-base
new file mode 100644
index 0000000..697dc6a
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c35ed385f9d002b561067e18598488d535a32ce3.svn-base
@@ -0,0 +1 @@
+#include "../../../portaudio/include/pa_win_wmme.h"
diff --git a/jni/pjproject-android/.svn/pristine/c3/c3b8ffeadef637c168c473104234a3e6175ff99d.svn-base b/jni/pjproject-android/.svn/pristine/c3/c3b8ffeadef637c168c473104234a3e6175ff99d.svn-base
new file mode 100644
index 0000000..3dd5b76
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c3b8ffeadef637c168c473104234a3e6175ff99d.svn-base
@@ -0,0 +1,271 @@
+/******************************************************************************
+**
+**   ITU-T G.722.1 (2005-05) - Fixed point implementation for main body and Annex C
+**   > Software Release 2.1 (2008-06)
+**     (Simple repackaging; no change from 2005-05 Release 2.0 code)
+**
+**   © 2004 Polycom, Inc.
+**
+**	 All rights reserved.
+**
+******************************************************************************/
+
+/******************************************************************************
+* Filename: samples_to_rmlt_coefs.c
+*
+* Purpose:  Convert Samples to Reversed MLT (Modulated Lapped Transform) 
+*           Coefficients
+*
+*     The "Reversed MLT" is an overlapped block transform which uses
+*     even symmetry * on the left, odd symmetry on the right and a
+*     Type IV DCT as the block transform.  * It is thus similar to a
+*     MLT which uses odd symmetry on the left, even symmetry * on the
+*     right and a Type IV DST as the block transform.  In fact, it is
+*     equivalent * to reversing the order of the samples, performing
+*     an MLT and then negating all * the even-numbered coefficients.
+*
+******************************************************************************/
+
+/***************************************************************************
+ Include files                                                           
+***************************************************************************/
+#include "defs.h"
+#include "tables.h"
+#include "count.h"
+
+/***************************************************************************
+ Function:    samples_to_rmlt_coefs 
+
+ Syntax:      Word16 samples_to_rmlt_coefs(new_samples, 
+                                           old_samples,
+                                           coefs,
+                                           dct_length)
+                    Word16 *new_samples;           
+                    Word16 *old_samples;           
+                    Word16 *coefs;                 
+                    Word16 dct_length;
+
+ Description: Convert samples to MLT coefficients
+
+ Design Notes:
+
+ WMOPS:     7kHz |    24kbit    |     32kbit
+          -------|--------------|----------------
+            AVG  |    1.40      |     1.40
+          -------|--------------|----------------  
+            MAX  |    1.40      |     1.40
+          -------|--------------|---------------- 
+				
+           14kHz |    24kbit    |     32kbit     |     48kbit
+          -------|--------------|----------------|----------------
+            AVG  |    3.07      |     3.07       |     3.07
+          -------|--------------|----------------|----------------
+            MAX  |    3.10      |     3.10       |     3.10
+          -------|--------------|----------------|----------------
+				
+***************************************************************************/
+
+Word16 samples_to_rmlt_coefs(const Word16 *new_samples,Word16 *old_samples,Word16 *coefs,Word16 dct_length)
+{
+
+    Word16	index, vals_left,mag_shift,n;
+    Word16	windowed_data[MAX_DCT_LENGTH];
+    Word16	*old_ptr;
+    const Word16 *new_ptr, *sam_low, *sam_high;
+    Word16	*win_low, *win_high;
+    Word16	*dst_ptr;
+    Word16  neg_win_low;
+    Word16  samp_high;
+    Word16  half_dct_size;
+    
+    Word32	acca;
+    Word32	accb;
+    Word16	temp;
+    Word16	temp1;
+    Word16	temp2;
+    Word16	temp5;
+   
+    half_dct_size = shr_nocheck(dct_length,1);
+   
+    /*++++++++++++++++++++++++++++++++++++++++++++*/
+    /* Get the first half of the windowed samples */
+    /*++++++++++++++++++++++++++++++++++++++++++++*/
+    
+    dst_ptr  = windowed_data;
+    move16();
+    
+    /* address arithmetic */
+    test();
+    if (dct_length==DCT_LENGTH)
+    {
+        win_high = samples_to_rmlt_window + half_dct_size;
+    }
+    else
+    {
+        win_high = max_samples_to_rmlt_window + half_dct_size;
+    }
+    
+    win_low  = win_high;
+    move16();
+    
+    /* address arithmetic */
+    sam_high = old_samples + half_dct_size;
+    
+    sam_low  = sam_high;
+    move16();
+    
+    for (vals_left = half_dct_size;vals_left > 0;vals_left--)
+    {
+        acca = 0L;
+        move32();
+        
+        acca = L_mac(acca,*--win_low, *--sam_low);
+        acca = L_mac(acca,*win_high++, *sam_high++);
+        temp = itu_round(acca); 
+        
+        *dst_ptr++ = temp;
+        move16();
+    }           
+    
+    /*+++++++++++++++++++++++++++++++++++++++++++++*/
+    /* Get the second half of the windowed samples */
+    /*+++++++++++++++++++++++++++++++++++++++++++++*/
+    
+    sam_low  = new_samples;
+    move16();
+
+    /* address arithmetic */
+    sam_high = new_samples + dct_length;
+    
+    for (vals_left = half_dct_size;    vals_left > 0;    vals_left--)
+    {
+        acca = 0L;
+        move32();
+
+        acca = L_mac(acca,*--win_high, *sam_low++);
+        neg_win_low = negate(*win_low++);
+        samp_high = *--sam_high;
+        acca = L_mac(acca, neg_win_low, samp_high);
+        temp = itu_round(acca); 
+        
+        *dst_ptr++=temp;
+        move16();
+    }
+       
+    /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+    /* Save the new samples for next time, when they will be the old samples */
+    /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+    
+    new_ptr = new_samples;
+    move16();
+
+    old_ptr = old_samples;
+    move16();
+
+    for (vals_left = dct_length;vals_left > 0;vals_left--)
+    {
+        *old_ptr++ = *new_ptr++;
+        move16();
+    }
+    
+    /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+    /* Calculate how many bits to shift up the input to the DCT.             */
+    /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+    
+    temp1=0;
+    move16();
+
+    for(index=0;index<dct_length;index++)
+    {
+        temp2 = abs_s(windowed_data[index]);
+        temp = sub(temp2,temp1);
+        test();
+        if(temp > 0)
+        {
+            move16();
+            temp1 = temp2;
+        }
+    }
+    
+    mag_shift=0;
+    move16();
+
+    temp = sub(temp1,14000);
+    test();
+    if (temp >= 0)
+    {
+        mag_shift = 0;
+        move16();
+    }
+    else
+    {
+        temp = sub(temp1,438);
+        test();
+        if(temp < 0)
+            temp = add(temp1,1);
+        else 
+        {
+            temp = temp1;
+            move16();
+        }
+        accb = L_mult(temp,9587);
+        acca = L_shr_nocheck(accb,20);
+        temp5 = extract_l(acca);
+        temp = norm_s(temp5);
+        test();
+        if (temp == 0)
+        {
+            mag_shift = 9;
+            move16();
+        }
+        else
+            mag_shift = sub(temp,6);
+        
+    }
+
+    acca = 0L;
+    move32();
+    for(index=0; index<dct_length; index++)
+    {
+        temp = abs_s( windowed_data[index]);
+        acca = L_add(acca,temp);
+    }
+    
+    acca = L_shr_nocheck(acca,7);
+    
+    test();
+    if (temp1 < acca)
+    {
+        mag_shift = sub(mag_shift,1);
+    }
+
+    test();
+    if (mag_shift > 0) 
+    {
+        for(index=0;index<dct_length;index++)
+        {
+            windowed_data[index] = shl_nocheck(windowed_data[index],mag_shift);
+        }
+    }
+    else 
+    {
+        test();
+        if (mag_shift < 0) 
+        {
+            n = negate(mag_shift);
+            for(index=0;index<dct_length;index++)
+            {
+                windowed_data[index] = shr_nocheck(windowed_data[index],n);
+                move16();
+            }
+        }
+    }
+
+    /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+    /* Perform a Type IV DCT on the windowed data to get the coefficients */
+    /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
+
+    dct_type_iv_a(windowed_data, coefs, dct_length);
+
+    return(mag_shift);
+}
diff --git a/jni/pjproject-android/.svn/pristine/c3/c3b910b30cc6a947e68fa157e0dabe6536375707.svn-base b/jni/pjproject-android/.svn/pristine/c3/c3b910b30cc6a947e68fa157e0dabe6536375707.svn-base
new file mode 100644
index 0000000..05f3a30
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c3b910b30cc6a947e68fa157e0dabe6536375707.svn-base
@@ -0,0 +1,11 @@
+# $Id$
+#
+from inc_cfg import *
+
+# simple test
+test_param = TestParam(
+		"Resample (large filter) 8 KHZ to 32 KHZ",
+		[
+			InstanceParam("endpt", "--null-audio --quality 10 --clock-rate 32000 --play-file wavs/input.8.wav --rec-file wavs/tmp.32.wav")
+		]
+		)
diff --git a/jni/pjproject-android/.svn/pristine/c3/c3c2ad8261d520549e15511cd3d31cc52dfd0dac.svn-base b/jni/pjproject-android/.svn/pristine/c3/c3c2ad8261d520549e15511cd3d31cc52dfd0dac.svn-base
new file mode 100644
index 0000000..bb84498
--- /dev/null
+++ b/jni/pjproject-android/.svn/pristine/c3/c3c2ad8261d520549e15511cd3d31cc52dfd0dac.svn-base
@@ -0,0 +1,92 @@
+/* $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_UTIL_BASE64_H__
+#define __PJLIB_UTIL_BASE64_H__
+
+/**
+ * @file base64.h
+ * @brief Base64 encoding and decoding
+ */
+
+#include <pjlib-util/types.h>
+
+PJ_BEGIN_DECL
+
+/**
+ * @defgroup PJLIB_UTIL_BASE64 Base64 Encoding/Decoding
+ * @ingroup PJLIB_UTIL_ENCRYPTION
+ * @{
+ * This module implements base64 encoding and decoding.
+ */
+
+/**
+ * Helper macro to calculate the approximate length required for base256 to
+ * base64 conversion.
+ */
+#define PJ_BASE256_TO_BASE64_LEN(len)	(len * 4 / 3 + 3)
+
+/**
+ * Helper macro to calculate the approximage length required for base64 to
+ * base256 conversion.
+ */
+#define PJ_BASE64_TO_BASE256_LEN(len)	(len * 3 / 4)
+
+
+/**
+ * Encode a buffer into base64 encoding.
+ *
+ * @param input	    The input buffer.
+ * @param in_len    Size of the input buffer.
+ * @param output    Output buffer. Caller must allocate this buffer with
+ *		    the appropriate size.
+ * @param out_len   On entry, it specifies the length of the output buffer. 
+ *		    Upon return, this will be filled with the actual
+ *		    length of the output buffer.
+ *
+ * @return	    PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pj_base64_encode(const pj_uint8_t *input, int in_len,
+				     char *output, int *out_len);
+
+
+/**
+ * Decode base64 string.
+ *
+ * @param input	    Input string.
+ * @param out	    Buffer to store the output. Caller must allocate
+ *		    this buffer with the appropriate size.
+ * @param out_len   On entry, it specifies the length of the output buffer. 
+ *		    Upon return, this will be filled with the actual
+ *		    length of the output.
+ */
+PJ_DECL(pj_status_t) pj_base64_decode(const pj_str_t *input, 
+				      pj_uint8_t *out, int *out_len);
+
+
+
+/**
+ * @}
+ */
+
+PJ_END_DECL
+
+
+#endif	/* __PJLIB_UTIL_BASE64_H__ */
+