summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2014-02-04 10:13:56 +0000
committerBenny Prijono <bennylp@teluu.com>2014-02-04 10:13:56 +0000
commit0c03f9d1a434ca591f40980eff388daff653ce0d (patch)
tree00bd27f374d46c7825a372e7892de140c1a9e5e4 /pjsip
parent1342a94d5cbd8820f83ef59adcb18d14f566a3de (diff)
Misc (re #1630): Fixing warnings about variable set but not used with recent gcc
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4728 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsip/sip_auth_client.c95
-rw-r--r--pjsip/src/pjsip/sip_dialog.c198
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c397
-rw-r--r--pjsip/src/test/tsx_uas_test.c132
-rw-r--r--pjsip/src/test/uri_test.c47
5 files changed, 436 insertions, 433 deletions
diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c
index b337e1ef..55f5e894 100644
--- a/pjsip/src/pjsip/sip_auth_client.c
+++ b/pjsip/src/pjsip/sip_auth_client.c
@@ -1,5 +1,5 @@
/* $Id$ */
-/*
+/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
@@ -15,7 +15,7 @@
*
* 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <pjsip/sip_auth.h>
@@ -137,7 +137,7 @@ static void digest2str(const unsigned char digest[], char *output)
/*
* Create response digest based on the parameters and store the
- * digest ASCII in 'result'.
+ * digest ASCII in 'result'.
*/
PJ_DEF(void) pjsip_auth_create_digest( pj_str_t *result,
const pj_str_t *nonce,
@@ -159,8 +159,8 @@ PJ_DEF(void) pjsip_auth_create_digest( pj_str_t *result,
AUTH_TRACE_((THIS_FILE, "Begin creating digest"));
if ((cred_info->data_type & PASSWD_MASK) == PJSIP_CRED_DATA_PLAIN_PASSWD) {
- /***
- *** ha1 = MD5(username ":" realm ":" password)
+ /***
+ *** ha1 = MD5(username ":" realm ":" password)
***/
pj_md5_init(&pms);
MD5_APPEND( &pms, cred_info->username.ptr, cred_info->username.slen);
@@ -182,7 +182,7 @@ PJ_DEF(void) pjsip_auth_create_digest( pj_str_t *result,
AUTH_TRACE_((THIS_FILE, " ha1=%.32s", ha1));
/***
- *** ha2 = MD5(method ":" req_uri)
+ *** ha2 = MD5(method ":" req_uri)
***/
pj_md5_init(&pms);
MD5_APPEND( &pms, method->ptr, method->slen);
@@ -195,7 +195,7 @@ PJ_DEF(void) pjsip_auth_create_digest( pj_str_t *result,
/***
*** When qop is not used:
- *** response = MD5(ha1 ":" nonce ":" ha2)
+ *** response = MD5(ha1 ":" nonce ":" ha2)
***
*** When qop=auth is used:
*** response = MD5(ha1 ":" nonce ":" nc ":" cnonce ":" qop ":" ha2)
@@ -217,7 +217,7 @@ PJ_DEF(void) pjsip_auth_create_digest( pj_str_t *result,
/* This is the final response digest. */
pj_md5_final(&pms, digest);
-
+
/* Convert digest to string and store in chal->response. */
result->slen = PJSIP_MD5STRLEN;
digest2str(digest, result->ptr);
@@ -258,7 +258,7 @@ static pj_bool_t has_auth_qop( pj_pool_t *pool, const pj_str_t *qop_offer)
}
/*
- * Generate response digest.
+ * Generate response digest.
* Most of the parameters to generate the digest (i.e. username, realm, uri,
* and nonce) are expected to be in the credential. Additional parameters (i.e.
* password and method param) should be supplied in the argument.
@@ -307,18 +307,18 @@ static pj_status_t respond_digest( pj_pool_t *pool,
if ((cred_info->data_type & EXT_MASK) == PJSIP_CRED_DATA_EXT_AKA) {
/* Call application callback to create the response digest */
- return (*cred_info->ext.aka.cb)(pool, chal, cred_info,
+ return (*cred_info->ext.aka.cb)(pool, chal, cred_info,
method, cred);
- }
+ }
else {
/* Convert digest to string and store in chal->response. */
- pjsip_auth_create_digest( &cred->response, &cred->nonce, NULL,
- NULL, NULL, uri, &chal->realm,
+ pjsip_auth_create_digest( &cred->response, &cred->nonce, NULL,
+ NULL, NULL, uri, &chal->realm,
cred_info, method);
}
} else if (has_auth_qop(pool, &chal->qop)) {
- /* Server requires quality of protection.
+ /* Server requires quality of protection.
* We respond with selecting "qop=auth" protection.
*/
cred->qop = pjsip_AUTH_STR;
@@ -334,18 +334,18 @@ static pj_status_t respond_digest( pj_pool_t *pool,
if ((cred_info->data_type & EXT_MASK) == PJSIP_CRED_DATA_EXT_AKA) {
/* Call application callback to create the response digest */
- return (*cred_info->ext.aka.cb)(pool, chal, cred_info,
+ return (*cred_info->ext.aka.cb)(pool, chal, cred_info,
method, cred);
}
else {
- pjsip_auth_create_digest( &cred->response, &cred->nonce,
- &cred->nc, cnonce, &pjsip_AUTH_STR,
+ pjsip_auth_create_digest( &cred->response, &cred->nonce,
+ &cred->nc, cnonce, &pjsip_AUTH_STR,
uri, &chal->realm, cred_info, method );
}
} else {
/* Server requires quality protection that we don't support. */
- PJ_LOG(4,(THIS_FILE, "Unsupported qop offer %.*s",
+ PJ_LOG(4,(THIS_FILE, "Unsupported qop offer %.*s",
chal->qop.slen, chal->qop.ptr));
return PJSIP_EINVALIDQOP;
}
@@ -357,7 +357,7 @@ static pj_status_t respond_digest( pj_pool_t *pool,
/*
* Update authentication session with a challenge.
*/
-static void update_digest_session( pj_pool_t *ses_pool,
+static void update_digest_session( pj_pool_t *ses_pool,
pjsip_cached_auth *cached_auth,
const pjsip_www_authenticate_hdr *hdr )
{
@@ -370,7 +370,7 @@ static void update_digest_session( pj_pool_t *ses_pool,
/* Only update if the new challenge is "significantly different"
* than the one in the cache, to reduce memory usage.
*/
- const pjsip_digest_challenge *d1 =
+ const pjsip_digest_challenge *d1 =
&cached_auth->last_chal->challenge.digest;
const pjsip_digest_challenge *d2 = &hdr->challenge.digest;
@@ -406,14 +406,14 @@ static void update_digest_session( pj_pool_t *ses_pool,
pj_assert(cached_auth->realm.slen != 0);
*/
if (cached_auth->realm.slen == 0) {
- pj_strdup(ses_pool, &cached_auth->realm,
+ pj_strdup(ses_pool, &cached_auth->realm,
&hdr->challenge.digest.realm);
}
} else {
/* Update last_nonce and nonce-count */
- if (!pj_strcmp(&hdr->challenge.digest.nonce,
- &cached_auth->last_chal->challenge.digest.nonce))
+ if (!pj_strcmp(&hdr->challenge.digest.nonce,
+ &cached_auth->last_chal->challenge.digest.nonce))
{
/* Same nonce, increment nonce-count */
++cached_auth->nc;
@@ -423,9 +423,9 @@ static void update_digest_session( pj_pool_t *ses_pool,
&hdr->challenge.digest.nonce);
/* Has the opaque changed? */
if (pj_strcmp(&cached_auth->last_chal->challenge.digest.opaque,
- &hdr->challenge.digest.opaque))
+ &hdr->challenge.digest.opaque))
{
- pj_strdup(ses_pool,
+ pj_strdup(ses_pool,
&cached_auth->last_chal->challenge.digest.opaque,
&hdr->challenge.digest.opaque);
}
@@ -484,7 +484,7 @@ static const pjsip_cred_info* auth_find_cred( const pjsip_auth_clt_sess *sess,
/* Init client session. */
PJ_DEF(pj_status_t) pjsip_auth_clt_init( pjsip_auth_clt_sess *sess,
pjsip_endpoint *endpt,
- pj_pool_t *pool,
+ pj_pool_t *pool,
unsigned options)
{
PJ_ASSERT_RETURN(sess && endpt && pool && (options==0), PJ_EINVAL);
@@ -509,15 +509,15 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_clone( pj_pool_t *pool,
PJ_ASSERT_RETURN(pool && sess && rhs, PJ_EINVAL);
pjsip_auth_clt_init(sess, (pjsip_endpoint*)rhs->endpt, pool, 0);
-
+
sess->cred_cnt = rhs->cred_cnt;
sess->cred_info = (pjsip_cred_info*)
- pj_pool_alloc(pool,
+ pj_pool_alloc(pool,
sess->cred_cnt*sizeof(pjsip_cred_info));
for (i=0; i<rhs->cred_cnt; ++i) {
pj_strdup(pool, &sess->cred_info[i].realm, &rhs->cred_info[i].realm);
pj_strdup(pool, &sess->cred_info[i].scheme, &rhs->cred_info[i].scheme);
- pj_strdup(pool, &sess->cred_info[i].username,
+ pj_strdup(pool, &sess->cred_info[i].username,
&rhs->cred_info[i].username);
sess->cred_info[i].data_type = rhs->cred_info[i].data_type;
pj_strdup(pool, &sess->cred_info[i].data, &rhs->cred_info[i].data);
@@ -552,7 +552,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *sess,
for (i=0; i<cred_cnt; ++i) {
sess->cred_info[i].data_type = c[i].data_type;
- /* When data_type is PJSIP_CRED_DATA_EXT_AKA,
+ /* When data_type is PJSIP_CRED_DATA_EXT_AKA,
* callback must be specified.
*/
if ((c[i].data_type & EXT_MASK) == PJSIP_CRED_DATA_EXT_AKA) {
@@ -568,11 +568,11 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *sess,
PJ_ASSERT_RETURN(c[i].ext.aka.cb != NULL, PJ_EINVAL);
/* Verify K len */
- PJ_ASSERT_RETURN(c[i].ext.aka.k.slen <= PJSIP_AKA_KLEN,
+ PJ_ASSERT_RETURN(c[i].ext.aka.k.slen <= PJSIP_AKA_KLEN,
PJSIP_EAUTHINAKACRED);
/* Verify OP len */
- PJ_ASSERT_RETURN(c[i].ext.aka.op.slen <= PJSIP_AKA_OPLEN,
+ PJ_ASSERT_RETURN(c[i].ext.aka.op.slen <= PJSIP_AKA_OPLEN,
PJSIP_EAUTHINAKACRED);
/* Verify AMF len */
@@ -630,7 +630,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_get_prefs(pjsip_auth_clt_sess *sess,
}
-/*
+/*
* Create Authorization/Proxy-Authorization response header based on the challege
* in WWW-Authenticate/Proxy-Authenticate header.
*/
@@ -785,7 +785,7 @@ static pj_status_t new_auth_for_req( pjsip_tx_data *tdata,
sess->pool, auth, &hauth);
if (status != PJ_SUCCESS)
return status;
-
+
pjsip_msg_add_hdr( tdata->msg, (pjsip_hdr*)hauth);
if (p_h_auth)
@@ -831,6 +831,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_init_req( pjsip_auth_clt_sess *sess,
/* Get the method. */
method = &tdata->msg->line.req.method;
+ PJ_UNUSED_ARG(method); /* Warning about unused var caused by #if below */
auth = sess->cached_auth.next;
while (auth != &sess->cached_auth) {
@@ -869,32 +870,32 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_init_req( pjsip_auth_clt_sess *sess,
}
# endif
- }
+ }
# if defined(PJSIP_AUTH_QOP_SUPPORT) && \
defined(PJSIP_AUTH_AUTO_SEND_NEXT) && \
(PJSIP_AUTH_QOP_SUPPORT && PJSIP_AUTH_AUTO_SEND_NEXT)
else if (auth->qop_value == PJSIP_AUTH_QOP_AUTH) {
- /* For qop="auth", we have to re-create the authorization header.
+ /* For qop="auth", we have to re-create the authorization header.
*/
const pjsip_cred_info *cred;
pjsip_authorization_hdr *hauth;
pj_status_t status;
- cred = auth_find_cred(sess, &auth->realm,
+ cred = auth_find_cred(sess, &auth->realm,
&auth->last_chal->scheme);
if (!cred) {
auth = auth->next;
continue;
}
- status = auth_respond( tdata->pool, auth->last_chal,
- tdata->msg->line.req.uri,
+ status = auth_respond( tdata->pool, auth->last_chal,
+ tdata->msg->line.req.uri,
cred,
&tdata->msg->line.req.method,
sess->pool, auth, &hauth);
if (status != PJ_SUCCESS)
return status;
-
+
//pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)hauth);
pj_list_push_back(&added, hauth);
}
@@ -983,7 +984,7 @@ static pj_status_t process_auth( pj_pool_t *req_pool,
hdr->type == PJSIP_H_PROXY_AUTHORIZATION))
{
sent_auth = (pjsip_authorization_hdr*) hdr;
- if (pj_stricmp(&hchal->challenge.common.realm,
+ if (pj_stricmp(&hchal->challenge.common.realm,
&sent_auth->credential.common.realm )==0)
{
/* If this authorization has empty response, remove it. */
@@ -1054,21 +1055,21 @@ static pj_status_t process_auth( pj_pool_t *req_pool,
}
/* Find credential to be used for the challenge. */
- cred = auth_find_cred( sess, &hchal->challenge.common.realm,
+ cred = auth_find_cred( sess, &hchal->challenge.common.realm,
&hchal->scheme);
if (!cred) {
const pj_str_t *realm = &hchal->challenge.common.realm;
- PJ_LOG(4,(THIS_FILE,
+ PJ_LOG(4,(THIS_FILE,
"Unable to set auth for %s: can not find credential for %.*s/%.*s",
- tdata->obj_name,
+ tdata->obj_name,
realm->slen, realm->ptr,
hchal->scheme.slen, hchal->scheme.ptr));
return PJSIP_ENOCREDENTIAL;
}
/* Respond to authorization challenge. */
- status = auth_respond( req_pool, hchal, uri, cred,
- &tdata->msg->line.req.method,
+ status = auth_respond( req_pool, hchal, uri, cred,
+ &tdata->msg->line.req.method,
sess->pool, cached_auth, h_auth);
return status;
}
@@ -1147,7 +1148,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess,
/* Create authorization header for this challenge, and update
* authorization session.
*/
- status = process_auth( tdata->pool, hchal, tdata->msg->line.req.uri,
+ status = process_auth( tdata->pool, hchal, tdata->msg->line.req.uri,
tdata, sess, cached_auth, &hauth);
if (status != PJ_SUCCESS)
return status;
diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c
index 9ddadb02..f0a5f815 100644
--- a/pjsip/src/pjsip/sip_dialog.c
+++ b/pjsip/src/pjsip/sip_dialog.c
@@ -1,5 +1,5 @@
/* $Id$ */
-/*
+/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
@@ -15,7 +15,7 @@
*
* 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <pjsip/sip_dialog.h>
#include <pjsip/sip_ua_layer.h>
@@ -73,8 +73,8 @@ static pj_status_t create_dialog( pjsip_user_agent *ua,
if (!endpt)
return PJ_EINVALIDOP;
- pool = pjsip_endpt_create_pool(endpt, "dlg%p",
- PJSIP_POOL_LEN_DIALOG,
+ pool = pjsip_endpt_create_pool(endpt, "dlg%p",
+ PJSIP_POOL_LEN_DIALOG,
PJSIP_POOL_INC_DIALOG);
if (!pool)
return PJ_ENOMEM;
@@ -194,8 +194,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
/* Init local info. */
dlg->local.info = pjsip_from_hdr_create(dlg->pool);
pj_strdup_with_null(dlg->pool, &dlg->local.info_str, local_uri);
- dlg->local.info->uri = pjsip_parse_uri(dlg->pool,
- dlg->local.info_str.ptr,
+ dlg->local.info->uri = pjsip_parse_uri(dlg->pool,
+ dlg->local.info_str.ptr,
dlg->local.info_str.slen, 0);
if (!dlg->local.info->uri) {
status = PJSIP_EINVALIDURI;
@@ -214,10 +214,10 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
dlg->local.cseq = dlg->local.first_cseq;
/* Init local contact. */
- pj_strdup_with_null(dlg->pool, &tmp,
+ pj_strdup_with_null(dlg->pool, &tmp,
local_contact ? local_contact : local_uri);
dlg->local.contact = (pjsip_contact_hdr*)
- pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr,
+ pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr,
tmp.slen, NULL);
if (!dlg->local.contact) {
status = PJSIP_EINVALIDURI;
@@ -227,8 +227,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
/* Init remote info. */
dlg->remote.info = pjsip_to_hdr_create(dlg->pool);
pj_strdup_with_null(dlg->pool, &dlg->remote.info_str, remote_uri);
- dlg->remote.info->uri = pjsip_parse_uri(dlg->pool,
- dlg->remote.info_str.ptr,
+ dlg->remote.info->uri = pjsip_parse_uri(dlg->pool,
+ dlg->remote.info_str.ptr,
dlg->remote.info_str.slen, 0);
if (!dlg->remote.info->uri) {
status = PJSIP_EINVALIDURI;
@@ -239,7 +239,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
if (PJSIP_URI_SCHEME_IS_SIP(dlg->remote.info->uri) ||
PJSIP_URI_SCHEME_IS_SIPS(dlg->remote.info->uri))
{
- pjsip_sip_uri *sip_uri = (pjsip_sip_uri *)
+ pjsip_sip_uri *sip_uri = (pjsip_sip_uri *)
pjsip_uri_get_uri(dlg->remote.info->uri);
if (!pj_list_empty(&sip_uri->header_param)) {
pj_str_t tmp;
@@ -248,10 +248,10 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
pj_list_init(&sip_uri->header_param);
/* Print URI */
- tmp.ptr = (char*) pj_pool_alloc(dlg->pool,
+ tmp.ptr = (char*) pj_pool_alloc(dlg->pool,
dlg->remote.info_str.slen);
tmp.slen = pjsip_uri_print(PJSIP_URI_IN_FROMTO_HDR,
- sip_uri, tmp.ptr,
+ sip_uri, tmp.ptr,
dlg->remote.info_str.slen);
if (tmp.slen < 1) {
@@ -282,7 +282,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
pj_list_init(&dlg->route_set);
/* Init client authentication session. */
- status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,
+ status = pjsip_auth_clt_init(&dlg->auth_sess, dlg->endpt,
dlg->pool, 0);
if (status != PJ_SUCCESS)
goto on_error;
@@ -332,11 +332,11 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
PJ_ASSERT_RETURN(rdata->msg_info.msg->type == PJSIP_REQUEST_MSG,
PJSIP_ENOTREQUESTMSG);
- /* Request must not have To tag.
+ /* Request must not have To tag.
* This should have been checked in the user agent (or application?).
*/
PJ_ASSERT_RETURN(rdata->msg_info.to->tag.slen == 0, PJ_EINVALIDOP);
-
+
/* The request must be a dialog establishing request. */
PJ_ASSERT_RETURN(
pjsip_method_creates_dialog(&rdata->msg_info.msg->line.req.method),
@@ -384,9 +384,9 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
/* Init local contact. */
/* TODO:
* Section 12.1.1, paragraph about using SIPS URI in Contact.
- * If the request that initiated the dialog contained a SIPS URI
- * in the Request-URI or in the top Record-Route header field value,
- * if there was any, or the Contact header field if there was no
+ * If the request that initiated the dialog contained a SIPS URI
+ * in the Request-URI or in the top Record-Route header field value,
+ * if there was any, or the Contact header field if there was no
* Record-Route header field, the Contact header field in the response
* MUST be a SIPS URI.
*/
@@ -395,7 +395,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
pj_strdup_with_null(dlg->pool, &tmp, contact);
dlg->local.contact = (pjsip_contact_hdr*)
- pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr,
+ pjsip_parse_hdr(dlg->pool, &HCONTACT, tmp.ptr,
tmp.slen, NULL);
if (!dlg->local.contact) {
status = PJSIP_EINVALIDURI;
@@ -408,7 +408,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
}
/* Init remote info from the From header. */
- dlg->remote.info = (pjsip_fromto_hdr*)
+ dlg->remote.info = (pjsip_fromto_hdr*)
pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
pjsip_fromto_hdr_set_to(dlg->remote.info);
@@ -425,7 +425,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
pj_strdup(dlg->pool, &dlg->remote.info_str, &tmp);
- /* Init remote's contact from Contact header.
+ /* Init remote's contact from Contact header.
* Iterate the Contact URI until we find sip: or sips: scheme.
*/
do {
@@ -451,7 +451,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
goto on_error;
}
- dlg->remote.contact = (pjsip_contact_hdr*)
+ dlg->remote.contact = (pjsip_contact_hdr*)
pjsip_hdr_clone(dlg->pool, (pjsip_hdr*)contact_hdr);
/* Init remote's CSeq from CSeq header */
@@ -463,22 +463,22 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
/* Initial role is UAS */
dlg->role = PJSIP_ROLE_UAS;
- /* Secure?
+ /* Secure?
* RFC 3261 Section 12.1.1:
- * If the request arrived over TLS, and the Request-URI contained a
+ * If the request arrived over TLS, and the Request-URI contained a
* SIPS URI, the 'secure' flag is set to TRUE.
*/
dlg->secure = PJSIP_TRANSPORT_IS_SECURE(rdata->tp_info.transport) &&
PJSIP_URI_SCHEME_IS_SIPS(rdata->msg_info.msg->line.req.uri);
/* Call-ID */
- dlg->call_id = (pjsip_cid_hdr*)
+ dlg->call_id = (pjsip_cid_hdr*)
pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
- /* Route set.
+ /* Route set.
* RFC 3261 Section 12.1.1:
- * The route set MUST be set to the list of URIs in the Record-Route
- * header field from the request, taken in order and preserving all URI
+ * The route set MUST be set to the list of URIs in the Record-Route
+ * header field from the request, taken in order and preserving all URI
* parameters. If no Record-Route header field is present in the request,
* the route set MUST be set to the empty set.
*/
@@ -498,7 +498,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
rr = rr->next;
if (rr == (void*)&rdata->msg_info.msg->hdr)
break;
- rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,
+ rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,
PJSIP_H_RECORD_ROUTE, rr);
}
dlg->route_set_frozen = PJ_TRUE;
@@ -620,7 +620,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
/* Check arguments. */
PJ_ASSERT_RETURN(first_dlg && rdata && new_dlg, PJ_EINVAL);
-
+
/* rdata must be response message. */
PJ_ASSERT_RETURN(msg->type == PJSIP_RESPONSE_MSG,
PJSIP_ENOTRESPONSEMSG);
@@ -648,7 +648,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
dlg->target = (pjsip_uri*) pjsip_uri_clone(dlg->pool, contact->uri);
/* Clone local info. */
- dlg->local.info = (pjsip_fromto_hdr*)
+ dlg->local.info = (pjsip_fromto_hdr*)
pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
/* Clone local tag. */
@@ -660,11 +660,11 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
dlg->local.cseq = first_dlg->local.cseq;
/* Clone local Contact. */
- dlg->local.contact = (pjsip_contact_hdr*)
+ dlg->local.contact = (pjsip_contact_hdr*)
pjsip_hdr_clone(dlg->pool, first_dlg->local.contact);
/* Clone remote info. */
- dlg->remote.info = (pjsip_fromto_hdr*)
+ dlg->remote.info = (pjsip_fromto_hdr*)
pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
/* Set remote tag from the response. */
@@ -689,7 +689,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
dlg->secure = PJSIP_URI_SCHEME_IS_SIPS(dlg->target);
/* Clone Call-ID header. */
- dlg->call_id = (pjsip_cid_hdr*)
+ dlg->call_id = (pjsip_cid_hdr*)
pjsip_hdr_clone(dlg->pool, first_dlg->call_id);
/* Get route-set from the response. */
@@ -707,7 +707,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
//dlg->route_set_frozen = PJ_TRUE;
/* Clone client authentication session. */
- status = pjsip_auth_clt_clone(dlg->pool, &dlg->auth_sess,
+ status = pjsip_auth_clt_clone(dlg->pool, &dlg->auth_sess,
&first_dlg->auth_sess);
if (status != PJ_SUCCESS)
goto on_error;
@@ -841,13 +841,13 @@ PJ_DEF(pj_status_t) pjsip_dlg_inc_session( pjsip_dialog *dlg,
*/
PJ_DEF(void) pjsip_dlg_inc_lock(pjsip_dialog *dlg)
{
- PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d",
+ PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_inc_lock(), sess_count=%d",
dlg->sess_count));
pj_mutex_lock(dlg->mutex_);
dlg->sess_count++;
- PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d",
+ PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_inc_lock(), sess_count=%d",
dlg->sess_count));
}
@@ -858,7 +858,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_try_inc_lock(pjsip_dialog *dlg)
{
pj_status_t status;
- PJ_LOG(6,(dlg->obj_name,"Entering pjsip_dlg_try_inc_lock(), sess_count=%d",
+ PJ_LOG(6,(dlg->obj_name,"Entering pjsip_dlg_try_inc_lock(), sess_count=%d",
dlg->sess_count));
status = pj_mutex_trylock(dlg->mutex_);
@@ -869,7 +869,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_try_inc_lock(pjsip_dialog *dlg)
dlg->sess_count++;
- PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_try_inc_lock(), sess_count=%d",
+ PJ_LOG(6,(dlg->obj_name, "Leaving pjsip_dlg_try_inc_lock(), sess_count=%d",
dlg->sess_count));
return PJ_SUCCESS;
@@ -884,7 +884,7 @@ PJ_DEF(void) pjsip_dlg_dec_lock(pjsip_dialog *dlg)
{
PJ_ASSERT_ON_FAIL(dlg!=NULL, return);
- PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d",
+ PJ_LOG(6,(dlg->obj_name, "Entering pjsip_dlg_dec_lock(), sess_count=%d",
dlg->sess_count));
pj_assert(dlg->sess_count > 0);
@@ -959,7 +959,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_add_usage( pjsip_dialog *dlg,
PJ_EINVAL);
PJ_ASSERT_RETURN(dlg->usage_cnt < PJSIP_MAX_MODULE, PJ_EBUG);
- PJ_LOG(5,(dlg->obj_name,
+ PJ_LOG(5,(dlg->obj_name,
"Module %.*s added as dialog usage, data=%p",
(int)mod->name.slen, mod->name.ptr, mod_data));
@@ -976,7 +976,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_add_usage( pjsip_dialog *dlg,
* call transfer on the same dialog.
* So return PJ_SUCCESS here.
*/
- PJ_LOG(4,(dlg->obj_name,
+ PJ_LOG(4,(dlg->obj_name,
"Module %.*s already registered as dialog usage, "
"updating the data %p",
(int)mod->name.slen, mod->name.ptr, mod_data));
@@ -999,7 +999,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_add_usage( pjsip_dialog *dlg,
*/
pj_array_insert(dlg->usage, sizeof(dlg->usage[0]), dlg->usage_cnt,
index, &mod);
-
+
/* Set module data. */
dlg->mod_data[mod->id] = mod_data;
@@ -1013,7 +1013,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_add_usage( pjsip_dialog *dlg,
/*
- * Attach module specific data to the dialog. Application can also set
+ * Attach module specific data to the dialog. Application can also set
* the value directly by accessing dlg->mod_data[module_id].
*/
PJ_DEF(pj_status_t) pjsip_dlg_set_mod_data( pjsip_dialog *dlg,
@@ -1043,7 +1043,7 @@ PJ_DEF(void*) pjsip_dlg_get_mod_data( pjsip_dialog *dlg,
/*
* Create a new request within dialog (i.e. after the dialog session has been
- * established). The construction of such requests follows the rule in
+ * established). The construction of such requests follows the rule in
* RFC3261 section 12.2.1.
*/
static pj_status_t dlg_create_request_throw( pjsip_dialog *dlg,
@@ -1057,7 +1057,7 @@ static pj_status_t dlg_create_request_throw( pjsip_dialog *dlg,
pj_status_t status;
/* Contact Header field.
- * Contact can only be present in requests that establish dialog (in the
+ * Contact can only be present in requests that establish dialog (in the
* core SIP spec, only INVITE).
*/
if (pjsip_method_creates_dialog(method))
@@ -1082,7 +1082,7 @@ static pj_status_t dlg_create_request_throw( pjsip_dialog *dlg,
if (status != PJ_SUCCESS)
return status;
- /* Just copy dialog route-set to Route header.
+ /* Just copy dialog route-set to Route header.
* The transaction will do the processing as specified in Section 12.2.1
* of RFC 3261 in function tsx_process_route() in sip_transaction.c.
*/
@@ -1192,10 +1192,10 @@ PJ_DEF(pj_status_t) pjsip_dlg_send_request( pjsip_dialog *dlg,
* ACK nor CANCEL.
*/
if (msg->line.req.method.id != PJSIP_CANCEL_METHOD &&
- msg->line.req.method.id != PJSIP_ACK_METHOD)
+ msg->line.req.method.id != PJSIP_ACK_METHOD)
{
pjsip_cseq_hdr *ch;
-
+
ch = PJSIP_MSG_CSEQ_HDR(msg);
PJ_ASSERT_RETURN(ch!=NULL, PJ_EBUG);
@@ -1244,7 +1244,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_send_request( pjsip_dialog *dlg,
pjsip_tx_data_set_transport(tdata, &dlg->tp_sel);
/* Send request */
- status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata,
+ status = pjsip_endpt_send_request_stateless(dlg->endpt, tdata,
NULL, NULL);
if (status != PJ_SUCCESS)
goto on_error;
@@ -1259,7 +1259,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_send_request( pjsip_dialog *dlg,
on_error:
/* Unlock dialog, may destroy dialog. */
pjsip_dlg_dec_lock(dlg);
-
+
/* Whatever happen delete the message. */
pjsip_tx_data_dec_ref( tdata );
pj_log_pop_indent();
@@ -1286,13 +1286,13 @@ static void dlg_beautify_response(pjsip_dialog *dlg,
if (add_headers && pjsip_method_creates_dialog(&cseq->method)) {
/* Add Contact header for 1xx, 2xx, 3xx and 485 response. */
if (st_class==2 || st_class==3 || (st_class==1 && st_code != 100) ||
- st_code==485)
+ st_code==485)
{
/* Add contact header only if one is not present. */
if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0 &&
- pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0)
+ pjsip_msg_find_hdr_by_name(tdata->msg, &HCONTACT, NULL) == 0)
{
- hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool,
+ hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool,
dlg->local.contact);
pjsip_msg_add_hdr(tdata->msg, hdr);
}
@@ -1301,7 +1301,7 @@ static void dlg_beautify_response(pjsip_dialog *dlg,
/* Add Allow header in 18x, 2xx and 405 response. */
if ((((st_code/10==18 || st_class==2) && dlg->add_allow)
|| st_code==405) &&
- pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL)
+ pjsip_msg_find_hdr(tdata->msg, PJSIP_H_ALLOW, NULL)==NULL)
{
c_hdr = pjsip_endpt_get_capability(dlg->endpt,
PJSIP_H_ALLOW, NULL);
@@ -1312,8 +1312,8 @@ static void dlg_beautify_response(pjsip_dialog *dlg,
}
/* Add Supported header in 2xx response. */
- if (st_class==2 &&
- pjsip_msg_find_hdr(tdata->msg, PJSIP_H_SUPPORTED, NULL)==NULL)
+ if (st_class==2 &&
+ pjsip_msg_find_hdr(tdata->msg, PJSIP_H_SUPPORTED, NULL)==NULL)
{
c_hdr = pjsip_endpt_get_capability(dlg->endpt,
PJSIP_H_SUPPORTED, NULL);
@@ -1400,7 +1400,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_modify_response( pjsip_dialog *dlg,
tdata->msg->line.status.reason = *pjsip_get_status_text(st_code);
}
- /* Remove existing Contact header (without this, when dialog sent
+ /* Remove existing Contact header (without this, when dialog sent
* 180 and then 302, the Contact in 302 will not get updated).
*/
hdr = (pjsip_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
@@ -1445,13 +1445,13 @@ PJ_DEF(pj_status_t) pjsip_dlg_send_response( pjsip_dialog *dlg,
PJ_LOG(5,(dlg->obj_name, "Sending %s",
pjsip_tx_data_get_info(tdata)));
- /* Check that transaction method and cseq match the response.
+ /* Check that transaction method and cseq match the response.
* This operation is sloooww (search CSeq header twice), that's why
* we only do it in debug mode.
*/
#if defined(PJ_DEBUG) && PJ_DEBUG!=0
PJ_ASSERT_RETURN( PJSIP_MSG_CSEQ_HDR(tdata->msg)->cseq == tsx->cseq &&
- pjsip_method_cmp(&PJSIP_MSG_CSEQ_HDR(tdata->msg)->method,
+ pjsip_method_cmp(&PJSIP_MSG_CSEQ_HDR(tdata->msg)->method,
&tsx->method)==0,
PJ_EINVALIDOP);
#endif
@@ -1477,7 +1477,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_send_response( pjsip_dialog *dlg,
/* Ask transaction to send the response */
status = pjsip_tsx_send_msg(tsx, tdata);
- /* This function must decrement transmit data request counter
+ /* This function must decrement transmit data request counter
* regardless of the operation status. The transaction only
* decrements the counter if the operation is successful.
*/
@@ -1562,7 +1562,7 @@ void pjsip_dlg_on_rx_request( pjsip_dialog *dlg, pjsip_rx_data *rdata )
/* Check CSeq */
if (rdata->msg_info.cseq->cseq <= dlg->remote.cseq &&
rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD &&
- rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD)
+ rdata->msg_info.msg->line.req.method.id != PJSIP_CANCEL_METHOD)
{
/* Invalid CSeq.
* Respond statelessly with 500 (Internal Server Error)
@@ -1594,8 +1594,8 @@ void pjsip_dlg_on_rx_request( pjsip_dialog *dlg, pjsip_rx_data *rdata )
}
/* Create UAS transaction for this request. */
- if (pjsip_rdata_get_tsx(rdata) == NULL &&
- rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD)
+ if (pjsip_rdata_get_tsx(rdata) == NULL &&
+ rdata->msg_info.msg->line.req.method.id != PJSIP_ACK_METHOD)
{
status = pjsip_tsx_create_uas(dlg->ua, rdata, &tsx);
if (status != PJ_SUCCESS) {
@@ -1629,7 +1629,7 @@ void pjsip_dlg_on_rx_request( pjsip_dialog *dlg, pjsip_rx_data *rdata )
pjsip_contact_hdr *contact;
contact = (pjsip_contact_hdr*)
- pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
+ pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
NULL);
if (contact && contact->uri &&
(dlg->remote.contact==NULL ||
@@ -1637,7 +1637,7 @@ void pjsip_dlg_on_rx_request( pjsip_dialog *dlg, pjsip_rx_data *rdata )
dlg->remote.contact->uri,
contact->uri)))
{
- dlg->remote.contact = (pjsip_contact_hdr*)
+ dlg->remote.contact = (pjsip_contact_hdr*)
pjsip_hdr_clone(dlg->pool, contact);
dlg->target = dlg->remote.contact->uri;
}
@@ -1687,11 +1687,11 @@ on_return:
static void dlg_update_routeset(pjsip_dialog *dlg, const pjsip_rx_data *rdata)
{
const pjsip_hdr *hdr, *end_hdr;
- pj_int32_t msg_cseq;
+ //pj_int32_t msg_cseq;
const pjsip_msg *msg;
msg = rdata->msg_info.msg;
- msg_cseq = rdata->msg_info.cseq->cseq;
+ //msg_cseq = rdata->msg_info.cseq->cseq;
/* Ignore if route set has been frozen */
if (dlg->route_set_frozen)
@@ -1707,7 +1707,7 @@ static void dlg_update_routeset(pjsip_dialog *dlg, const pjsip_rx_data *rdata)
return;
/* Ignore subsequent responses with higher CSeq than initial CSeq.
- * Unfortunately this would be broken when the first request is
+ * Unfortunately this would be broken when the first request is
* challenged!
*/
//if (msg_cseq != dlg->local.first_cseq)
@@ -1746,8 +1746,8 @@ static void dlg_update_routeset(pjsip_dialog *dlg, const pjsip_rx_data *rdata)
PJ_LOG(5,(dlg->obj_name, "Route-set updated"));
- /* Freeze the route set only when the route set comes in 2xx response.
- * If it is in 1xx response, prepare to recompute the route set when
+ /* Freeze the route set only when the route set comes in 2xx response.
+ * If it is in 1xx response, prepare to recompute the route set when
* the 2xx response comes in.
*
* There is a debate whether route set should be frozen when the dialog
@@ -1755,11 +1755,11 @@ static void dlg_update_routeset(pjsip_dialog *dlg, const pjsip_rx_data *rdata)
* it is safer to not freeze the route set (thus recompute the route set
* upon receiving 2xx response). Also RFC 3261 says so in 13.2.2.4.
*
- * The pjsip_method_creates_dialog() check protects from wrongly
+ * The pjsip_method_creates_dialog() check protects from wrongly
* freezing the route set upon receiving 200/OK response for PRACK.
*/
if (pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) &&
- PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200))
+ PJSIP_IS_STATUS_IN_CLASS(msg->line.status.code, 200))
{
dlg->route_set_frozen = PJ_TRUE;
PJ_LOG(5,(dlg->obj_name, "Route-set frozen"));
@@ -1788,7 +1788,7 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
/* Keep the response's status code */
res_code = rdata->msg_info.msg->line.status.code;
- /* When we receive response that establishes dialog, update To tag,
+ /* When we receive response that establishes dialog, update To tag,
* route set and dialog target.
*
* The second condition of the "if" is a workaround for forking.
@@ -1802,13 +1802,13 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
*
* New update:
* We also need to update the dialog for 1xx responses, to handle the
- * case when 100rel is used, otherwise PRACK will be sent to the
+ * case when 100rel is used, otherwise PRACK will be sent to the
* wrong target.
*/
- if ((dlg->state == PJSIP_DIALOG_STATE_NULL &&
+ if ((dlg->state == PJSIP_DIALOG_STATE_NULL &&
pjsip_method_creates_dialog(&rdata->msg_info.cseq->method) &&
(res_code > 100 && res_code < 300) &&
- rdata->msg_info.to->tag.slen)
+ rdata->msg_info.to->tag.slen)
||
(dlg->role==PJSIP_ROLE_UAC &&
!dlg->uac_has_2xx &&
@@ -1819,7 +1819,7 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
{
pjsip_contact_hdr *contact;
- /* Update remote capability info, when To tags in the dialog remote
+ /* Update remote capability info, when To tags in the dialog remote
* info and the incoming response are different, e.g: first response
* with To-tag or forking, apply strict update.
*/
@@ -1833,19 +1833,19 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
/* RFC 3271 Section 12.1.2:
* The route set MUST be set to the list of URIs in the Record-Route
- * header field from the response, taken in reverse order and
- * preserving all URI parameters. If no Record-Route header field
- * is present in the response, the route set MUST be set to the
+ * header field from the response, taken in reverse order and
+ * preserving all URI parameters. If no Record-Route header field
+ * is present in the response, the route set MUST be set to the
* empty set. This route set, even if empty, overrides any pre-existing
* route set for future requests in this dialog.
*/
dlg_update_routeset(dlg, rdata);
- /* The remote target MUST be set to the URI from the Contact header
+ /* The remote target MUST be set to the URI from the Contact header
* field of the response.
*/
contact = (pjsip_contact_hdr*)
- pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
+ pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
NULL);
if (contact && contact->uri &&
(dlg->remote.contact==NULL ||
@@ -1853,7 +1853,7 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
dlg->remote.contact->uri,
contact->uri)))
{
- dlg->remote.contact = (pjsip_contact_hdr*)
+ dlg->remote.contact = (pjsip_contact_hdr*)
pjsip_hdr_clone(dlg->pool, contact);
dlg->target = dlg->remote.contact->uri;
}
@@ -1863,15 +1863,15 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
/* Prevent dialog from being updated just in case more 2xx
* gets through this dialog (it shouldn't happen).
*/
- if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx &&
- res_code/100==2)
+ if (dlg->role==PJSIP_ROLE_UAC && !dlg->uac_has_2xx &&
+ res_code/100==2)
{
dlg->uac_has_2xx = PJ_TRUE;
}
}
/* Update remote target (again) when receiving 2xx response messages
- * that's defined as target refresh.
+ * that's defined as target refresh.
*
* Also upon receiving 2xx response, recheck again the route set.
* This is for compatibility with RFC 2543, as described in Section
@@ -1881,7 +1881,7 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
identifier of an existing dialog, the dialog MUST be transitioned to
the "confirmed" state, and the route set for the dialog MUST be
recomputed based on the 2xx response using the procedures of Section
- 12.2.1.2.
+ 12.2.1.2.
Note that the only piece of state that is recomputed is the route
set. Other pieces of state such as the highest sequence numbers
@@ -1896,7 +1896,7 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
pjsip_contact_hdr *contact;
contact = (pjsip_contact_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,
- PJSIP_H_CONTACT,
+ PJSIP_H_CONTACT,
NULL);
if (contact && contact->uri &&
(dlg->remote.contact==NULL ||
@@ -1904,7 +1904,7 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
dlg->remote.contact->uri,
contact->uri)))
{
- dlg->remote.contact = (pjsip_contact_hdr*)
+ dlg->remote.contact = (pjsip_contact_hdr*)
pjsip_hdr_clone(dlg->pool, contact);
dlg->target = dlg->remote.contact->uri;
}
@@ -1942,8 +1942,8 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
if (dlg->usage_cnt==0) {
pj_status_t status;
- if (rdata->msg_info.cseq->method.id==PJSIP_INVITE_METHOD &&
- rdata->msg_info.msg->line.status.code/100 == 2)
+ if (rdata->msg_info.cseq->method.id==PJSIP_INVITE_METHOD &&
+ rdata->msg_info.msg->line.status.code/100 == 2)
{
pjsip_tx_data *ack;
@@ -1957,11 +1957,11 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
{
pjsip_transaction *tsx = pjsip_rdata_get_tsx(rdata);
pjsip_tx_data *tdata;
-
- status = pjsip_auth_clt_reinit_req( &dlg->auth_sess,
+
+ status = pjsip_auth_clt_reinit_req( &dlg->auth_sess,
rdata, tsx->last_tx,
&tdata);
-
+
if (status == PJ_SUCCESS) {
/* Re-send request. */
status = pjsip_dlg_send_request(dlg, tdata, -1, NULL);
@@ -2014,7 +2014,7 @@ void pjsip_dlg_on_tsx_state( pjsip_dialog *dlg,
* the tsx_count if we're still attached to the transaction.
*/
if (tsx->state == PJSIP_TSX_STATE_TERMINATED &&
- tsx->mod_data[dlg->ua->id] == dlg)
+ tsx->mod_data[dlg->ua->id] == dlg)
{
pj_assert(dlg->tsx_count>0);
--dlg->tsx_count;
@@ -2044,7 +2044,7 @@ PJ_DEF(pjsip_dialog_cap_status) pjsip_dlg_remote_has_cap(
pjsip_dlg_inc_lock(dlg);
- hdr = (const pjsip_generic_array_hdr*)
+ hdr = (const pjsip_generic_array_hdr*)
pjsip_dlg_get_remote_cap_hdr(dlg, htype, hname);
if (!hdr) {
cap_status = PJSIP_DIALOG_CAP_UNKNOWN;
@@ -2071,7 +2071,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_update_remote_cap(pjsip_dialog *dlg,
const pjsip_msg *msg,
pj_bool_t strict)
{
- pjsip_hdr_e htypes[] =
+ pjsip_hdr_e htypes[] =
{ PJSIP_H_ACCEPT, PJSIP_H_ALLOW, PJSIP_H_SUPPORTED };
unsigned i;
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index a363b7ff..733bc599 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -1,5 +1,5 @@
/* $Id$ */
-/*
+/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
@@ -15,7 +15,7 @@
*
* 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include <pjsua-lib/pjsua.h>
#include <pjsua-lib/pjsua_internal.h>
@@ -38,7 +38,7 @@
/*
* The INFO method.
*/
-const pjsip_method pjsip_info_method =
+const pjsip_method pjsip_info_method =
{
PJSIP_OTHER_METHOD,
{ "INFO", 4 }
@@ -48,13 +48,13 @@ const pjsip_method pjsip_info_method =
/* This callback receives notification from invite session when the
* session state has changed.
*/
-static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
+static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
pjsip_event *e);
/* This callback is called by invite session framework when UAC session
* has forked.
*/
-static void pjsua_call_on_forked( pjsip_inv_session *inv,
+static void pjsua_call_on_forked( pjsip_inv_session *inv,
pjsip_event *e);
/*
@@ -163,7 +163,7 @@ pj_status_t pjsua_call_subsys_init(const pjsua_config *cfg)
/* Check the route URI's and force loose route if required */
for (i=0; i<pjsua_var.ua_cfg.outbound_proxy_cnt; ++i) {
- status = normalize_route_uri(pjsua_var.pool,
+ status = normalize_route_uri(pjsua_var.pool,
&pjsua_var.ua_cfg.outbound_proxy[i]);
if (status != PJ_SUCCESS)
return status;
@@ -257,15 +257,15 @@ static pjsua_call_id alloc_call_id(void)
#if 1
/* New algorithm: round-robin */
- if (pjsua_var.next_call_id >= (int)pjsua_var.ua_cfg.max_calls ||
+ if (pjsua_var.next_call_id >= (int)pjsua_var.ua_cfg.max_calls ||
pjsua_var.next_call_id < 0)
{
pjsua_var.next_call_id = 0;
}
- for (cid=pjsua_var.next_call_id;
- cid<(int)pjsua_var.ua_cfg.max_calls;
- ++cid)
+ for (cid=pjsua_var.next_call_id;
+ cid<(int)pjsua_var.ua_cfg.max_calls;
+ ++cid)
{
if (pjsua_var.calls[cid].inv == NULL &&
pjsua_var.calls[cid].async_call.dlg == NULL)
@@ -309,12 +309,12 @@ static int get_secure_level(pjsua_acc_id acc_id, const pj_str_t *dst_uri)
if (pj_stristr(dst_uri, &sips))
return 2;
-
+
if (!pj_list_empty(&acc->route_set)) {
pjsip_route_hdr *r = acc->route_set.next;
pjsip_uri *uri = r->name_addr.uri;
pjsip_sip_uri *sip_uri;
-
+
sip_uri = (pjsip_sip_uri*)pjsip_uri_get_uri(uri);
if (pj_stricmp2(&sip_uri->transport_param, "tls")==0)
return 1;
@@ -337,7 +337,7 @@ static int call_get_secure_level(pjsua_call *call)
pjsip_route_hdr *r = call->inv->dlg->route_set.next;
pjsip_uri *uri = r->name_addr.uri;
pjsip_sip_uri *sip_uri;
-
+
sip_uri = (pjsip_sip_uri*)pjsip_uri_get_uri(uri);
if (pj_stricmp2(&sip_uri->transport_param, "tls")==0)
return 1;
@@ -467,7 +467,7 @@ on_make_call_med_tp_complete(pjsua_call_id call_id,
/* Set credentials: */
if (acc->cred_cnt) {
- pjsip_auth_clt_set_credentials( &dlg->auth_sess,
+ pjsip_auth_clt_set_credentials( &dlg->auth_sess,
acc->cred_cnt, acc->cred);
}
@@ -478,7 +478,7 @@ on_make_call_med_tp_complete(pjsua_call_id call_id,
status = pjsip_inv_invite(inv, &tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create initial INVITE request",
+ pjsua_perror(THIS_FILE, "Unable to create initial INVITE request",
status);
goto on_error;
}
@@ -498,7 +498,7 @@ on_make_call_med_tp_complete(pjsua_call_id call_id,
if (status != PJ_SUCCESS) {
cb_called = PJ_TRUE;
- /* Upon failure to send first request, the invite
+ /* Upon failure to send first request, the invite
* session would have been cleared.
*/
inv = NULL;
@@ -616,7 +616,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
/* Check that account is valid */
- PJ_ASSERT_RETURN(acc_id>=0 || acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc),
+ PJ_ASSERT_RETURN(acc_id>=0 || acc_id<(int)PJ_ARRAY_SIZE(pjsua_var.acc),
PJ_EINVAL);
/* Check arguments */
@@ -630,12 +630,12 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
PJSUA_LOCK();
/* Create sound port if none is instantiated, to check if sound device
- * can be used. But only do this with the conference bridge, as with
- * audio switchboard (i.e. APS-Direct), we can only open the sound
+ * can be used. But only do this with the conference bridge, as with
+ * audio switchboard (i.e. APS-Direct), we can only open the sound
* device once the correct format has been known
*/
- if (!pjsua_var.is_mswitch && pjsua_var.snd_port==NULL &&
- pjsua_var.null_snd==NULL && !pjsua_var.no_snd)
+ if (!pjsua_var.is_mswitch && pjsua_var.snd_port==NULL &&
+ pjsua_var.null_snd==NULL && !pjsua_var.no_snd)
{
status = pjsua_set_snd_dev(pjsua_var.cap_dev, pjsua_var.play_dev);
if (status != PJ_SUCCESS)
@@ -678,8 +678,8 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
/* Create temporary pool */
tmp_pool = pjsua_pool_create("tmpcall10", 512, 256);
- /* Verify that destination URI is valid before calling
- * pjsua_acc_create_uac_contact, or otherwise there
+ /* Verify that destination URI is valid before calling
+ * pjsua_acc_create_uac_contact, or otherwise there
* a misleading "Invalid Contact URI" error will be printed
* when pjsua_acc_create_uac_contact() fails.
*/
@@ -691,7 +691,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
uri = pjsip_parse_uri(tmp_pool, dup.ptr, dup.slen, 0);
if (uri == NULL) {
- pjsua_perror(THIS_FILE, "Unable to make call",
+ pjsua_perror(THIS_FILE, "Unable to make call",
PJSIP_EINVALIDREQURI);
status = PJSIP_EINVALIDREQURI;
goto on_error;
@@ -713,14 +713,14 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
status = pjsua_acc_create_uac_contact(tmp_pool, &contact,
acc_id, dest_uri);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to generate Contact header",
+ pjsua_perror(THIS_FILE, "Unable to generate Contact header",
status);
goto on_error;
}
}
/* Create outgoing dialog: */
- status = pjsip_dlg_create_uac( pjsip_ua_instance(),
+ status = pjsip_dlg_create_uac( pjsip_ua_instance(),
&acc->cfg.id, &contact,
dest_uri,
(msg_data && msg_data->target_uri.slen?
@@ -744,7 +744,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
/* Attach user data */
call->user_data = user_data;
-
+
/* Store variables required for the callback after the async
* media transport creation is completed.
*/
@@ -761,7 +761,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call(pjsua_acc_id acc_id,
pjsip_dlg_inc_session(dlg, &pjsua_var.mod);
/* Init media channel */
- status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC,
+ status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAC,
call->secure_level, dlg->pool,
NULL, NULL, PJ_TRUE,
&on_make_call_med_tp_complete);
@@ -812,7 +812,7 @@ on_error:
/* Get the NAT type information in remote's SDP */
-static void update_remote_nat_type(pjsua_call *call,
+static void update_remote_nat_type(pjsua_call *call,
const pjmedia_sdp_session *sdp)
{
const pjmedia_sdp_attr *xnat;
@@ -899,13 +899,13 @@ static pj_status_t process_incoming_call_replace(pjsua_call *call,
static void process_pending_call_answer(pjsua_call *call)
{
struct call_answer *answer, *next;
-
+
answer = call->async_call.call_var.inc_call.answers.next;
while (answer != &call->async_call.call_var.inc_call.answers) {
next = answer->next;
pjsua_call_answer2(call->index, answer->opt, answer->code,
answer->reason, answer->msg_data);
-
+
/* Call might have been disconnected if application is answering
* with 200/OK and the media failed to start.
* See pjsua_call_answer() below.
@@ -952,7 +952,7 @@ on_incoming_call_med_tp_complete(pjsua_call_id call_id,
pjmedia_sdp_neg_get_neg_remote(call->inv->neg, &offer);
status = pjsua_media_channel_create_sdp(call_id,
- call->async_call.dlg->pool,
+ call->async_call.dlg->pool,
offer, &answer, &sip_err_code);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Error creating SDP answer", status);
@@ -976,7 +976,7 @@ on_incoming_call_med_tp_complete(pjsua_call_id call_id,
*/
sip_err_code = PJSIP_ERRNO_TO_SIP_STATUS(status);
goto on_return;
- }
+ }
on_return:
if (status != PJ_SUCCESS) {
@@ -1006,7 +1006,7 @@ on_return:
if (status == PJ_SUCCESS) {
if (call->async_call.call_var.inc_call.replaced_dlg) {
/* Process pending call replace */
- pjsip_dialog *replaced_dlg =
+ pjsip_dialog *replaced_dlg =
call->async_call.call_var.inc_call.replaced_dlg;
process_incoming_call_replace(call, replaced_dlg);
} else {
@@ -1053,7 +1053,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
/* Don't want to accept the call if shutdown is in progress */
if (pjsua_var.thread_quit_flag) {
- pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata,
+ pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata,
PJSIP_SC_TEMPORARILY_UNAVAILABLE, NULL,
NULL, NULL);
return PJ_TRUE;
@@ -1068,10 +1068,10 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
call_id = alloc_call_id();
if (call_id == PJSUA_INVALID_ID) {
- pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata,
+ pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata,
PJSIP_SC_BUSY_HERE, NULL,
NULL, NULL);
- PJ_LOG(2,(THIS_FILE,
+ PJ_LOG(2,(THIS_FILE,
"Unable to accept incoming call (too many calls)"));
goto on_return;
}
@@ -1097,7 +1097,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
pjsip_response_addr res_addr;
pjsip_get_response_addr(response->pool, rdata, &res_addr);
- pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response,
+ pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response,
NULL, NULL);
} else {
@@ -1151,13 +1151,13 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
if (st_text.slen == 2)
st_text = *pjsip_get_status_text(st_code);
- pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata,
+ pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata,
st_code, &st_text, NULL, NULL, NULL);
goto on_return;
}
}
- /*
+ /*
* Get which account is most likely to be associated with this incoming
* call. We need the account to find which contact URI to put for
* the call.
@@ -1189,26 +1189,26 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
pjsip_hdr hdr_list;
pjsip_warning_hdr *w;
- pjsua_perror(THIS_FILE, "Bad SDP in incoming INVITE",
+ pjsua_perror(THIS_FILE, "Bad SDP in incoming INVITE",
status);
- w = pjsip_warning_hdr_create_from_status(rdata->tp_info.pool,
+ w = pjsip_warning_hdr_create_from_status(rdata->tp_info.pool,
pjsip_endpt_name(pjsua_var.endpt),
status);
pj_list_init(&hdr_list);
pj_list_push_back(&hdr_list, w);
- pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400,
+ pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400,
&reason, &hdr_list, NULL, NULL);
goto on_return;
}
- /* Do quick checks on SDP before passing it to transports. More elabore
+ /* Do quick checks on SDP before passing it to transports. More elabore
* checks will be done in pjsip_inv_verify_request2() below.
*/
if (offer->media_count==0) {
const pj_str_t reason = pj_str("Missing media in SDP");
- pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400, &reason,
+ pjsip_endpt_respond(pjsua_var.endpt, NULL, rdata, 400, &reason,
NULL, NULL, NULL);
goto on_return;
}
@@ -1240,7 +1240,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
pjsip_response_addr res_addr;
pjsip_get_response_addr(response->pool, rdata, &res_addr);
- pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response,
+ pjsip_endpt_send_response(pjsua_var.endpt, &res_addr, response,
NULL, NULL);
} else {
@@ -1250,7 +1250,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
}
goto on_return;
- }
+ }
/* Get suitable Contact header */
if (pjsua_var.acc[acc_id].contact.slen) {
@@ -1259,7 +1259,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact,
acc_id, rdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to generate Contact header",
+ pjsua_perror(THIS_FILE, "Unable to generate Contact header",
status);
pjsip_endpt_respond_stateless(pjsua_var.endpt, rdata, 500, NULL,
NULL, NULL);
@@ -1285,19 +1285,19 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
/* Set credentials */
if (pjsua_var.acc[acc_id].cred_cnt) {
- pjsip_auth_clt_set_credentials(&dlg->auth_sess,
+ pjsip_auth_clt_set_credentials(&dlg->auth_sess,
pjsua_var.acc[acc_id].cred_cnt,
pjsua_var.acc[acc_id].cred);
}
/* Set preference */
- pjsip_auth_clt_set_prefs(&dlg->auth_sess,
+ pjsip_auth_clt_set_prefs(&dlg->auth_sess,
&pjsua_var.acc[acc_id].cfg.auth_pref);
/* Disable Session Timers if not prefered and the incoming INVITE request
* did not require it.
*/
- if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_INACTIVE &&
+ if (pjsua_var.acc[acc_id].cfg.use_timer == PJSUA_SIP_TIMER_INACTIVE &&
(options & PJSIP_INV_REQUIRE_TIMER) == 0)
{
options &= ~(PJSIP_INV_SUPPORT_TIMER);
@@ -1322,7 +1322,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
pjsip_hdr hdr_list;
pjsip_warning_hdr *w;
- w = pjsip_warning_hdr_create_from_status(dlg->pool,
+ w = pjsip_warning_hdr_create_from_status(dlg->pool,
pjsip_endpt_name(pjsua_var.endpt),
status);
pj_list_init(&hdr_list);
@@ -1360,8 +1360,8 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
* in pjsua_call_answer(), see ticket #1526.
*/
if (offer || replaced_dlg) {
- status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS,
- call->secure_level,
+ status = pjsua_media_channel_init(call->index, PJSIP_ROLE_UAS,
+ call->secure_level,
rdata->tp_info.pool,
offer,
&sip_err_code, PJ_TRUE,
@@ -1376,7 +1376,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
* a response message and terminate the invite here.
*/
pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL);
- pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE);
+ pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE);
call->inv = NULL;
call->async_call.dlg = NULL;
goto on_return;
@@ -1384,16 +1384,16 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
} else if (status != PJ_EPENDING) {
pjsua_perror(THIS_FILE, "Error initializing media channel", status);
pjsip_dlg_respond(dlg, rdata, sip_err_code, NULL, NULL, NULL);
- pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE);
- call->inv = NULL;
+ pjsip_inv_terminate(call->inv, sip_err_code, PJ_FALSE);
+ call->inv = NULL;
call->async_call.dlg = NULL;
goto on_return;
}
}
/* Create answer */
-/*
- status = pjsua_media_channel_create_sdp(call->index, rdata->tp_info.pool,
+/*
+ status = pjsua_media_channel_create_sdp(call->index, rdata->tp_info.pool,
offer, &answer, &sip_err_code);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Error creating SDP answer", status);
@@ -1404,7 +1404,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
*/
/* Init Session Timers */
- status = pjsip_timer_init_session(inv,
+ status = pjsip_timer_init_session(inv,
&pjsua_var.acc[acc_id].cfg.timer_setting);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Session Timer init failed", status);
@@ -1419,10 +1419,10 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
}
/* Update NAT type of remote endpoint, only when there is SDP in
- * incoming INVITE!
+ * incoming INVITE!
*/
if (pjsua_var.ua_cfg.nat_type_in_sdp && inv->neg &&
- pjmedia_sdp_neg_get_state(inv->neg) > PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER)
+ pjmedia_sdp_neg_get_state(inv->neg) > PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER)
{
const pjmedia_sdp_session *remote_sdp;
@@ -1488,13 +1488,13 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata)
call->async_call.call_var.inc_call.replaced_dlg = replaced_dlg;
}
} else {
- /* Notify application if on_incoming_call() is overriden,
+ /* Notify application if on_incoming_call() is overriden,
* otherwise hangup the call with 480
*/
if (pjsua_var.ua_cfg.cb.on_incoming_call) {
pjsua_var.ua_cfg.cb.on_incoming_call(acc_id, call_id, rdata);
} else {
- pjsua_call_hangup(call_id, PJSIP_SC_TEMPORARILY_UNAVAILABLE,
+ pjsua_call_hangup(call_id, PJSIP_SC_TEMPORARILY_UNAVAILABLE,
NULL, NULL);
}
}
@@ -1550,7 +1550,7 @@ pj_status_t acquire_call(const char *title,
if (!PJ_TIME_VAL_LT(dtime, timeout))
break;
}
-
+
has_pjsua_lock = PJ_FALSE;
status = PJSUA_TRY_LOCK();
@@ -1595,7 +1595,7 @@ pj_status_t acquire_call(const char *title,
title));
return PJ_ETIMEDOUT;
}
-
+
*p_call = call;
*p_dlg = dlg;
@@ -1700,7 +1700,7 @@ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id,
pj_strncpy(&info->last_status_text, &call->last_text,
sizeof(info->buf_.last_status_text));
}
-
+
/* Audio & video count offered by remote */
info->rem_offerer = call->rem_offerer;
if (call->rem_offerer) {
@@ -1726,7 +1726,7 @@ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id,
} else if (call_med->type == PJMEDIA_TYPE_VIDEO) {
pjmedia_vid_dev_index cap_dev = PJMEDIA_VID_INVALID_DEV;
- info->media[info->media_cnt].stream.vid.win_in =
+ info->media[info->media_cnt].stream.vid.win_in =
call_med->strm.v.rdr_win_id;
if (call_med->strm.v.cap_win_id != PJSUA_INVALID_ID) {
@@ -1762,7 +1762,7 @@ PJ_DEF(pj_status_t) pjsua_call_get_info( pjsua_call_id call_id,
} else if (call_med->type == PJMEDIA_TYPE_VIDEO) {
pjmedia_vid_dev_index cap_dev = PJMEDIA_VID_INVALID_DEV;
- info->prov_media[info->prov_media_cnt].stream.vid.win_in =
+ info->prov_media[info->prov_media_cnt].stream.vid.win_in =
call_med->strm.v.rdr_win_id;
if (call_med->strm.v.cap_win_id != PJSUA_INVALID_ID) {
@@ -1873,7 +1873,7 @@ PJ_DEF(pj_status_t) pjsua_call_get_rem_nat_type(pjsua_call_id call_id,
/*
* Get media transport info for the specified media index.
*/
-PJ_DEF(pj_status_t)
+PJ_DEF(pj_status_t)
pjsua_call_get_med_transport_info(pjsua_call_id call_id,
unsigned med_idx,
pjmedia_transport_info *t)
@@ -1889,7 +1889,7 @@ pjsua_call_get_med_transport_info(pjsua_call_id call_id,
PJSUA_LOCK();
call = &pjsua_var.calls[call_id];
-
+
if (med_idx >= call->med_cnt) {
PJSUA_UNLOCK();
return PJ_EINVAL;
@@ -1899,7 +1899,7 @@ pjsua_call_get_med_transport_info(pjsua_call_id call_id,
pjmedia_transport_info_init(t);
status = pjmedia_transport_get_info(call_med->tp, t);
-
+
PJSUA_UNLOCK();
return status;
}
@@ -1931,7 +1931,7 @@ on_answer_call_med_tp_complete(pjsua_call_id call_id,
}
status = pjsua_media_channel_create_sdp(call_id,
- call->async_call.dlg->pool,
+ call->async_call.dlg->pool,
NULL, &sdp, &sip_err_code);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Error creating SDP answer", status);
@@ -1983,7 +1983,7 @@ on_return:
/*
* Send response to incoming INVITE request.
*/
-PJ_DEF(pj_status_t) pjsua_call_answer( pjsua_call_id call_id,
+PJ_DEF(pj_status_t) pjsua_call_answer( pjsua_call_id call_id,
unsigned code,
const pj_str_t *reason,
const pjsua_msg_data *msg_data)
@@ -2041,10 +2041,10 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id,
* - call setting has just been set, or SDP offer needs to be sent, i.e:
* answer code 183 or 2xx is issued
*/
- if (!call->med_ch_cb &&
+ if (!call->med_ch_cb &&
(call->opt_inited || (code==183 || code/100==2)) &&
(!call->inv->neg ||
- pjmedia_sdp_neg_get_state(call->inv->neg) ==
+ pjmedia_sdp_neg_get_state(call->inv->neg) ==
PJMEDIA_SDP_NEG_STATE_NULL))
{
/* Mark call setting as initialized as it is just about to be used
@@ -2075,7 +2075,7 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id,
*/
if (call->med_ch_cb) {
struct call_answer *answer;
-
+
PJ_LOG(4,(THIS_FILE, "Pending answering call %d upon completion "
"of media transport", call_id));
@@ -2113,7 +2113,7 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id,
/* Create response message */
status = pjsip_inv_answer(call->inv, code, reason, NULL, &tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Error creating response",
+ pjsua_perror(THIS_FILE, "Error creating response",
status);
goto on_return;
}
@@ -2130,7 +2130,7 @@ PJ_DEF(pj_status_t) pjsua_call_answer2(pjsua_call_id call_id,
/* Send the message */
status = pjsip_inv_send_msg(call->inv, tdata);
if (status != PJ_SUCCESS)
- pjsua_perror(THIS_FILE, "Error sending response",
+ pjsua_perror(THIS_FILE, "Error sending response",
status);
on_return:
@@ -2159,7 +2159,7 @@ PJ_DEF(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id,
PJ_LOG(1,(THIS_FILE, "pjsua_call_hangup(): invalid call id %d",
call_id));
}
-
+
PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls,
PJ_EINVAL);
@@ -2185,7 +2185,7 @@ PJ_DEF(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id,
pj_strncpy(&call->last_text, reason,
sizeof(call->last_text_buf_));
}
-
+
goto on_return;
}
@@ -2200,13 +2200,13 @@ PJ_DEF(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id,
status = pjsip_inv_end_session(call->inv, code, reason, &tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE,
- "Failed to create end session message",
+ pjsua_perror(THIS_FILE,
+ "Failed to create end session message",
status);
goto on_return;
}
- /* pjsip_inv_end_session may return PJ_SUCCESS with NULL
+ /* pjsip_inv_end_session may return PJ_SUCCESS with NULL
* as p_tdata when INVITE transaction has not been answered
* with any provisional responses.
*/
@@ -2219,8 +2219,8 @@ PJ_DEF(pj_status_t) pjsua_call_hangup(pjsua_call_id call_id,
/* Send the message */
status = pjsip_inv_send_msg(call->inv, tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE,
- "Failed to send end session message",
+ pjsua_perror(THIS_FILE,
+ "Failed to send end session message",
status);
goto on_return;
}
@@ -2251,7 +2251,7 @@ PJ_DEF(pj_status_t) pjsua_call_process_redirect( pjsua_call_id call_id,
PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls,
PJ_EINVAL);
- status = acquire_call("pjsua_call_process_redirect()", call_id,
+ status = acquire_call("pjsua_call_process_redirect()", call_id,
&call, &dlg);
if (status != PJ_SUCCESS)
return status;
@@ -2408,13 +2408,13 @@ PJ_DEF(pj_status_t) pjsua_call_reinvite2(pjsua_call_id call_id,
if (call->local_hold && (call->opt.flag & PJSUA_CALL_UNHOLD)==0) {
status = create_sdp_of_call_hold(call, &sdp);
} else {
- status = pjsua_media_channel_create_sdp(call->index,
+ status = pjsua_media_channel_create_sdp(call->index,
call->inv->pool_prov,
NULL, &sdp, NULL);
call->local_hold = PJ_FALSE;
}
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint",
+ pjsua_perror(THIS_FILE, "Unable to get SDP from media endpoint",
status);
goto on_return;
}
@@ -2554,7 +2554,7 @@ on_return:
/*
* Initiate call transfer to the specified address.
*/
-PJ_DEF(pj_status_t) pjsua_call_xfer( pjsua_call_id call_id,
+PJ_DEF(pj_status_t) pjsua_call_xfer( pjsua_call_id call_id,
const pj_str_t *dest,
const pjsua_msg_data *msg_data)
{
@@ -2570,7 +2570,7 @@ PJ_DEF(pj_status_t) pjsua_call_xfer( pjsua_call_id call_id,
PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls &&
dest, PJ_EINVAL);
-
+
PJ_LOG(4,(THIS_FILE, "Transferring call %d to %.*s", call_id,
(int)dest->slen, dest->ptr));
pj_log_push_indent();
@@ -2578,7 +2578,7 @@ PJ_DEF(pj_status_t) pjsua_call_xfer( pjsua_call_id call_id,
status = acquire_call("pjsua_call_xfer()", call_id, &call, &dlg);
if (status != PJ_SUCCESS)
goto on_return;
-
+
/* Create xfer client subscription. */
pj_bzero(&xfer_cb, sizeof(xfer_cb));
xfer_cb.on_evsub_state = &xfer_client_on_evsub_state;
@@ -2617,7 +2617,7 @@ PJ_DEF(pj_status_t) pjsua_call_xfer( pjsua_call_id call_id,
goto on_return;
}
- /* For simplicity (that's what this program is intended to be!),
+ /* For simplicity (that's what this program is intended to be!),
* leave the original invite session as it is. More advanced application
* may want to hold the INVITE, or terminate the invite, or whatever.
*/
@@ -2632,7 +2632,7 @@ on_return:
/*
* Initiate attended call transfer to the specified address.
*/
-PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
+PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
pjsua_call_id dest_call_id,
unsigned options,
const pjsua_msg_data *msg_data)
@@ -2644,26 +2644,26 @@ PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
int len;
pjsip_uri *uri;
pj_status_t status;
-
+
PJ_ASSERT_RETURN(call_id>=0 && call_id<(int)pjsua_var.ua_cfg.max_calls,
PJ_EINVAL);
- PJ_ASSERT_RETURN(dest_call_id>=0 &&
+ PJ_ASSERT_RETURN(dest_call_id>=0 &&
dest_call_id<(int)pjsua_var.ua_cfg.max_calls,
PJ_EINVAL);
-
+
PJ_LOG(4,(THIS_FILE, "Transferring call %d replacing with call %d",
call_id, dest_call_id));
pj_log_push_indent();
- status = acquire_call("pjsua_call_xfer_replaces()", dest_call_id,
+ status = acquire_call("pjsua_call_xfer_replaces()", dest_call_id,
&dest_call, &dest_dlg);
if (status != PJ_SUCCESS) {
pj_log_pop_indent();
return status;
}
-
- /*
+
+ /*
* Create REFER destination URI with Replaces field.
*/
@@ -2671,7 +2671,7 @@ PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
PJ_ASSERT_ON_FAIL(dest_dlg->remote.info_str.slen +
dest_dlg->call_id->id.slen +
dest_dlg->remote.info->tag.slen +
- dest_dlg->local.info->tag.slen + 32
+ dest_dlg->local.info->tag.slen + 32
< (long)sizeof(str_dest_buf),
{ status=PJSIP_EURITOOLONG; goto on_error; });
@@ -2680,7 +2680,7 @@ PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
str_dest.slen = 1;
uri = (pjsip_uri*) pjsip_uri_get_uri(dest_dlg->remote.info->uri);
- len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, uri,
+ len = pjsip_uri_print(PJSIP_URI_IN_REQ_URI, uri,
str_dest_buf+1, sizeof(str_dest_buf)-1);
if (len < 0) {
status = PJSIP_EURITOOLONG;
@@ -2691,7 +2691,7 @@ PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
/* Build the URI */
- len = pj_ansi_snprintf(str_dest_buf + str_dest.slen,
+ len = pj_ansi_snprintf(str_dest_buf + str_dest.slen,
sizeof(str_dest_buf) - str_dest.slen,
"?%s"
"Replaces=%.*s"
@@ -2708,12 +2708,12 @@ PJ_DEF(pj_status_t) pjsua_call_xfer_replaces( pjsua_call_id call_id,
PJ_ASSERT_ON_FAIL(len > 0 && len <= (int)sizeof(str_dest_buf)-str_dest.slen,
{ status=PJSIP_EURITOOLONG; goto on_error; });
-
+
str_dest.ptr = str_dest_buf;
str_dest.slen += len;
pjsip_dlg_dec_lock(dest_dlg);
-
+
status = pjsua_call_xfer(call_id, &str_dest, msg_data);
pj_log_pop_indent();
@@ -2729,7 +2729,7 @@ on_error:
/**
* Send instant messaging inside INVITE session.
*/
-PJ_DEF(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id,
+PJ_DEF(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id,
const pj_str_t *mime_type,
const pj_str_t *content,
const pjsua_msg_data *msg_data,
@@ -2753,7 +2753,7 @@ PJ_DEF(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id,
status = acquire_call("pjsua_call_send_im()", call_id, &call, &dlg);
if (status != PJ_SUCCESS)
goto on_return;
-
+
/* Set default media type if none is specified */
if (mime_type == NULL) {
mime_type = &mime_text_plain;
@@ -2768,7 +2768,7 @@ PJ_DEF(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id,
}
/* Add accept header. */
- pjsip_msg_add_hdr( tdata->msg,
+ pjsip_msg_add_hdr( tdata->msg,
(pjsip_hdr*)pjsua_im_create_accept(tdata->pool));
/* Parse MIME type */
@@ -2796,7 +2796,7 @@ PJ_DEF(pj_status_t) pjsua_call_send_im( pjsua_call_id call_id,
/* Send the request. */
- status = pjsip_dlg_send_request( call->inv->dlg, tdata,
+ status = pjsip_dlg_send_request( call->inv->dlg, tdata,
pjsua_var.mod.id, im_data);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to send MESSAGE request", status);
@@ -2813,7 +2813,7 @@ on_return:
/*
* Send IM typing indication inside INVITE session.
*/
-PJ_DEF(pj_status_t) pjsua_call_send_typing_ind( pjsua_call_id call_id,
+PJ_DEF(pj_status_t) pjsua_call_send_typing_ind( pjsua_call_id call_id,
pj_bool_t is_typing,
const pjsua_msg_data*msg_data)
{
@@ -3098,14 +3098,14 @@ static pj_bool_t check_ice_complete(pjsua_call *call, pj_bool_t *need_reinv)
pjsua_call_media *call_med = &call->media[i];
pjmedia_transport_info tpinfo;
pjmedia_ice_transport_info *ice_info;
-
+
if (call_med->tp_st == PJSUA_MED_TP_NULL ||
call_med->tp_st == PJSUA_MED_TP_DISABLED ||
call_med->state == PJSUA_CALL_MEDIA_ERROR)
{
continue;
}
-
+
pjmedia_transport_info_init(&tpinfo);
pjmedia_transport_get_info(call_med->tp, &tpinfo);
ice_info = (pjmedia_ice_transport_info*)
@@ -3121,7 +3121,7 @@ static pj_bool_t check_ice_complete(pjsua_call *call, pj_bool_t *need_reinv)
ice_complete = PJ_FALSE;
break;
}
-
+
/* Check if ICE needs to send reinvite */
if (!ice_need_reinv &&
ice_info->sess_state == PJ_ICE_STRANS_STATE_RUNNING &&
@@ -3136,10 +3136,10 @@ static pj_bool_t check_ice_complete(pjsua_call *call, pj_bool_t *need_reinv)
}
}
}
-
+
if (ice_complete && need_reinv)
*need_reinv = ice_need_reinv;
-
+
return ice_complete;
}
@@ -3176,7 +3176,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
/* Delay this when the SDP negotiation done in call state EARLY and
* remote does not support UPDATE method.
*/
- if (inv->state == PJSIP_INV_STATE_EARLY &&
+ if (inv->state == PJSIP_INV_STATE_EARLY &&
pjsip_dlg_remote_has_cap(inv->dlg, PJSIP_H_ALLOW, NULL, &ST_UPDATE)!=
PJSIP_DIALOG_CAP_SUPPORTED)
{
@@ -3196,7 +3196,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
if (!need_lock_codec && !ice_need_reinv)
return PJ_SUCCESS;
-
+
/* Okay! So we need to send re-INVITE/UPDATE */
/* Check if remote support UPDATE */
@@ -3217,7 +3217,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
(ice_need_reinv && need_lock_codec? ST_LOCK_CODEC : "")
));
}
-
+
/* Generate SDP re-offer */
status = pjsua_media_channel_create_sdp(call->index, pool, NULL,
&new_offer, NULL);
@@ -3234,12 +3234,12 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
*/
if (need_lock_codec) {
const pjmedia_sdp_session *ref_sdp;
-
+
/* Get local active SDP as reference */
status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &ref_sdp);
if (status != PJ_SUCCESS)
return status;
-
+
/* Verify media count. Note that remote may add/remove media line
* in the answer. When answer has less media, it must have been
* handled by pjsua_media_channel_update() as disabled media.
@@ -3261,7 +3261,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
const pjmedia_sdp_media *ref_m = ref_sdp->media[i];
pjmedia_sdp_media *m = new_offer->media[i];
pjsua_call_media *call_med = &call->media[i];
-
+
/* Verify if media is deactivated */
if (call_med->state == PJSUA_CALL_MEDIA_NONE ||
call_med->state == PJSUA_CALL_MEDIA_ERROR ||
@@ -3269,12 +3269,12 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
{
continue;
}
-
+
/* Reset formats */
m->desc.fmt_count = 0;
pjmedia_sdp_attr_remove_all(&m->attr_count, m->attr, "rtpmap");
pjmedia_sdp_attr_remove_all(&m->attr_count, m->attr, "fmtp");
-
+
/* Copy only the first format + any non-AV formats from
* the active local SDP.
*/
@@ -3283,7 +3283,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
if (is_non_av_fmt(ref_m, fmt) || (++codec_cnt == 1)) {
pjmedia_sdp_attr *a;
-
+
m->desc.fmt[m->desc.fmt_count++] = *fmt;
a = pjmedia_sdp_attr_find2(ref_m->attr_count, ref_m->attr,
"rtpmap", fmt);
@@ -3299,7 +3299,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
/* Put back original direction and "c=0.0.0.0" line */
{
const pjmedia_sdp_session *cur_sdp;
-
+
/* Get local active SDP */
status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &cur_sdp);
if (status != PJ_SUCCESS)
@@ -3355,7 +3355,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
}
}
-
+
if (rem_can_update) {
status = pjsip_inv_update(inv, NULL, new_offer, &tdata);
} else {
@@ -3387,7 +3387,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
call->reinv_ice_sent = PJ_TRUE;
if (need_lock_codec)
++call->lock_codec.retry_cnt;
-
+
return PJ_SUCCESS;
}
@@ -3396,7 +3396,7 @@ static pj_status_t process_pending_reinvite(pjsua_call *call)
* This callback receives notification from invite session when the
* session state has changed.
*/
-static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
+static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
pjsip_event *e)
{
pjsua_call *call;
@@ -3417,9 +3417,9 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
case PJSIP_INV_STATE_CONNECTING:
if (call->res_time.sec == 0)
pj_gettimeofday(&call->res_time);
- call->last_code = (pjsip_status_code)
+ call->last_code = (pjsip_status_code)
e->body.tsx_state.tsx->status_code;
- pj_strncpy(&call->last_text,
+ pj_strncpy(&call->last_text,
&e->body.tsx_state.tsx->status_text,
sizeof(call->last_text_buf_));
break;
@@ -3438,12 +3438,12 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
pj_gettimeofday(&call->dis_time);
if (call->res_time.sec == 0)
pj_gettimeofday(&call->res_time);
- if (e->type == PJSIP_EVENT_TSX_STATE &&
- e->body.tsx_state.tsx->status_code > call->last_code)
+ if (e->type == PJSIP_EVENT_TSX_STATE &&
+ e->body.tsx_state.tsx->status_code > call->last_code)
{
- call->last_code = (pjsip_status_code)
+ call->last_code = (pjsip_status_code)
e->body.tsx_state.tsx->status_code;
- pj_strncpy(&call->last_text,
+ pj_strncpy(&call->last_text,
&e->body.tsx_state.tsx->status_text,
sizeof(call->last_text_buf_));
} else {
@@ -3460,9 +3460,9 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
}
break;
default:
- call->last_code = (pjsip_status_code)
+ call->last_code = (pjsip_status_code)
e->body.tsx_state.tsx->status_code;
- pj_strncpy(&call->last_text,
+ pj_strncpy(&call->last_text,
&e->body.tsx_state.tsx->status_text,
sizeof(call->last_text_buf_));
break;
@@ -3474,7 +3474,7 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
if (call->xfer_sub && e->type==PJSIP_EVENT_TSX_STATE) {
int st_code = -1;
pjsip_evsub_state ev_state = PJSIP_EVSUB_STATE_ACTIVE;
-
+
switch (call->inv->state) {
case PJSIP_INV_STATE_NULL:
@@ -3553,7 +3553,7 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
if (inv->state == PJSIP_INV_STATE_DISCONNECTED) {
PJSUA_LOCK();
-
+
pjsua_media_channel_deinit(call->index);
/* Free call */
@@ -3576,7 +3576,7 @@ static void pjsua_call_on_state_changed(pjsip_inv_session *inv,
* This callback is called by invite session framework when UAC session
* has forked.
*/
-static void pjsua_call_on_forked( pjsip_inv_session *inv,
+static void pjsua_call_on_forked( pjsip_inv_session *inv,
pjsip_event *e)
{
PJ_UNUSED_ARG(inv);
@@ -3591,10 +3591,10 @@ static void pjsua_call_on_forked( pjsip_inv_session *inv,
*/
pjsip_dialog* on_dlg_forked(pjsip_dialog *dlg, pjsip_rx_data *res)
{
- if (dlg->uac_has_2xx &&
+ if (dlg->uac_has_2xx &&
res->msg_info.cseq->method.id == PJSIP_INVITE_METHOD &&
pjsip_rdata_get_tsx(res) == NULL &&
- res->msg_info.msg->line.status.code/100 == 2)
+ res->msg_info.msg->line.status.code/100 == 2)
{
pjsip_dialog *forked_dlg;
pjsip_tx_data *bye;
@@ -3630,30 +3630,31 @@ pjsip_dialog* on_dlg_forked(pjsip_dialog *dlg, pjsip_rx_data *res)
/*
* Disconnect call upon error.
*/
-static void call_disconnect( pjsip_inv_session *inv,
+static void call_disconnect( pjsip_inv_session *inv,
int code )
{
- pjsua_call *call;
pjsip_tx_data *tdata;
pj_status_t status;
- call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
-
status = pjsip_inv_end_session(inv, code, NULL, &tdata);
if (status != PJ_SUCCESS)
return;
- /* Add SDP in 488 status */
#if DISABLED_FOR_TICKET_1185
+ pjsua_call *call;
+
+ /* Add SDP in 488 status */
+ call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id];
+
if (call && call->tp && tdata->msg->type==PJSIP_RESPONSE_MSG &&
- code==PJSIP_SC_NOT_ACCEPTABLE_HERE)
+ code==PJSIP_SC_NOT_ACCEPTABLE_HERE)
{
pjmedia_sdp_session *local_sdp;
pjmedia_transport_info ti;
pjmedia_transport_info_init(&ti);
pjmedia_transport_get_info(call->med_tp, &ti);
- status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, tdata->pool,
+ status = pjmedia_endpt_create_sdp(pjsua_var.med_endpt, tdata->pool,
1, &ti.sock_info, &local_sdp);
if (status == PJ_SUCCESS) {
pjsip_create_sdp_body(tdata->pool, local_sdp,
@@ -3698,10 +3699,10 @@ static void pjsua_call_on_media_update(pjsip_inv_session *inv,
/*pjsua_media_channel_deinit(call->index);*/
/* Disconnect call if we're not in the middle of initializing an
- * UAS dialog and if this is not a re-INVITE
+ * UAS dialog and if this is not a re-INVITE
*/
if (inv->state != PJSIP_INV_STATE_NULL &&
- inv->state != PJSIP_INV_STATE_CONFIRMED)
+ inv->state != PJSIP_INV_STATE_CONFIRMED)
{
call_disconnect(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE);
}
@@ -3713,8 +3714,8 @@ static void pjsua_call_on_media_update(pjsip_inv_session *inv,
/* Get local and remote SDP */
status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &local_sdp);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE,
- "Unable to retrieve currently active local SDP",
+ pjsua_perror(THIS_FILE,
+ "Unable to retrieve currently active local SDP",
status);
//call_disconnect(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE);
goto on_return;
@@ -3722,8 +3723,8 @@ static void pjsua_call_on_media_update(pjsip_inv_session *inv,
status = pjmedia_sdp_neg_get_active_remote(call->inv->neg, &remote_sdp);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE,
- "Unable to retrieve currently active remote SDP",
+ pjsua_perror(THIS_FILE,
+ "Unable to retrieve currently active remote SDP",
status);
//call_disconnect(inv, PJSIP_SC_UNSUPPORTED_MEDIA_TYPE);
goto on_return;
@@ -3737,7 +3738,7 @@ static void pjsua_call_on_media_update(pjsip_inv_session *inv,
/* Update media channel with the new SDP */
status = pjsua_media_channel_update(call->index, local_sdp, remote_sdp);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create media session",
+ pjsua_perror(THIS_FILE, "Unable to create media session",
status);
call_disconnect(inv, PJSIP_SC_NOT_ACCEPTABLE_HERE);
/* No need to deinitialize; media will be shutdown when call
@@ -3767,12 +3768,12 @@ static pj_status_t modify_sdp_of_call_hold(pjsua_call *call,
{
unsigned mi;
- /* Call-hold is done by set the media direction to 'sendonly'
- * (PJMEDIA_DIR_ENCODING), except when current media direction is
+ /* Call-hold is done by set the media direction to 'sendonly'
+ * (PJMEDIA_DIR_ENCODING), except when current media direction is
* 'inactive' (PJMEDIA_DIR_NONE).
* (See RFC 3264 Section 8.4 and RFC 4317 Section 3.1)
*/
- /* http://trac.pjsip.org/repos/ticket/880
+ /* http://trac.pjsip.org/repos/ticket/880
if (call->dir != PJMEDIA_DIR_ENCODING) {
*/
/* https://trac.pjsip.org/repos/ticket/1142:
@@ -3882,7 +3883,7 @@ static void pjsua_call_on_rx_offer(pjsip_inv_session *inv,
if (pjsua_var.ua_cfg.cb.on_call_rx_offer) {
pjsip_status_code code = PJSIP_SC_OK;
pjsua_call_setting opt = call->opt;
-
+
(*pjsua_var.ua_cfg.cb.on_call_rx_offer)(call->index, offer, NULL,
&code, &opt);
@@ -3894,14 +3895,14 @@ static void pjsua_call_on_rx_offer(pjsip_inv_session *inv,
call->opt = opt;
}
-
+
/* Re-init media for the new remote offer before creating SDP */
status = apply_call_setting(call, &call->opt, offer);
if (status != PJ_SUCCESS)
goto on_return;
- status = pjsua_media_channel_create_sdp(call->index,
- call->inv->pool_prov,
+ status = pjsua_media_channel_create_sdp(call->index,
+ call->inv->pool_prov,
offer, &answer, NULL);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to create local SDP", status);
@@ -3971,7 +3972,7 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv,
/* See if we've put call on hold. */
if (call->local_hold) {
- PJ_LOG(4,(THIS_FILE,
+ PJ_LOG(4,(THIS_FILE,
"Call %d: call is on-hold locally, creating call-hold SDP ",
call->index));
status = create_sdp_of_call_hold( call, offer );
@@ -3979,8 +3980,8 @@ static void pjsua_call_on_create_offer(pjsip_inv_session *inv,
PJ_LOG(4,(THIS_FILE, "Call %d: asked to send a new offer",
call->index));
- status = pjsua_media_channel_create_sdp(call->index,
- call->inv->pool_prov,
+ status = pjsua_media_channel_create_sdp(call->index,
+ call->inv->pool_prov,
NULL, offer, NULL);
}
@@ -4000,13 +4001,13 @@ on_return:
*/
static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
{
-
+
PJ_UNUSED_ARG(event);
pj_log_push_indent();
/*
- * When subscription is accepted (got 200/OK to REFER), check if
+ * When subscription is accepted (got 200/OK to REFER), check if
* subscription suppressed.
*/
if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_ACCEPTED) {
@@ -4019,13 +4020,13 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
/* Must be receipt of response message */
- pj_assert(event->type == PJSIP_EVENT_TSX_STATE &&
+ pj_assert(event->type == PJSIP_EVENT_TSX_STATE &&
event->body.tsx_state.type == PJSIP_EVENT_RX_MSG);
rdata = event->body.tsx_state.src.rdata;
/* Find Refer-Sub header */
refer_sub = (pjsip_generic_string_hdr*)
- pjsip_msg_find_hdr_by_name(rdata->msg_info.msg,
+ pjsip_msg_find_hdr_by_name(rdata->msg_info.msg,
&REFER_SUB, NULL);
/* Check if subscription is suppressed */
@@ -4036,7 +4037,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
if (call && pjsua_var.ua_cfg.cb.on_call_transfer_status) {
const pj_str_t ACCEPTED = { "Accepted", 8 };
pj_bool_t cont = PJ_FALSE;
- (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index,
+ (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index,
200,
&ACCEPTED,
PJ_TRUE,
@@ -4051,13 +4052,13 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
pjsip_evsub_terminate(sub, PJ_TRUE);
} else {
- /* Notify application about call transfer progress.
+ /* Notify application about call transfer progress.
* Initially notify with 100/Accepted status.
*/
if (call && pjsua_var.ua_cfg.cb.on_call_transfer_status) {
const pj_str_t ACCEPTED = { "Accepted", 8 };
pj_bool_t cont = PJ_FALSE;
- (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index,
+ (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index,
100,
&ACCEPTED,
PJ_FALSE,
@@ -4069,7 +4070,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
* On incoming NOTIFY, notify application about call transfer progress.
*/
else if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_ACTIVE ||
- pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED)
+ pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED)
{
pjsua_call *call;
pjsip_msg *msg;
@@ -4081,7 +4082,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
call = (pjsua_call*) pjsip_evsub_get_mod_data(sub, pjsua_var.mod.id);
- /* When subscription is terminated, clear the xfer_sub member of
+ /* When subscription is terminated, clear the xfer_sub member of
* the inv_data.
*/
if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) {
@@ -4107,7 +4108,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
msg = rdata->msg_info.msg;
body = msg->body;
if (!body) {
- PJ_LOG(2,(THIS_FILE,
+ PJ_LOG(2,(THIS_FILE,
"Warning: received NOTIFY without message body"));
goto on_return;
}
@@ -4116,17 +4117,17 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
if (pj_stricmp2(&body->content_type.type, "message") != 0 ||
pj_stricmp2(&body->content_type.subtype, "sipfrag") != 0)
{
- PJ_LOG(2,(THIS_FILE,
+ PJ_LOG(2,(THIS_FILE,
"Warning: received NOTIFY with non message/sipfrag "
"content"));
goto on_return;
}
/* Try to parse the content */
- status = pjsip_parse_status_line((char*)body->data, body->len,
+ status = pjsip_parse_status_line((char*)body->data, body->len,
&status_line);
if (status != PJ_SUCCESS) {
- PJ_LOG(2,(THIS_FILE,
+ PJ_LOG(2,(THIS_FILE,
"Warning: received NOTIFY with invalid "
"message/sipfrag content"));
goto on_return;
@@ -4140,7 +4141,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
/* Notify application */
is_last = (pjsip_evsub_get_state(sub)==PJSIP_EVSUB_STATE_TERMINATED);
cont = !is_last;
- (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index,
+ (*pjsua_var.ua_cfg.cb.on_call_transfer_status)(call->index,
status_line.code,
&status_line.reason,
is_last, &cont);
@@ -4155,7 +4156,7 @@ static void xfer_client_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
if (status_line.code/100 == 2 && !is_last) {
pjsip_tx_data *tdata;
- status = pjsip_evsub_initiate(sub, &pjsip_subscribe_method,
+ status = pjsip_evsub_initiate(sub, &pjsip_subscribe_method,
0, &tdata);
if (status == PJ_SUCCESS)
status = pjsip_evsub_send_request(sub, tdata);
@@ -4178,7 +4179,7 @@ static void xfer_server_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
pj_log_push_indent();
/*
- * When subscription is terminated, clear the xfer_sub member of
+ * When subscription is terminated, clear the xfer_sub member of
* the inv_data.
*/
if (pjsip_evsub_get_state(sub) == PJSIP_EVSUB_STATE_TERMINATED) {
@@ -4253,21 +4254,21 @@ static void on_call_transferred( pjsip_inv_session *inv,
* request.
*/
ref_by_hdr = (pjsip_hdr*)
- pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_ref_by,
+ pjsip_msg_find_hdr_by_name(rdata->msg_info.msg, &str_ref_by,
NULL);
/* Notify callback */
code = PJSIP_SC_ACCEPTED;
if (pjsua_var.ua_cfg.cb.on_call_transfer_request) {
(*pjsua_var.ua_cfg.cb.on_call_transfer_request)(existing_call->index,
- &refer_to->hvalue,
+ &refer_to->hvalue,
&code);
}
call_opt = existing_call->opt;
if (pjsua_var.ua_cfg.cb.on_call_transfer_request2) {
(*pjsua_var.ua_cfg.cb.on_call_transfer_request2)(existing_call->index,
- &refer_to->hvalue,
+ &refer_to->hvalue,
&code,
&call_opt);
}
@@ -4283,7 +4284,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
PJ_LOG(3,(THIS_FILE, "Call to %.*s is being transferred to %.*s",
(int)inv->dlg->remote.info_str.slen,
inv->dlg->remote.info_str.ptr,
- (int)refer_to->hvalue.slen,
+ (int)refer_to->hvalue.slen,
refer_to->hvalue.ptr));
if (no_refer_sub) {
@@ -4294,7 +4295,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
const pj_str_t str_false = { "false", 5};
pjsip_hdr *hdr;
- status = pjsip_dlg_create_response(inv->dlg, rdata, code, NULL,
+ status = pjsip_dlg_create_response(inv->dlg, rdata, code, NULL,
&tdata);
if (status != PJ_SUCCESS) {
pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER",
@@ -4303,7 +4304,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
}
/* Add Refer-Sub header */
- hdr = (pjsip_hdr*)
+ hdr = (pjsip_hdr*)
pjsip_generic_string_hdr_create(tdata->pool, &str_refer_sub,
&str_false);
pjsip_msg_add_hdr(tdata->msg, hdr);
@@ -4347,8 +4348,8 @@ static void on_call_transferred( pjsip_inv_session *inv,
const pj_str_t str_true = { "true", 4 };
pjsip_hdr *hdr;
- hdr = (pjsip_hdr*)
- pjsip_generic_string_hdr_create(inv->dlg->pool,
+ hdr = (pjsip_hdr*)
+ pjsip_generic_string_hdr_create(inv->dlg->pool,
&str_refer_sub,
&str_true);
pj_list_push_back(&hdr_list, hdr);
@@ -4362,7 +4363,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
status = pjsip_xfer_notify( sub, PJSIP_EVSUB_STATE_ACTIVE,
100, NULL, &tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create NOTIFY to REFER",
+ pjsua_perror(THIS_FILE, "Unable to create NOTIFY to REFER",
status);
goto on_return;
}
@@ -4378,7 +4379,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
/* We're cheating here.
* We need to get a null terminated string from a pj_str_t.
* So grab the pointer from the hvalue and NULL terminate it, knowing
- * that the NULL position will be occupied by a newline.
+ * that the NULL position will be occupied by a newline.
*/
uri = refer_to->hvalue.ptr;
uri[refer_to->hvalue.slen] = '\0';
@@ -4398,7 +4399,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
/* Now make the outgoing call. */
tmp = pj_str(uri);
status = pjsua_call_make_call(existing_call->acc_id, &tmp, &call_opt,
- existing_call->user_data, &msg_data,
+ existing_call->user_data, &msg_data,
&new_call);
if (status != PJ_SUCCESS) {
@@ -4407,13 +4408,13 @@ static void on_call_transferred( pjsip_inv_session *inv,
status = pjsip_xfer_notify(sub, PJSIP_EVSUB_STATE_TERMINATED,
500, NULL, &tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create NOTIFY to REFER",
+ pjsua_perror(THIS_FILE, "Unable to create NOTIFY to REFER",
status);
goto on_return;
}
status = pjsip_xfer_send_request(sub, tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to send NOTIFY to REFER",
+ pjsua_perror(THIS_FILE, "Unable to send NOTIFY to REFER",
status);
goto on_return;
}
@@ -4429,7 +4430,7 @@ static void on_call_transferred( pjsip_inv_session *inv,
pjsua_var.calls[new_call].xfer_sub = sub;
/* Put the invite_data in the subscription. */
- pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id,
+ pjsip_evsub_set_mod_data(sub, pjsua_var.mod.id,
&pjsua_var.calls[new_call]);
}
@@ -4511,13 +4512,13 @@ static void pjsua_call_on_tsx_state_changed(pjsip_inv_session *inv,
pj_list_init(&hdr_list);
pj_list_push_back(&hdr_list, accept_hdr);
- pjsip_dlg_respond( inv->dlg, rdata, PJSIP_SC_NOT_ACCEPTABLE_HERE,
+ pjsip_dlg_respond( inv->dlg, rdata, PJSIP_SC_NOT_ACCEPTABLE_HERE,
NULL, &hdr_list, NULL );
goto on_return;
}
/* Respond with 200 first, so that remote doesn't retransmit in case
- * the UI takes too long to process the message.
+ * the UI takes too long to process the message.
*/
pjsip_dlg_respond( inv->dlg, rdata, 200, NULL, NULL, NULL);
@@ -4625,7 +4626,7 @@ static pjsip_redirect_op pjsua_call_on_redirected(pjsip_inv_session *inv,
pj_log_push_indent();
if (pjsua_var.ua_cfg.cb.on_call_redirected) {
- op = (*pjsua_var.ua_cfg.cb.on_call_redirected)(call->index,
+ op = (*pjsua_var.ua_cfg.cb.on_call_redirected)(call->index,
target, e);
} else {
PJ_LOG(4,(THIS_FILE, "Unhandled redirection for call %d "
diff --git a/pjsip/src/test/tsx_uas_test.c b/pjsip/src/test/tsx_uas_test.c
index 3c43f535..77454c64 100644
--- a/pjsip/src/test/tsx_uas_test.c
+++ b/pjsip/src/test/tsx_uas_test.c
@@ -1,5 +1,5 @@
/* $Id$ */
-/*
+/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
@@ -15,7 +15,7 @@
*
* 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "test.h"
@@ -30,7 +30,7 @@
** UAS tests.
**
** This file performs various tests for UAC transactions. Each test will have
- ** a different Via branch param so that message receiver module and
+ ** a different Via branch param so that message receiver module and
** transaction user module can identify which test is being carried out.
**
** TEST1_BRANCH_ID
@@ -47,7 +47,7 @@
** response is sent.
**
** TEST4_BRANCH_ID
- ** Transaction retransmits last response (if any) without notifying
+ ** Transaction retransmits last response (if any) without notifying
** transaction user upon receiving request retransmissions on TRYING
** state
**
@@ -66,7 +66,7 @@
**
** TEST9_BRANCH_ID
** INVITE transaction MUST cease retransmission of final response when
- ** ACK is received. (Note: PJSIP also retransmit 2xx final response
+ ** ACK is received. (Note: PJSIP also retransmit 2xx final response
** until it's terminated by user).
** Transaction also MUST terminate in T4 seconds.
** (Only applicable for non-reliable transports).
@@ -116,7 +116,7 @@
#define TEST4_STATUS_CODE 200
#define TEST4_REQUEST_COUNT 2
#define TEST5_PROVISIONAL_CODE 100
-#define TEST5_STATUS_CODE 200
+#define TEST5_STATUS_CODE 200
#define TEST5_REQUEST_COUNT 2
#define TEST5_RESPONSE_COUNT 2
#define TEST6_PROVISIONAL_CODE 100
@@ -146,7 +146,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e);
static pj_bool_t on_rx_message(pjsip_rx_data *rdata);
/* UAC transaction user module. */
-static pjsip_module tsx_user =
+static pjsip_module tsx_user =
{
NULL, NULL, /* prev and next */
{ "Tsx-UAS-User", 12}, /* Name. */
@@ -164,7 +164,7 @@ static pjsip_module tsx_user =
};
/* Module to send request. */
-static pjsip_module msg_sender =
+static pjsip_module msg_sender =
{
NULL, NULL, /* prev and next */
{ "Msg-Sender", 10}, /* Name. */
@@ -241,7 +241,7 @@ static void send_response( pjsip_rx_data *rdata,
pj_status_t status;
pjsip_tx_data *tdata;
- status = pjsip_endpt_create_response( endpt, rdata, status_code, NULL,
+ status = pjsip_endpt_create_response( endpt, rdata, status_code, NULL,
&tdata);
if (status != PJ_SUCCESS) {
app_perror(" error: unable to create response", status);
@@ -271,7 +271,7 @@ static void schedule_send_response( pjsip_rx_data *rdata,
struct response *r;
pj_time_val delay;
- status = pjsip_endpt_create_response( endpt, rdata, status_code, NULL,
+ status = pjsip_endpt_create_response( endpt, rdata, status_code, NULL,
&tdata);
if (status != PJ_SUCCESS) {
app_perror(" error: unable to create response", status);
@@ -353,7 +353,7 @@ static void schedule_terminate_tsx( pjsip_transaction *tsx,
static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
{
if (pj_stricmp2(&tsx->branch, TEST1_BRANCH_ID)==0 ||
- pj_stricmp2(&tsx->branch, TEST2_BRANCH_ID)==0)
+ pj_stricmp2(&tsx->branch, TEST2_BRANCH_ID)==0)
{
/*
* TEST1_BRANCH_ID tests that non-INVITE transaction transmits final
@@ -374,7 +374,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -100;
}
-
+
/* Previous state must be completed. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -405,7 +405,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -110;
}
-
+
/* Previous state must be completed. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -465,20 +465,20 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
/* Check that status code is status_code. */
if (tsx->status_code != TEST4_STATUS_CODE) {
- PJ_LOG(3,(THIS_FILE,
+ PJ_LOG(3,(THIS_FILE,
" error: incorrect status code %d "
"(expecting %d)", tsx->status_code,
TEST4_STATUS_CODE));
test_complete = -120;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_TRYING) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
test_complete = -121;
}
- } else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)
+ } else if (tsx->state != PJSIP_TSX_STATE_DESTROYED)
{
PJ_LOG(3,(THIS_FILE, " error: unexpected state %s (122)",
pjsip_tsx_state_str(tsx->state)));
@@ -502,7 +502,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -130;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_PROCEEDING) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -537,11 +537,11 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
/* Check that status code is status_code. */
if (tsx->status_code != TEST6_STATUS_CODE) {
PJ_LOG(3,(THIS_FILE, " error: incorrect status code %d "
- "(expecting %d)", tsx->status_code,
+ "(expecting %d)", tsx->status_code,
TEST6_STATUS_CODE));
test_complete = -140;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -550,7 +550,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
} else if (tsx->state != PJSIP_TSX_STATE_PROCEEDING &&
tsx->state != PJSIP_TSX_STATE_COMPLETED &&
- tsx->state != PJSIP_TSX_STATE_DESTROYED)
+ tsx->state != PJSIP_TSX_STATE_DESTROYED)
{
PJ_LOG(3,(THIS_FILE, " error: unexpected state %s (142)",
pjsip_tsx_state_str(tsx->state)));
@@ -561,7 +561,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
} else
if (pj_stricmp2(&tsx->branch, TEST7_BRANCH_ID)==0 ||
- pj_stricmp2(&tsx->branch, TEST8_BRANCH_ID)==0)
+ pj_stricmp2(&tsx->branch, TEST8_BRANCH_ID)==0)
{
/*
* TEST7_BRANCH_ID and TEST8_BRANCH_ID test retransmission of
@@ -587,7 +587,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -150;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -605,7 +605,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
} else {
if (tsx->retransmit_count != 10) {
- PJ_LOG(3,(THIS_FILE,
+ PJ_LOG(3,(THIS_FILE,
" error: incorrect retransmit count %d "
"(expecting 10)",
tsx->retransmit_count));
@@ -621,7 +621,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -152;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_TRYING) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -656,7 +656,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -160;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_CONFIRMED) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -670,7 +670,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -162;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_TRYING) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -685,7 +685,7 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code"));
test_complete = -164;
}
-
+
/* Previous state. */
if (e->body.tsx_state.prev_state != PJSIP_TSX_STATE_COMPLETED) {
PJ_LOG(3,(THIS_FILE, " error: incorrect prev_state"));
@@ -703,10 +703,10 @@ static void tsx_user_on_tsx_state(pjsip_transaction *tsx, pjsip_event *e)
} else
if (pj_stricmp2(&tsx->branch, TEST10_BRANCH_ID)==0 ||
pj_stricmp2(&tsx->branch, TEST11_BRANCH_ID)==0 ||
- pj_stricmp2(&tsx->branch, TEST12_BRANCH_ID)==0)
+ pj_stricmp2(&tsx->branch, TEST12_BRANCH_ID)==0)
{
if (tsx->state == PJSIP_TSX_STATE_TERMINATED) {
-
+
if (!test_complete)
test_complete = 1;
@@ -740,11 +740,11 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
pj_status_t status;
if (pj_stricmp2(&branch_param, TEST1_BRANCH_ID) == 0 ||
- pj_stricmp2(&branch_param, TEST2_BRANCH_ID) == 0)
+ pj_stricmp2(&branch_param, TEST2_BRANCH_ID) == 0)
{
/*
- * TEST1_BRANCH_ID tests that non-INVITE transaction transmits 2xx
- * final response using correct transport and terminates transaction
+ * TEST1_BRANCH_ID tests that non-INVITE transaction transmits 2xx
+ * final response using correct transport and terminates transaction
* after 32 seconds.
*
* TEST2_BRANCH_ID performs similar test for non-2xx final response.
@@ -753,8 +753,8 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
TEST1_STATUS_CODE : TEST2_STATUS_CODE;
if (msg->type == PJSIP_REQUEST_MSG) {
- /* On received request, create UAS and respond with final
- * response.
+ /* On received request, create UAS and respond with final
+ * response.
*/
pjsip_transaction *tsx;
@@ -810,7 +810,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
save_key(tsx);
send_response(rdata, tsx, TEST3_PROVISIONAL_CODE);
- schedule_send_response(rdata, &tsx->transaction_key,
+ schedule_send_response(rdata, &tsx->transaction_key,
TEST3_STATUS_CODE, 2000);
} else {
@@ -840,7 +840,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
} else if (pj_stricmp2(&branch_param, TEST4_BRANCH_ID) == 0 ||
pj_stricmp2(&branch_param, TEST5_BRANCH_ID) == 0 ||
- pj_stricmp2(&branch_param, TEST6_BRANCH_ID) == 0)
+ pj_stricmp2(&branch_param, TEST6_BRANCH_ID) == 0)
{
/* TEST4_BRANCH_ID: absorbs retransmissions in TRYING state. */
@@ -877,7 +877,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
} else {
/* Verify the response received. */
-
+
PJ_LOG(4,(THIS_FILE, " received response number %d", recv_count));
++recv_count;
@@ -892,7 +892,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
PJ_LOG(3,(THIS_FILE, " error: incorrect status code!"));
test_complete = -133;
- }
+ }
if (recv_count > TEST5_RESPONSE_COUNT) {
PJ_LOG(3,(THIS_FILE, " error: not expecting response!"));
test_complete = -134;
@@ -928,7 +928,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
} else if (pj_stricmp2(&branch_param, TEST7_BRANCH_ID) == 0 ||
- pj_stricmp2(&branch_param, TEST8_BRANCH_ID) == 0)
+ pj_stricmp2(&branch_param, TEST8_BRANCH_ID) == 0)
{
/*
@@ -971,7 +971,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
code = TEST8_STATUS_CODE;
if (recv_count==1) {
-
+
if (rdata->msg_info.msg->line.status.code != code) {
PJ_LOG(3,(THIS_FILE," error: invalid status code"));
test_complete = -141;
@@ -987,7 +987,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
now = rdata->pkt_info.timestamp;
PJ_TIME_VAL_SUB(now, recv_last);
-
+
msec = now.sec*1000 + now.msec;
msec_expected = (1 << (recv_count-2)) * pjsip_cfg()->tsx.t1;
if (msec_expected > pjsip_cfg()->tsx.t2)
@@ -1016,7 +1016,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
} else if (pj_stricmp2(&branch_param, TEST9_BRANCH_ID) == 0) {
/*
- * TEST9_BRANCH_ID tests that the retransmission of INVITE final
+ * TEST9_BRANCH_ID tests that the retransmission of INVITE final
* response should cease when ACK is received. Transaction also MUST
* terminate in T4 seconds.
*/
@@ -1059,7 +1059,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
now = rdata->pkt_info.timestamp;
PJ_TIME_VAL_SUB(now, recv_last);
-
+
msec = now.sec*1000 + now.msec;
msec_expected = (1 << (recv_count-2)) * pjsip_cfg()->tsx.t1;
if (msec_expected > pjsip_cfg()->tsx.t2)
@@ -1081,11 +1081,11 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
pjsip_via_hdr *via;
status = pjsip_endpt_create_request_from_hdr(
- endpt, &pjsip_ack_method,
+ endpt, &pjsip_ack_method,
rdata->msg_info.to->uri,
rdata->msg_info.from,
rdata->msg_info.to,
- NULL,
+ NULL,
rdata->msg_info.cid,
rdata->msg_info.cseq->cseq,
NULL,
@@ -1120,7 +1120,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
} else if (pj_stricmp2(&branch_param, TEST10_BRANCH_ID) == 0 ||
pj_stricmp2(&branch_param, TEST11_BRANCH_ID) == 0 ||
- pj_stricmp2(&branch_param, TEST12_BRANCH_ID) == 0)
+ pj_stricmp2(&branch_param, TEST12_BRANCH_ID) == 0)
{
int test_num, code1, code2;
@@ -1131,6 +1131,8 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
else
test_num=12, code1 = 200, code2 = 0;
+ PJ_UNUSED_ARG(test_num);
+
if (rdata->msg_info.msg->type == PJSIP_REQUEST_MSG) {
/* On received response, create UAS. */
@@ -1145,7 +1147,7 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
pjsip_tsx_recv_msg(tsx, rdata);
save_key(tsx);
-
+
schedule_send_response(rdata, &tsx_key, code1, 1000);
if (code2)
@@ -1161,11 +1163,11 @@ static pj_bool_t on_rx_message(pjsip_rx_data *rdata)
return PJ_FALSE;
}
-/*
- * The generic test framework, used by most of the tests.
+/*
+ * The generic test framework, used by most of the tests.
*/
-static int perform_test( char *target_uri, char *from_uri,
- char *branch_param, int test_time,
+static int perform_test( char *target_uri, char *from_uri,
+ char *branch_param, int test_time,
const pjsip_method *method,
int request_cnt, int request_interval_msec,
int expecting_timeout)
@@ -1177,7 +1179,7 @@ static int perform_test( char *target_uri, char *from_uri,
int sent_cnt;
pj_status_t status;
- PJ_LOG(3,(THIS_FILE,
+ PJ_LOG(3,(THIS_FILE,
" please standby, this will take at most %d seconds..",
test_time));
@@ -1192,7 +1194,7 @@ static int perform_test( char *target_uri, char *from_uri,
/* Create request. */
status = pjsip_endpt_create_request( endpt, method, &target,
- &from, &target, NULL, NULL, -1,
+ &from, &target, NULL, NULL, -1,
NULL, &tdata);
if (status != PJ_SUCCESS) {
app_perror(" Error: unable to create request", status);
@@ -1368,7 +1370,7 @@ static int tsx_retransmit_last_response_test(const char *title,
PJ_LOG(3,(THIS_FILE," %s", title));
status = perform_test(TARGET_URI, FROM_URI, branch_id, 5,
- &pjsip_options_method,
+ &pjsip_options_method,
request_cnt, 1000, 1);
if (status && status != TEST_TIMEOUT_ERROR)
return status;
@@ -1422,7 +1424,7 @@ static int tsx_final_response_retransmission_test(void)
/*****************************************************************************
**
- ** TEST9_BRANCH_ID: retransmission of non-2xx INVITE final response must
+ ** TEST9_BRANCH_ID: retransmission of non-2xx INVITE final response must
** cease when ACK is received
**
*****************************************************************************
@@ -1463,7 +1465,7 @@ static int tsx_transport_failure_test(void)
int fail_delay;
char *branch_id;
char *title;
- } tests[] =
+ } tests[] =
{
{ 0, 10, TEST10_BRANCH_ID, "test10: failed transport in TRYING state (no delay)" },
{ 50, 10, TEST10_BRANCH_ID, "test10: failed transport in TRYING state (50 ms delay)" },
@@ -1537,13 +1539,13 @@ int tsx_uas_test(struct tsx_test_param *param)
test_param = param;
tp_flag = pjsip_transport_get_flag_from_type((pjsip_transport_type_e)param->type);
- pj_ansi_sprintf(TARGET_URI, "sip:bob@127.0.0.1:%d;transport=%s",
+ pj_ansi_sprintf(TARGET_URI, "sip:bob@127.0.0.1:%d;transport=%s",
param->port, param->tp_type);
- pj_ansi_sprintf(FROM_URI, "sip:alice@127.0.0.1:%d;transport=%s",
+ pj_ansi_sprintf(FROM_URI, "sip:alice@127.0.0.1:%d;transport=%s",
param->port, param->tp_type);
/* Check if loop transport is configured. */
- status = pjsip_endpt_acquire_transport(endpt, PJSIP_TRANSPORT_LOOP_DGRAM,
+ status = pjsip_endpt_acquire_transport(endpt, PJSIP_TRANSPORT_LOOP_DGRAM,
&addr, sizeof(addr), NULL, &loop);
if (status != PJ_SUCCESS) {
PJ_LOG(3,(THIS_FILE, " Error: loop transport is not configured!"));
@@ -1561,8 +1563,8 @@ int tsx_uas_test(struct tsx_test_param *param)
return -4;
}
- /* TEST1_BRANCH_ID: Basic 2xx final response.
- * TEST2_BRANCH_ID: Basic non-2xx final response.
+ /* TEST1_BRANCH_ID: Basic 2xx final response.
+ * TEST2_BRANCH_ID: Basic non-2xx final response.
*/
status = tsx_basic_final_response_test();
if (status != 0)
@@ -1577,7 +1579,7 @@ int tsx_uas_test(struct tsx_test_param *param)
/* TEST4_BRANCH_ID: absorbs retransmissions in TRYING state
*/
status = tsx_retransmit_last_response_test(TEST4_TITLE,
- TEST4_BRANCH_ID,
+ TEST4_BRANCH_ID,
TEST4_REQUEST_COUNT,
TEST4_STATUS_CODE);
if (status != 0)
@@ -1586,7 +1588,7 @@ int tsx_uas_test(struct tsx_test_param *param)
/* TEST5_BRANCH_ID: retransmit last response in PROCEEDING state
*/
status = tsx_retransmit_last_response_test(TEST5_TITLE,
- TEST5_BRANCH_ID,
+ TEST5_BRANCH_ID,
TEST5_REQUEST_COUNT,
TEST5_STATUS_CODE);
if (status != 0)
@@ -1599,7 +1601,7 @@ int tsx_uas_test(struct tsx_test_param *param)
*/
if ((tp_flag & PJSIP_TRANSPORT_RELIABLE) == 0) {
status = tsx_retransmit_last_response_test(TEST6_TITLE,
- TEST6_BRANCH_ID,
+ TEST6_BRANCH_ID,
TEST6_REQUEST_COUNT,
TEST6_STATUS_CODE);
if (status != 0)
@@ -1613,7 +1615,7 @@ int tsx_uas_test(struct tsx_test_param *param)
if (status != 0)
return status;
- /* TEST9_BRANCH_ID: retransmission of non-2xx INVITE final response must
+ /* TEST9_BRANCH_ID: retransmission of non-2xx INVITE final response must
* cease when ACK is received
* Only applicable for non-reliable transports.
*/
diff --git a/pjsip/src/test/uri_test.c b/pjsip/src/test/uri_test.c
index 2a806603..9f0fd804 100644
--- a/pjsip/src/test/uri_test.c
+++ b/pjsip/src/test/uri_test.c
@@ -1,5 +1,5 @@
/* $Id$ */
-/*
+/*
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
*
@@ -15,7 +15,7 @@
*
* 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
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "test.h"
#include <pjsip.h>
@@ -67,7 +67,6 @@ static pjsip_uri *create_uri14( pj_pool_t *pool );
static pjsip_uri *create_uri15( pj_pool_t *pool );
static pjsip_uri *create_uri16( pj_pool_t *pool );
static pjsip_uri *create_uri17( pj_pool_t *pool );
-static pjsip_uri *create_uri18( pj_pool_t *pool );
static pjsip_uri *create_uri25( pj_pool_t *pool );
static pjsip_uri *create_uri26( pj_pool_t *pool );
static pjsip_uri *create_uri27( pj_pool_t *pool );
@@ -96,7 +95,7 @@ struct uri_test
pjsip_uri *(*creator)(pj_pool_t *pool);
const char *printed;
pj_size_t len;
-} uri_test_array[] =
+} uri_test_array[] =
{
{
PJ_SUCCESS,
@@ -183,7 +182,7 @@ struct uri_test
},
{
/* Excercise strange character sets allowed in display, user, password,
- * host, and port.
+ * host, and port.
*/
PJ_SUCCESS,
"This is -. !% *_+`'~ me <sip:a19A&=+$,;?/%2c:%40a&Zz=+$,@"
@@ -197,7 +196,7 @@ struct uri_test
&create_uri15,
},
{
- /* Another excercise to the allowed character sets to the username
+ /* Another excercise to the allowed character sets to the username
* and password.
*/
PJ_SUCCESS,
@@ -438,7 +437,7 @@ static pjsip_uri *create_uri4(pj_pool_t *pool)
static pjsip_uri *create_uri5(pj_pool_t *pool)
{
/* "sip:localhost;pickup=hurry;user=phone;message=I%20am%20sorry"
- "?Subject=Hello%20There&Server=SIP%20Server"
+ "?Subject=Hello%20There&Server=SIP%20Server"
*/
pjsip_sip_uri *url = pjsip_sip_uri_create(pool, 0);
@@ -658,7 +657,7 @@ static pjsip_uri *create_uri29(pj_pool_t *pool)
pjsip_tel_uri *uri = pjsip_tel_uri_create(pool);
uri->number = pj_str("(44).1234-*#+Deaf");
- return (pjsip_uri*)uri;
+ return (pjsip_uri*)uri;
}
/* "tel:+1;isub=/:@&$,-_.!~*'()[]/:&$aA1%21+=" */
@@ -668,7 +667,7 @@ static pjsip_uri *create_uri30(pj_pool_t *pool)
uri->number = pj_str("+1");
uri->isub_param = pj_str("/:@&$,-_.!~*'()[]/:&$aA1!+=");
- return (pjsip_uri*)uri;
+ return (pjsip_uri*)uri;
}
/* "tel:+1;ext=+123" */
@@ -678,7 +677,7 @@ static pjsip_uri *create_uri31(pj_pool_t *pool)
uri->number = pj_str("+1");
uri->ext_param = pj_str("+123");
- return (pjsip_uri*)uri;
+ return (pjsip_uri*)uri;
}
/* "tel:911;phone-context=+1-911" */
@@ -688,7 +687,7 @@ static pjsip_uri *create_uri32(pj_pool_t *pool)
uri->number = pj_str("911");
uri->context = pj_str("+1-911");
- return (pjsip_uri*)uri;
+ return (pjsip_uri*)uri;
}
/* "tel:911;phone-context=emergency.example.com" */
@@ -698,7 +697,7 @@ static pjsip_uri *create_uri33(pj_pool_t *pool)
uri->number = pj_str("911");
uri->context = pj_str("EMERGENCY.EXAMPLE.COM");
- return (pjsip_uri*)uri;
+ return (pjsip_uri*)uri;
}
/* "tel:911;p1=p1;p2=p2" */
@@ -708,12 +707,12 @@ static pjsip_uri *create_uri34(pj_pool_t *pool)
pjsip_param *p;
uri->number = pj_str("911");
-
+
p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = p->value = pj_str("p1");
pj_list_insert_before(&uri->other_param, p);
- return (pjsip_uri*)uri;
+ return (pjsip_uri*)uri;
}
/* "sip:user@[::1];maddr=[::01]" */
@@ -749,7 +748,7 @@ static pjsip_uri *create_uri37( pj_pool_t *pool )
url = pjsip_sip_uri_create(pool, 0);
url->host = pj_str("localhost");
-
+
name->uri = (pjsip_uri*)url;
return (pjsip_uri*)name;
@@ -767,7 +766,7 @@ static pjsip_uri *create_uri38( pj_pool_t *pool )
url = pjsip_sip_uri_create(pool, 0);
url->host = pj_str("localhost");
-
+
name->uri = (pjsip_uri*)url;
return (pjsip_uri*)name;
@@ -999,8 +998,8 @@ static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
avg_parse = 1;
avg_parse = 1000000 / avg_parse;
- PJ_LOG(3,(THIS_FILE,
- " %u.%u MB of urls parsed in %d.%03ds (avg=%d urls/sec)",
+ PJ_LOG(3,(THIS_FILE,
+ " %u.%u MB of urls parsed in %d.%03ds (avg=%d urls/sec)",
(unsigned)(var.parse_len/1000000), (unsigned)kbytes,
elapsed.sec, elapsed.msec,
(unsigned)avg_parse));
@@ -1018,8 +1017,8 @@ static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
avg_print = 1;
avg_print = 1000000 / avg_print;
- PJ_LOG(3,(THIS_FILE,
- " %u.%u MB of urls printed in %d.%03ds (avg=%d urls/sec)",
+ PJ_LOG(3,(THIS_FILE,
+ " %u.%u MB of urls printed in %d.%03ds (avg=%d urls/sec)",
(unsigned)(var.print_len/1000000), (unsigned)kbytes,
elapsed.sec, elapsed.msec,
(unsigned)avg_print));
@@ -1037,8 +1036,8 @@ static int uri_benchmark(unsigned *p_parse, unsigned *p_print, unsigned *p_cmp)
avg_cmp = 1;
avg_cmp = 1000000 / avg_cmp;
- PJ_LOG(3,(THIS_FILE,
- " %u.%u MB of urls compared in %d.%03ds (avg=%d urls/sec)",
+ PJ_LOG(3,(THIS_FILE,
+ " %u.%u MB of urls compared in %d.%03ds (avg=%d urls/sec)",
(unsigned)(var.cmp_len/1000000), (unsigned)kbytes,
elapsed.sec, elapsed.msec,
(unsigned)avg_cmp));
@@ -1084,8 +1083,8 @@ int uri_test(void)
avg_len /= PJ_ARRAY_SIZE(uri_test_array);
- /*
- * Print maximum parse/sec
+ /*
+ * Print maximum parse/sec
*/
for (i=0, max=0; i<COUNT; ++i)
if (run[i].parse > max) max = run[i].parse;