summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-05-01 16:54:54 +0000
committerBenny Prijono <bennylp@teluu.com>2007-05-01 16:54:54 +0000
commit682ee6718afa661df775bd44b4fdf89344ec67b2 (patch)
tree5949acca77d1ff14c50b1fc3b6d3a996539fe7d6
parentb93717c9a39a0755f65df6b252b1e3506d7a42c8 (diff)
PJSDP port to Symbian
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1240 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r--build.symbian/pjsdp.mmp29
-rw-r--r--build.symbian/pjsip.mmp46
-rw-r--r--build.symbian/pjsip_simple.mmp35
-rw-r--r--build.symbian/pjsip_ua.mmp31
-rw-r--r--pjlib/include/pj/config_site_sample.h6
-rw-r--r--pjmedia/src/pjmedia/sdp.c32
-rw-r--r--pjmedia/src/pjmedia/sdp_neg.c28
-rw-r--r--pjsip/include/pjsip/print_util.h4
-rw-r--r--pjsip/src/pjsip/sip_auth_client.c17
-rw-r--r--pjsip/src/pjsip/sip_auth_msg.c23
-rw-r--r--pjsip/src/pjsip/sip_auth_parser.c4
-rw-r--r--pjsip/src/pjsip/sip_auth_server.c2
-rw-r--r--pjsip/src/pjsip/sip_dialog.c80
-rw-r--r--pjsip/src/pjsip/sip_endpoint.c6
-rw-r--r--pjsip/src/pjsip/sip_msg.c103
-rw-r--r--pjsip/src/pjsip/sip_parser.c25
-rw-r--r--pjsip/src/pjsip/sip_resolve.c8
17 files changed, 328 insertions, 151 deletions
diff --git a/build.symbian/pjsdp.mmp b/build.symbian/pjsdp.mmp
new file mode 100644
index 00000000..351f9a55
--- /dev/null
+++ b/build.symbian/pjsdp.mmp
@@ -0,0 +1,29 @@
+TARGET pjsdp.lib
+TARGETTYPE lib
+UID 0x100039CE 0x10004299
+VENDORID 0x70000001
+
+SOURCEPATH ..\pjmedia\src\pjmedia
+
+OPTION CW -lang c++
+
+MACRO PJ_M_I386=1
+MACRO PJ_SYMBIAN=1
+MACRO PJ_EXPORTING
+
+//
+// Platform independent source
+//
+SOURCE errno.c
+SOURCE sdp.c
+SOURCE sdp_cmp.c
+SOURCE sdp_neg.c
+
+
+SYSTEMINCLUDE ..\pjlib\include
+SYSTEMINCLUDE ..\pjlib-util\include
+SYSTEMINCLUDE ..\pjmedia\include
+
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\libc
+
diff --git a/build.symbian/pjsip.mmp b/build.symbian/pjsip.mmp
new file mode 100644
index 00000000..cb280b67
--- /dev/null
+++ b/build.symbian/pjsip.mmp
@@ -0,0 +1,46 @@
+TARGET pjsip.lib
+TARGETTYPE lib
+UID 0x100039CE 0x10004299
+VENDORID 0x70000001
+
+SOURCEPATH ..\pjsip\src\pjsip
+
+MACRO PJ_M_I386=1
+MACRO PJ_SYMBIAN=1
+MACRO PJ_IMPORTING
+
+OPTION CW -lang c++
+
+// PJSIP-CORE files
+
+SOURCE sip_auth_client.c
+SOURCE sip_auth_msg.c
+SOURCE sip_auth_parser.c
+SOURCE sip_auth_server.c
+SOURCE sip_dialog.c
+SOURCE sip_endpoint.c
+SOURCE sip_errno.c
+SOURCE sip_msg.c
+SOURCE sip_parser.c
+SOURCE sip_resolve.c
+SOURCE sip_tel_uri.c
+SOURCE sip_transaction.c
+SOURCE sip_transport.c
+SOURCE sip_transport_loop.c
+SOURCE sip_transport_tcp.c
+SOURCE sip_transport_udp.c
+SOURCE sip_ua_layer.c
+SOURCE sip_uri.c
+SOURCE sip_util.c
+SOURCE sip_util_proxy.c
+SOURCE sip_util_statefull.c
+
+SYSTEMINCLUDE ..\pjlib\include
+SYSTEMINCLUDE ..\pjlib-util\include
+SYSTEMINCLUDE ..\pjsip\include
+
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\libc
+
+CAPABILITY None
+
diff --git a/build.symbian/pjsip_simple.mmp b/build.symbian/pjsip_simple.mmp
new file mode 100644
index 00000000..a5763d8f
--- /dev/null
+++ b/build.symbian/pjsip_simple.mmp
@@ -0,0 +1,35 @@
+TARGET pjsip_simple.lib
+TARGETTYPE lib
+UID 0x100039CE 0x10004299
+VENDORID 0x70000001
+
+SOURCEPATH ..\pjsip\src\pjsip-simple
+
+MACRO PJ_M_I386=1
+MACRO PJ_SYMBIAN=1
+MACRO PJ_IMPORTING
+
+//OPTION CW -lang c++
+
+
+// PJSIP-SIMPLE files
+
+SOURCE errno.c
+SOURCE evsub.c
+SOURCE evsub_msg.c
+SOURCE iscomposing.c
+SOURCE pidf.c
+SOURCE presence.c
+SOURCE presence_body.c
+SOURCE publishc.c
+SOURCE xpidf.c
+
+SYSTEMINCLUDE ..\pjlib\include
+SYSTEMINCLUDE ..\pjlib-util\include
+SYSTEMINCLUDE ..\pjsip\include
+
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\libc
+
+CAPABILITY None
+
diff --git a/build.symbian/pjsip_ua.mmp b/build.symbian/pjsip_ua.mmp
new file mode 100644
index 00000000..53017865
--- /dev/null
+++ b/build.symbian/pjsip_ua.mmp
@@ -0,0 +1,31 @@
+TARGET pjsip_ua.lib
+TARGETTYPE lib
+UID 0x100039CE 0x10004299
+VENDORID 0x70000001
+
+SOURCEPATH ..\pjsip\src\pjsip-ua
+
+MACRO PJ_M_I386=1
+MACRO PJ_SYMBIAN=1
+MACRO PJ_IMPORTING
+
+//OPTION CW -lang c++
+
+
+// PJSIP-SIMPLE files
+
+SOURCE sip_inv.c
+SOURCE sip_reg.c
+SOURCE sip_replaces.c
+SOURCE sip_xfer.c
+
+SYSTEMINCLUDE ..\pjlib\include
+SYSTEMINCLUDE ..\pjlib-util\include
+SYSTEMINCLUDE ..\pjsip\include
+SYSTEMINCLUDE ..\pjmedia\include
+
+SYSTEMINCLUDE \epoc32\include
+SYSTEMINCLUDE \epoc32\include\libc
+
+CAPABILITY None
+
diff --git a/pjlib/include/pj/config_site_sample.h b/pjlib/include/pj/config_site_sample.h
index f873dd56..da67ca85 100644
--- a/pjlib/include/pj/config_site_sample.h
+++ b/pjlib/include/pj/config_site_sample.h
@@ -26,6 +26,12 @@
# define PJMEDIA_HAS_SPEEX_AEC 0
#endif
+/*
+ * Typical configuration for Symbian OS target
+ */
+#if defined(PJ_SYMBIAN) && PJ_SYMBIAN!=0
+# define PJMEDIA_SOUND_IMPLEMENTATION PJMEDIA_SOUND_NULL_SOUND
+#endif
/*
diff --git a/pjmedia/src/pjmedia/sdp.c b/pjmedia/src/pjmedia/sdp.c
index d9cc8289..e0a66fc3 100644
--- a/pjmedia/src/pjmedia/sdp.c
+++ b/pjmedia/src/pjmedia/sdp.c
@@ -103,7 +103,7 @@ PJ_DEF(pjmedia_sdp_attr*) pjmedia_sdp_attr_create( pj_pool_t *pool,
PJ_ASSERT_RETURN(pool && name, NULL);
- attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+ attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
pj_strdup2(pool, &attr->name, name);
if (value)
@@ -123,7 +123,7 @@ PJ_DEF(pjmedia_sdp_attr*) pjmedia_sdp_attr_clone(pj_pool_t *pool,
PJ_ASSERT_RETURN(pool && rhs, NULL);
- attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+ attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
pj_strdup(pool, &attr->name, &rhs->name);
pj_strdup_with_null(pool, &attr->value, &rhs->value);
@@ -307,7 +307,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_attr_get_rtpmap( const pjmedia_sdp_attr *attr,
status = PJ_SUCCESS;
}
- PJ_CATCH(SYNTAX_ERROR) {
+ PJ_CATCH_ANY {
status = PJMEDIA_SDP_EINRTPMAP;
}
PJ_END;
@@ -402,7 +402,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_attr_get_rtcp(const pjmedia_sdp_attr *attr,
status = PJ_SUCCESS;
}
- PJ_CATCH(SYNTAX_ERROR) {
+ PJ_CATCH_ANY {
status = PJMEDIA_SDP_EINRTCP;
}
PJ_END;
@@ -419,7 +419,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_attr_to_rtpmap(pj_pool_t *pool,
{
PJ_ASSERT_RETURN(pool && attr && p_rtpmap, PJ_EINVAL);
- *p_rtpmap = pj_pool_alloc(pool, sizeof(pjmedia_sdp_rtpmap));
+ *p_rtpmap = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_rtpmap);
PJ_ASSERT_RETURN(*p_rtpmap, PJ_ENOMEM);
return pjmedia_sdp_attr_get_rtpmap(attr, *p_rtpmap);
@@ -442,7 +442,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool,
PJMEDIA_SDP_EINRTPMAP);
- attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+ attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
PJ_ASSERT_RETURN(attr != NULL, PJ_ENOMEM);
attr->name.ptr = "rtpmap";
@@ -464,7 +464,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_rtpmap_to_attr(pj_pool_t *pool,
return PJMEDIA_SDP_ERTPMAPTOOLONG;
attr->value.slen = len;
- attr->value.ptr = pj_pool_alloc(pool, attr->value.slen);
+ attr->value.ptr = (char*) pj_pool_alloc(pool, attr->value.slen);
pj_memcpy(attr->value.ptr, tempbuf, attr->value.slen);
*p_attr = attr;
@@ -493,7 +493,7 @@ static int print_connection_info( pjmedia_sdp_conn *c, char *buf, int len)
PJ_DEF(pjmedia_sdp_conn*) pjmedia_sdp_conn_clone (pj_pool_t *pool,
const pjmedia_sdp_conn *rhs)
{
- pjmedia_sdp_conn *c = pj_pool_alloc (pool, sizeof(pjmedia_sdp_conn));
+ pjmedia_sdp_conn *c = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_conn);
if (!c) return NULL;
if (!pj_strdup (pool, &c->net_type, &rhs->net_type)) return NULL;
@@ -588,7 +588,7 @@ PJ_DEF(pjmedia_sdp_media*) pjmedia_sdp_media_clone(
const pjmedia_sdp_media *rhs)
{
unsigned int i;
- pjmedia_sdp_media *m = pj_pool_alloc (pool, sizeof(pjmedia_sdp_media));
+ pjmedia_sdp_media *m = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_media);
PJ_ASSERT_RETURN(m != NULL, NULL);
pj_strdup (pool, &m->desc.media, &rhs->desc.media);
@@ -967,7 +967,7 @@ static pjmedia_sdp_attr *parse_attr( pj_pool_t *pool, pj_scanner *scanner,
ctx->last_error = PJMEDIA_SDP_EINATTR;
- attr = pj_pool_alloc(pool, sizeof(pjmedia_sdp_attr));
+ attr = PJ_POOL_ALLOC_T(pool, pjmedia_sdp_attr);
/* check equal sign */
if (*(scanner->curptr+1) != '=') {
@@ -1015,7 +1015,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool,
pj_scanner scanner;
pjmedia_sdp_session *session;
pjmedia_sdp_media *media = NULL;
- void *attr;
+ pjmedia_sdp_attr *attr;
pjmedia_sdp_conn *conn;
pj_str_t dummy;
int cur_name = 254;
@@ -1027,7 +1027,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool,
init_sdp_parser();
pj_scan_init(&scanner, buf, len, 0, &on_scanner_error);
- session = pj_pool_calloc(pool, 1, sizeof(pjmedia_sdp_session));
+ session = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session);
PJ_ASSERT_RETURN(session != NULL, PJ_ENOMEM);
PJ_TRY {
@@ -1051,7 +1051,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool,
parse_generic_line(&scanner, &session->name, &ctx);
break;
case 'c':
- conn = pj_pool_calloc(pool, 1, sizeof(*conn));
+ conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn);
parse_connection_info(&scanner, conn, &ctx);
if (media) {
media->conn = conn;
@@ -1063,7 +1063,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool,
parse_time(&scanner, session, &ctx);
break;
case 'm':
- media = pj_pool_calloc(pool, 1, sizeof(*media));
+ media = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_media);
parse_media(&scanner, media, &ctx);
session->media[ session->media_count++ ] = media;
break;
@@ -1094,7 +1094,7 @@ PJ_DEF(pj_status_t) pjmedia_sdp_parse( pj_pool_t *pool,
ctx.last_error = PJ_SUCCESS;
}
- PJ_CATCH(SYNTAX_ERROR) {
+ PJ_CATCH_ANY {
char errmsg[PJ_ERR_MSG_SIZE];
pj_strerror(ctx.last_error, errmsg, sizeof(errmsg));
@@ -1137,7 +1137,7 @@ pjmedia_sdp_session_clone( pj_pool_t *pool,
PJ_ASSERT_RETURN(pool && rhs, NULL);
- sess = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_session));
+ sess = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_session);
PJ_ASSERT_RETURN(sess != NULL, NULL);
/* Clone origin line. */
diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c
index 612941b1..5975eca4 100644
--- a/pjmedia/src/pjmedia/sdp_neg.c
+++ b/pjmedia/src/pjmedia/sdp_neg.c
@@ -83,7 +83,7 @@ pjmedia_sdp_neg_create_w_local_offer( pj_pool_t *pool,
PJ_ASSERT_RETURN((status=pjmedia_sdp_validate(local))==PJ_SUCCESS, status);
/* Create and initialize negotiator. */
- neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
+ neg = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_neg);
PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM);
neg->state = PJMEDIA_SDP_NEG_STATE_LOCAL_OFFER;
@@ -118,7 +118,7 @@ pjmedia_sdp_neg_create_w_remote_offer(pj_pool_t *pool,
return status;
/* Create and initialize negotiator. */
- neg = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_neg));
+ neg = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_neg);
PJ_ASSERT_RETURN(neg != NULL, PJ_ENOMEM);
neg->prefer_remote_codec_order = PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER;
@@ -563,7 +563,7 @@ static pj_status_t process_m_answer( pj_pool_t *pool,
* compare the encoding name.
*/
const pjmedia_sdp_attr *a;
- pjmedia_sdp_rtpmap or;
+ pjmedia_sdp_rtpmap or_;
/* Get the rtpmap for the payload type in the offer. */
a = pjmedia_sdp_media_find_attr2(offer, "rtpmap", fmt);
@@ -571,7 +571,7 @@ static pj_status_t process_m_answer( pj_pool_t *pool,
pj_assert(!"Bug! Offer should have been validated");
return PJ_EBUG;
}
- pjmedia_sdp_attr_get_rtpmap(a, &or);
+ pjmedia_sdp_attr_get_rtpmap(a, &or_);
/* Find paylaod in answer SDP with matching
* encoding name and clock rate.
@@ -586,9 +586,9 @@ static pj_status_t process_m_answer( pj_pool_t *pool,
/* See if encoding name, clock rate, and channel
* count match
*/
- if (!pj_stricmp(&or.enc_name, &ar.enc_name) &&
- or.clock_rate == ar.clock_rate &&
- (pj_stricmp(&or.param, &ar.param)==0 ||
+ if (!pj_stricmp(&or_.enc_name, &ar.enc_name) &&
+ or_.clock_rate == ar.clock_rate &&
+ (pj_stricmp(&or_.param, &ar.param)==0 ||
(ar.param.slen==1 && *ar.param.ptr=='1')))
{
/* Match! */
@@ -744,7 +744,7 @@ static pj_status_t match_offer(pj_pool_t *pool,
* compare the encoding name.
*/
const pjmedia_sdp_attr *a;
- pjmedia_sdp_rtpmap or;
+ pjmedia_sdp_rtpmap or_;
pj_bool_t is_codec;
/* Get the rtpmap for the payload type in the offer. */
@@ -754,9 +754,9 @@ static pj_status_t match_offer(pj_pool_t *pool,
pj_assert(!"Bug! Offer should have been validated");
return PJMEDIA_SDP_EMISSINGRTPMAP;
}
- pjmedia_sdp_attr_get_rtpmap(a, &or);
+ pjmedia_sdp_attr_get_rtpmap(a, &or_);
- if (!pj_strcmp2(&or.enc_name, "telephone-event")) {
+ if (!pj_strcmp2(&or_.enc_name, "telephone-event")) {
offer_has_telephone_event = 1;
if (found_matching_telephone_event)
continue;
@@ -781,10 +781,10 @@ static pj_status_t match_offer(pj_pool_t *pool,
/* See if encoding name, clock rate, and
* channel count match
*/
- if (!pj_stricmp(&or.enc_name, &lr.enc_name) &&
- or.clock_rate == lr.clock_rate &&
- (pj_strcmp(&or.param, &lr.param)==0 ||
- (or.param.slen==1 && *or.param.ptr=='1')))
+ if (!pj_stricmp(&or_.enc_name, &lr.enc_name) &&
+ or_.clock_rate == lr.clock_rate &&
+ (pj_strcmp(&or_.param, &lr.param)==0 ||
+ (or_.param.slen==1 && *or_.param.ptr=='1')))
{
/* Match! */
if (is_codec)
diff --git a/pjsip/include/pjsip/print_util.h b/pjsip/include/pjsip/print_util.h
index 6fb6f7f1..c75b6e27 100644
--- a/pjsip/include/pjsip/print_util.h
+++ b/pjsip/include/pjsip/print_util.h
@@ -105,10 +105,10 @@ extern const pj_str_t pjsip_hdr_names[];
PJ_INLINE(void) init_hdr(void *hptr, pjsip_hdr_e htype, void *vptr)
{
- pjsip_hdr *hdr = hptr;
+ pjsip_hdr *hdr = (pjsip_hdr*) hptr;
hdr->type = htype;
hdr->name = hdr->sname = pjsip_hdr_names[htype];
- hdr->vptr = vptr;
+ hdr->vptr = (pjsip_hdr_vptr*) vptr;
pj_list_init(hdr);
}
diff --git a/pjsip/src/pjsip/sip_auth_client.c b/pjsip/src/pjsip/sip_auth_client.c
index 75a86abd..86724a90 100644
--- a/pjsip/src/pjsip/sip_auth_client.c
+++ b/pjsip/src/pjsip/sip_auth_client.c
@@ -213,7 +213,7 @@ static pj_status_t respond_digest( pj_pool_t *pool,
pj_strdup(pool, &cred->opaque, &chal->opaque);
/* Allocate memory. */
- cred->response.ptr = pj_pool_alloc(pool, PJSIP_MD5STRLEN);
+ cred->response.ptr = (char*) pj_pool_alloc(pool, PJSIP_MD5STRLEN);
cred->response.slen = PJSIP_MD5STRLEN;
if (chal->qop.slen == 0) {
@@ -228,7 +228,7 @@ static pj_status_t respond_digest( pj_pool_t *pool,
* We respond with selecting "qop=auth" protection.
*/
cred->qop = pjsip_AUTH_STR;
- cred->nc.ptr = pj_pool_alloc(pool, 16);
+ cred->nc.ptr = (char*) pj_pool_alloc(pool, 16);
cred->nc.slen = pj_ansi_snprintf(cred->nc.ptr, 16, "%08u", nc);
if (cnonce && cnonce->slen) {
@@ -266,7 +266,8 @@ static void update_digest_session( pj_pool_t *ses_pool,
/* Initialize cnonce and qop if not present. */
if (cached_auth->cnonce.slen == 0) {
/* Save the whole challenge */
- cached_auth->last_chal = pjsip_hdr_clone(ses_pool, hdr);
+ cached_auth->last_chal = (pjsip_www_authenticate_hdr*)
+ pjsip_hdr_clone(ses_pool, hdr);
/* Create cnonce */
pj_create_unique_string( ses_pool, &cached_auth->cnonce );
@@ -366,7 +367,8 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_clone( pj_pool_t *pool,
sess->pool = pool;
sess->endpt = (pjsip_endpoint*)rhs->endpt;
sess->cred_cnt = rhs->cred_cnt;
- sess->cred_info = pj_pool_alloc(pool,
+ sess->cred_info = (pjsip_cred_info*)
+ 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);
@@ -401,7 +403,8 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_set_credentials( pjsip_auth_clt_sess *sess,
sess->cred_cnt = 0;
} else {
int i;
- sess->cred_info = pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c));
+ sess->cred_info = (pjsip_cred_info*)
+ pj_pool_alloc(sess->pool, cred_cnt * sizeof(*c));
for (i=0; i<cred_cnt; ++i) {
sess->cred_info[i].data_type = c[i].data_type;
pj_strdup(sess->pool, &sess->cred_info[i].scheme, &c[i].scheme);
@@ -816,7 +819,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess,
*/
cached_auth = find_cached_auth(sess, &hchal->challenge.common.realm );
if (!cached_auth) {
- cached_auth = pj_pool_zalloc( sess->pool, sizeof(*cached_auth));
+ cached_auth = PJ_POOL_ZALLOC_T( sess->pool, pjsip_cached_auth);
pj_strdup( sess->pool, &cached_auth->realm, &hchal->challenge.common.realm);
cached_auth->is_proxy = (hchal->type == PJSIP_H_PROXY_AUTHENTICATE);
# if (PJSIP_AUTH_HEADER_CACHING)
@@ -844,7 +847,7 @@ PJ_DEF(pj_status_t) pjsip_auth_clt_reinit_req( pjsip_auth_clt_sess *sess,
/* Remove branch param in Via header. */
- via = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
+ via = (pjsip_via_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
via->branch_param.slen = 0;
/* Must invalidate the message! */
diff --git a/pjsip/src/pjsip/sip_auth_msg.c b/pjsip/src/pjsip/sip_auth_msg.c
index 86d62bd3..7b6cbc20 100644
--- a/pjsip/src/pjsip/sip_auth_msg.c
+++ b/pjsip/src/pjsip/sip_auth_msg.c
@@ -46,7 +46,8 @@ static pjsip_hdr_vptr authorization_hdr_vptr =
PJ_DEF(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool)
{
- pjsip_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+ pjsip_authorization_hdr *hdr;
+ hdr = PJ_POOL_ZALLOC_T(pool, pjsip_authorization_hdr);
init_hdr(hdr, PJSIP_H_AUTHORIZATION, &authorization_hdr_vptr);
pj_list_init(&hdr->credential.common.other_param);
return hdr;
@@ -54,7 +55,8 @@ PJ_DEF(pjsip_authorization_hdr*) pjsip_authorization_hdr_create(pj_pool_t *pool)
PJ_DEF(pjsip_proxy_authorization_hdr*) pjsip_proxy_authorization_hdr_create(pj_pool_t *pool)
{
- pjsip_proxy_authorization_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+ pjsip_proxy_authorization_hdr *hdr;
+ hdr = PJ_POOL_ZALLOC_T(pool, pjsip_proxy_authorization_hdr);
init_hdr(hdr, PJSIP_H_PROXY_AUTHORIZATION, &authorization_hdr_vptr);
pj_list_init(&hdr->credential.common.other_param);
return hdr;
@@ -168,11 +170,13 @@ static pjsip_authorization_hdr* pjsip_authorization_hdr_clone( pj_pool_t *pool,
return hdr;
}
-static pjsip_authorization_hdr* pjsip_authorization_hdr_shallow_clone( pj_pool_t *pool,
- const pjsip_authorization_hdr *rhs)
+static pjsip_authorization_hdr*
+pjsip_authorization_hdr_shallow_clone( pj_pool_t *pool,
+ const pjsip_authorization_hdr *rhs)
{
/* This function also serves Proxy-Authorization header. */
- pjsip_authorization_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_authorization_hdr *hdr;
+ hdr = PJ_POOL_ALLOC_T(pool, pjsip_authorization_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone(pool, &hdr->credential.common.other_param,
&rhs->credential.common.other_param);
@@ -201,7 +205,8 @@ static pjsip_hdr_vptr www_authenticate_hdr_vptr =
PJ_DEF(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t *pool)
{
- pjsip_www_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+ pjsip_www_authenticate_hdr *hdr;
+ hdr = PJ_POOL_ZALLOC_T(pool, pjsip_www_authenticate_hdr);
init_hdr(hdr, PJSIP_H_WWW_AUTHENTICATE, &www_authenticate_hdr_vptr);
pj_list_init(&hdr->challenge.common.other_param);
return hdr;
@@ -210,7 +215,8 @@ PJ_DEF(pjsip_www_authenticate_hdr*) pjsip_www_authenticate_hdr_create(pj_pool_t
PJ_DEF(pjsip_proxy_authenticate_hdr*) pjsip_proxy_authenticate_hdr_create(pj_pool_t *pool)
{
- pjsip_proxy_authenticate_hdr *hdr = pj_pool_calloc(pool, 1, sizeof(*hdr));
+ pjsip_proxy_authenticate_hdr *hdr;
+ hdr = PJ_POOL_ZALLOC_T(pool, pjsip_proxy_authenticate_hdr);
init_hdr(hdr, PJSIP_H_PROXY_AUTHENTICATE, &www_authenticate_hdr_vptr);
pj_list_init(&hdr->challenge.common.other_param);
return hdr;
@@ -322,7 +328,8 @@ static pjsip_www_authenticate_hdr* pjsip_www_authenticate_hdr_shallow_clone( pj_
const pjsip_www_authenticate_hdr *rhs)
{
/* This function also serves Proxy-Authenticate header. */
- pjsip_www_authenticate_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_www_authenticate_hdr *hdr;
+ hdr = PJ_POOL_ALLOC_T(pool, pjsip_www_authenticate_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone(pool, &hdr->challenge.common.other_param,
&rhs->challenge.common.other_param);
diff --git a/pjsip/src/pjsip/sip_auth_parser.c b/pjsip/src/pjsip/sip_auth_parser.c
index e6394af2..fca1a41a 100644
--- a/pjsip/src/pjsip/sip_auth_parser.c
+++ b/pjsip/src/pjsip/sip_auth_parser.c
@@ -106,7 +106,7 @@ static void parse_digest_credential( pj_scanner *scanner, pj_pool_t *pool,
cred->nc = value;
} else {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = name;
p->value = value;
pj_list_insert_before(&cred->other_param, p);
@@ -168,7 +168,7 @@ static void parse_digest_challenge( pj_scanner *scanner, pj_pool_t *pool,
chal->qop = value;
} else {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = name;
p->value = value;
pj_list_insert_before(&chal->other_param, p);
diff --git a/pjsip/src/pjsip/sip_auth_server.c b/pjsip/src/pjsip/sip_auth_server.c
index 7e572693..816c218c 100644
--- a/pjsip/src/pjsip/sip_auth_server.c
+++ b/pjsip/src/pjsip/sip_auth_server.c
@@ -114,7 +114,7 @@ PJ_DEF(pj_status_t) pjsip_auth_srv_verify( pjsip_auth_srv *auth_srv,
{
pjsip_authorization_hdr *h_auth;
pjsip_msg *msg = rdata->msg_info.msg;
- int htype;
+ pjsip_hdr_e htype;
pj_str_t acc_name;
pjsip_cred_info cred_info;
pj_status_t status;
diff --git a/pjsip/src/pjsip/sip_dialog.c b/pjsip/src/pjsip/sip_dialog.c
index bd6e99f1..5cb285b1 100644
--- a/pjsip/src/pjsip/sip_dialog.c
+++ b/pjsip/src/pjsip/sip_dialog.c
@@ -69,7 +69,7 @@ static pj_status_t create_dialog( pjsip_user_agent *ua,
if (!pool)
return PJ_ENOMEM;
- dlg = pj_pool_zalloc(pool, sizeof(pjsip_dialog));
+ dlg = PJ_POOL_ZALLOC_T(pool, pjsip_dialog);
PJ_ASSERT_RETURN(dlg != NULL, PJ_ENOMEM);
dlg->pool = pool;
@@ -154,7 +154,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
c = param->value.ptr[param->value.slen];
param->value.ptr[param->value.slen] = '\0';
- hdr = pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr,
+ hdr = (pjsip_hdr*)
+ pjsip_parse_hdr(dlg->pool, &param->name, param->value.ptr,
param->value.slen, NULL);
param->value.ptr[param->value.slen] = (char)c;
@@ -222,7 +223,8 @@ 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_uri_get_uri(dlg->remote.info->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;
@@ -230,7 +232,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uac( pjsip_user_agent *ua,
pj_list_init(&sip_uri->header_param);
/* Print URI */
- tmp.ptr = pj_pool_alloc(dlg->pool, dlg->remote.info_str.slen);
+ 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,
dlg->remote.info_str.slen);
@@ -330,10 +333,11 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
/* Temprary string for getting the string representation of
* both local and remote URI.
*/
- tmp.ptr = pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);
+ tmp.ptr = (char*) pj_pool_alloc(rdata->tp_info.pool, TMP_LEN);
/* Init local info from the To header. */
- dlg->local.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.to);
+ dlg->local.info = (pjsip_fromto_hdr*)
+ pjsip_hdr_clone(dlg->pool, rdata->msg_info.to);
pjsip_fromto_hdr_set_from(dlg->local.info);
/* Generate local tag. */
@@ -388,7 +392,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
}
/* Init remote info from the From header. */
- dlg->remote.info = pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
+ dlg->remote.info = (pjsip_fromto_hdr*)
+ pjsip_hdr_clone(dlg->pool, rdata->msg_info.from);
pjsip_fromto_hdr_set_to(dlg->remote.info);
/* Print the remote info. */
@@ -405,13 +410,15 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
/* Init remote's contact from Contact header. */
- contact_hdr = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
+ contact_hdr = (pjsip_hdr*)
+ pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
NULL);
if (!contact_hdr) {
status = PJSIP_ERRNO_FROM_SIP_STATUS(PJSIP_SC_BAD_REQUEST);
goto on_error;
}
- dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact_hdr);
+ dlg->remote.contact = (pjsip_contact_hdr*)
+ pjsip_hdr_clone(dlg->pool, contact_hdr);
/* Init remote's CSeq from CSeq header */
dlg->remote.cseq = dlg->remote.first_cseq = rdata->msg_info.cseq->cseq;
@@ -431,7 +438,8 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
PJSIP_URI_SCHEME_IS_SIPS(rdata->msg_info.msg->line.req.uri);
/* Call-ID */
- dlg->call_id = pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
+ dlg->call_id = (pjsip_cid_hdr*)
+ pjsip_hdr_clone(dlg->pool, rdata->msg_info.cid);
/* Route set.
* RFC 3261 Section 12.1.1:
@@ -446,7 +454,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_create_uas( pjsip_user_agent *ua,
pjsip_route_hdr *route;
/* Clone the Record-Route, change the type to Route header. */
- route = pjsip_hdr_clone(dlg->pool, rr);
+ route = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, rr);
pjsip_routing_hdr_set_route(route);
/* Add to route set. */
@@ -456,7 +464,8 @@ 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_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_RECORD_ROUTE, rr);
+ rr = (pjsip_route_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,
+ PJSIP_H_RECORD_ROUTE, rr);
}
/* Init client authentication session. */
@@ -569,10 +578,11 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
return status;
/* Clone remote target. */
- dlg->target = pjsip_uri_clone(dlg->pool, first_dlg->target);
+ dlg->target = (pjsip_uri*) pjsip_uri_clone(dlg->pool, first_dlg->target);
/* Clone local info. */
- dlg->local.info = pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
+ dlg->local.info = (pjsip_fromto_hdr*)
+ pjsip_hdr_clone(dlg->pool, first_dlg->local.info);
/* Clone local tag. */
pj_strdup(dlg->pool, &dlg->local.info->tag, &first_dlg->local.info->tag);
@@ -583,10 +593,12 @@ 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_hdr_clone(dlg->pool, first_dlg->local.contact);
+ dlg->local.contact = (pjsip_contact_hdr*)
+ pjsip_hdr_clone(dlg->pool, first_dlg->local.contact);
/* Clone remote info. */
- dlg->remote.info = pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
+ dlg->remote.info = (pjsip_fromto_hdr*)
+ pjsip_hdr_clone(dlg->pool, first_dlg->remote.info);
/* Set remote tag from the response. */
pj_strdup(dlg->pool, &dlg->remote.info->tag, &rdata->msg_info.to->tag);
@@ -610,7 +622,8 @@ 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_hdr_clone(dlg->pool, first_dlg->call_id);
+ dlg->call_id = (pjsip_cid_hdr*)
+ pjsip_hdr_clone(dlg->pool, first_dlg->call_id);
/* Duplicate Route-Set. */
pj_list_init(&dlg->route_set);
@@ -618,7 +631,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_fork( const pjsip_dialog *first_dlg,
while (r != &first_dlg->route_set) {
pjsip_route_hdr *h;
- h = pjsip_hdr_clone(dlg->pool, r);
+ h = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r);
pj_list_push_back(&dlg->route_set, h);
r = r->next;
@@ -720,7 +733,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_set_route_set( pjsip_dialog *dlg,
while (r != route_set) {
pjsip_route_hdr *new_r;
- new_r = pjsip_hdr_clone(dlg->pool, r);
+ new_r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, r);
pj_list_push_back(&dlg->route_set, new_r);
r = r->next;
@@ -979,7 +992,7 @@ static pj_status_t dlg_create_request_throw( pjsip_dialog *dlg,
end_list = &dlg->route_set;
for (; route != end_list; route = route->next ) {
pjsip_route_hdr *r;
- r = pjsip_hdr_shallow_clone( tdata->pool, route );
+ r = (pjsip_route_hdr*) pjsip_hdr_shallow_clone( tdata->pool, route );
pjsip_routing_hdr_set_route(r);
pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)r);
}
@@ -1176,7 +1189,8 @@ static void dlg_beautify_response(pjsip_dialog *dlg,
if (pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL) == 0 &&
pjsip_msg_find_hdr_by_name(tdata->msg, &hcontact, NULL) == 0)
{
- hdr = pjsip_hdr_clone(tdata->pool, dlg->local.contact);
+ hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool,
+ dlg->local.contact);
pjsip_msg_add_hdr(tdata->msg, hdr);
}
}
@@ -1188,7 +1202,7 @@ static void dlg_beautify_response(pjsip_dialog *dlg,
c_hdr = pjsip_endpt_get_capability(dlg->endpt,
PJSIP_H_ALLOW, NULL);
if (c_hdr) {
- hdr = pjsip_hdr_clone(tdata->pool, c_hdr);
+ hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr);
pjsip_msg_add_hdr(tdata->msg, hdr);
}
}
@@ -1200,7 +1214,7 @@ static void dlg_beautify_response(pjsip_dialog *dlg,
c_hdr = pjsip_endpt_get_capability(dlg->endpt,
PJSIP_H_SUPPORTED, NULL);
if (c_hdr) {
- hdr = pjsip_hdr_clone(tdata->pool, c_hdr);
+ hdr = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, c_hdr);
pjsip_msg_add_hdr(tdata->msg, hdr);
}
}
@@ -1285,7 +1299,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_modify_response( pjsip_dialog *dlg,
/* Remove existing Contact header (without this, when dialog sent
* 180 and then 302, the Contact in 302 will not get updated).
*/
- hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
+ hdr = (pjsip_hdr*) pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CONTACT, NULL);
if (hdr)
pj_list_erase(hdr);
@@ -1398,7 +1412,7 @@ PJ_DEF(pj_status_t) pjsip_dlg_respond( pjsip_dialog *dlg,
hdr = hdr_list->next;
while (hdr != hdr_list) {
pjsip_msg_add_hdr(tdata->msg,
- pjsip_hdr_clone(tdata->pool, hdr));
+ (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr));
hdr = hdr->next;
}
}
@@ -1526,7 +1540,7 @@ static void dlg_update_routeset(pjsip_dialog *dlg, const pjsip_msg *msg)
for (hdr=msg->hdr.prev; hdr!=end_hdr; hdr=hdr->prev) {
if (hdr->type == PJSIP_H_RECORD_ROUTE) {
pjsip_route_hdr *r;
- r = pjsip_hdr_clone(dlg->pool, hdr);
+ r = (pjsip_route_hdr*) pjsip_hdr_clone(dlg->pool, hdr);
pjsip_routing_hdr_set_route(r);
pj_list_push_back(&dlg->route_set, r);
}
@@ -1598,10 +1612,12 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
/* The remote target MUST be set to the URI from the Contact header
* field of the response.
*/
- contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
+ contact = (pjsip_contact_hdr*)
+ pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
NULL);
if (contact) {
- dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact);
+ dlg->remote.contact = (pjsip_contact_hdr*)
+ pjsip_hdr_clone(dlg->pool, contact);
dlg->target = dlg->remote.contact->uri;
}
@@ -1642,10 +1658,12 @@ void pjsip_dlg_on_rx_response( pjsip_dialog *dlg, pjsip_rx_data *rdata )
{
pjsip_contact_hdr *contact;
- contact = pjsip_msg_find_hdr(rdata->msg_info.msg, PJSIP_H_CONTACT,
- NULL);
+ contact = (pjsip_contact_hdr*) pjsip_msg_find_hdr(rdata->msg_info.msg,
+ PJSIP_H_CONTACT,
+ NULL);
if (contact) {
- dlg->remote.contact = pjsip_hdr_clone(dlg->pool, contact);
+ dlg->remote.contact = (pjsip_contact_hdr*)
+ pjsip_hdr_clone(dlg->pool, contact);
dlg->target = dlg->remote.contact->uri;
}
diff --git a/pjsip/src/pjsip/sip_endpoint.c b/pjsip/src/pjsip/sip_endpoint.c
index 1a509aab..add8ad3e 100644
--- a/pjsip/src/pjsip/sip_endpoint.c
+++ b/pjsip/src/pjsip/sip_endpoint.c
@@ -153,7 +153,7 @@ static void pool_callback( pj_pool_t *pool, pj_size_t size )
/* Compare module name, used for searching module based on name. */
static int cmp_mod_name(void *name, const void *mod)
{
- return pj_stricmp(name, &((pjsip_module*)mod)->name);
+ return pj_stricmp((const pj_str_t*)name, &((pjsip_module*)mod)->name);
}
/*
@@ -445,7 +445,7 @@ PJ_DEF(pj_status_t) pjsip_endpt_create(pj_pool_factory *pf,
return PJ_ENOMEM;
/* Create endpoint. */
- endpt = pj_pool_zalloc(pool, sizeof(*endpt));
+ endpt = PJ_POOL_ZALLOC_T(pool, pjsip_endpoint);
endpt->pool = pool;
endpt->pf = pf;
@@ -828,7 +828,7 @@ static void endpt_on_rx_msg( pjsip_endpoint *endpt,
int port = rdata->msg_info.via->sent_by.port;
pj_bool_t mismatch = PJ_FALSE;
if (port == 0) {
- int type;
+ pjsip_transport_type_e type;
type = rdata->tp_info.transport->key.type;
port = pjsip_transport_get_default_port_for_type(type);
}
diff --git a/pjsip/src/pjsip/sip_msg.c b/pjsip/src/pjsip/sip_msg.c
index 47c493db..f94cd315 100644
--- a/pjsip/src/pjsip/sip_msg.c
+++ b/pjsip/src/pjsip/sip_msg.c
@@ -240,7 +240,7 @@ PJ_DEF(int) pjsip_method_cmp( const pjsip_method *m1, const pjsip_method *m2)
PJ_DEF(pjsip_msg*) pjsip_msg_create( pj_pool_t *pool, pjsip_msg_type_e type)
{
- pjsip_msg *msg = pj_pool_alloc(pool, sizeof(pjsip_msg));
+ pjsip_msg *msg = PJ_POOL_ALLOC_T(pool, pjsip_msg);
pj_list_init(&msg->hdr);
msg->type = type;
msg->body = NULL;
@@ -257,7 +257,8 @@ PJ_DEF(pjsip_msg*) pjsip_msg_clone( pj_pool_t *pool, const pjsip_msg *src)
/* Clone request/status line */
if (src->type == PJSIP_REQUEST_MSG) {
pjsip_method_copy(pool, &dst->line.req.method, &src->line.req.method);
- dst->line.req.uri = pjsip_uri_clone(pool, src->line.req.uri);
+ dst->line.req.uri = (pjsip_uri*) pjsip_uri_clone(pool,
+ src->line.req.uri);
} else {
dst->line.status.code = src->line.status.code;
pj_strdup(pool, &dst->line.status.reason, &src->line.status.reason);
@@ -266,7 +267,7 @@ PJ_DEF(pjsip_msg*) pjsip_msg_clone( pj_pool_t *pool, const pjsip_msg *src)
/* Clone headers */
sh = src->hdr.next;
while (sh != &src->hdr) {
- pjsip_hdr *dh = pjsip_hdr_clone(pool, sh);
+ pjsip_hdr *dh = (pjsip_hdr*) pjsip_hdr_clone(pool, sh);
pjsip_msg_add_hdr(dst, dh);
sh = sh->next;
}
@@ -282,7 +283,7 @@ PJ_DEF(pjsip_msg*) pjsip_msg_clone( pj_pool_t *pool, const pjsip_msg *src)
PJ_DEF(void*) pjsip_msg_find_hdr( const pjsip_msg *msg,
pjsip_hdr_e hdr_type, const void *start)
{
- const pjsip_hdr *hdr=start, *end=&msg->hdr;
+ const pjsip_hdr *hdr=(const pjsip_hdr*) start, *end=&msg->hdr;
if (hdr == NULL) {
hdr = msg->hdr.next;
@@ -298,7 +299,7 @@ PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg,
const pj_str_t *name,
const void *start)
{
- const pjsip_hdr *hdr=start, *end=&msg->hdr;
+ const pjsip_hdr *hdr=(const pjsip_hdr*)start, *end=&msg->hdr;
if (hdr == NULL) {
hdr = msg->hdr.next;
@@ -318,7 +319,7 @@ PJ_DEF(void*) pjsip_msg_find_hdr_by_name( const pjsip_msg *msg,
PJ_DEF(void*) pjsip_msg_find_remove_hdr( pjsip_msg *msg,
pjsip_hdr_e hdr_type, void *start)
{
- pjsip_hdr *hdr = pjsip_msg_find_hdr(msg, hdr_type, start);
+ pjsip_hdr *hdr = (pjsip_hdr*) pjsip_msg_find_hdr(msg, hdr_type, start);
if (hdr) {
pj_list_erase(hdr);
}
@@ -350,7 +351,7 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
*p++ = ' ';
/* Add URI */
- uri = pjsip_uri_get_uri(msg->line.req.uri);
+ uri = (pjsip_uri*) pjsip_uri_get_uri(msg->line.req.uri);
len = pjsip_uri_print( PJSIP_URI_IN_REQ_URI, uri, p, end-p);
if (len < 1)
return -1;
@@ -484,20 +485,20 @@ PJ_DEF(pj_ssize_t) pjsip_msg_print( const pjsip_msg *msg,
///////////////////////////////////////////////////////////////////////////////
PJ_DEF(void*) pjsip_hdr_clone( pj_pool_t *pool, const void *hdr_ptr )
{
- const pjsip_hdr *hdr = hdr_ptr;
+ const pjsip_hdr *hdr = (const pjsip_hdr*) hdr_ptr;
return (*hdr->vptr->clone)(pool, hdr_ptr);
}
PJ_DEF(void*) pjsip_hdr_shallow_clone( pj_pool_t *pool, const void *hdr_ptr )
{
- const pjsip_hdr *hdr = hdr_ptr;
+ const pjsip_hdr *hdr = (const pjsip_hdr*) hdr_ptr;
return (*hdr->vptr->shallow_clone)(pool, hdr_ptr);
}
PJ_DEF(int) pjsip_hdr_print_on( void *hdr_ptr, char *buf, pj_size_t len)
{
- pjsip_hdr *hdr = hdr_ptr;
+ pjsip_hdr *hdr = (pjsip_hdr*) hdr_ptr;
return (*hdr->vptr->print_on)(hdr_ptr, buf, len);
}
@@ -562,7 +563,7 @@ pjsip_generic_string_hdr_init( pj_pool_t *pool,
const pj_str_t *hnames,
const pj_str_t *hvalue)
{
- pjsip_generic_string_hdr *hdr = mem;
+ pjsip_generic_string_hdr *hdr = (pjsip_generic_string_hdr*) mem;
pj_str_t dup_hname, dup_hval;
if (hnames) {
@@ -624,7 +625,7 @@ static pjsip_generic_string_hdr* pjsip_generic_string_hdr_clone( pj_pool_t *pool
static pjsip_generic_string_hdr* pjsip_generic_string_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_generic_string_hdr *rhs )
{
- pjsip_generic_string_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_generic_string_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_string_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
return hdr;
}
@@ -653,7 +654,7 @@ PJ_DEF(pjsip_generic_int_hdr*) pjsip_generic_int_hdr_init( pj_pool_t *pool,
const pj_str_t *hnames,
int value)
{
- pjsip_generic_int_hdr *hdr = mem;
+ pjsip_generic_int_hdr *hdr = (pjsip_generic_int_hdr*) mem;
init_hdr(hdr, PJSIP_H_OTHER, &generic_int_hdr_vptr);
if (hnames) {
@@ -693,7 +694,7 @@ static int pjsip_generic_int_hdr_print( pjsip_generic_int_hdr *hdr,
static pjsip_generic_int_hdr* pjsip_generic_int_hdr_clone( pj_pool_t *pool,
const pjsip_generic_int_hdr *rhs)
{
- pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_generic_int_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_int_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
return hdr;
}
@@ -701,7 +702,7 @@ static pjsip_generic_int_hdr* pjsip_generic_int_hdr_clone( pj_pool_t *pool,
static pjsip_generic_int_hdr* pjsip_generic_int_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_generic_int_hdr *rhs )
{
- pjsip_generic_int_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_generic_int_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_int_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
return hdr;
}
@@ -728,7 +729,7 @@ PJ_DEF(pjsip_generic_array_hdr*) pjsip_generic_array_hdr_init( pj_pool_t *pool,
void *mem,
const pj_str_t *hnames)
{
- pjsip_generic_array_hdr *hdr = mem;
+ pjsip_generic_array_hdr *hdr = (pjsip_generic_array_hdr*) mem;
init_hdr(hdr, PJSIP_H_OTHER, &generic_array_hdr_vptr);
if (hnames) {
@@ -772,7 +773,7 @@ static pjsip_generic_array_hdr* pjsip_generic_array_hdr_clone( pj_pool_t *pool,
const pjsip_generic_array_hdr *rhs)
{
unsigned i;
- pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_generic_array_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_array_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
for (i=0; i<rhs->count; ++i) {
@@ -786,7 +787,7 @@ static pjsip_generic_array_hdr* pjsip_generic_array_hdr_clone( pj_pool_t *pool,
static pjsip_generic_array_hdr* pjsip_generic_array_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_generic_array_hdr *rhs)
{
- pjsip_generic_array_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_generic_array_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_generic_array_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
return hdr;
}
@@ -798,7 +799,7 @@ static pjsip_generic_array_hdr* pjsip_generic_array_hdr_shallow_clone( pj_pool_t
PJ_DEF(pjsip_accept_hdr*) pjsip_accept_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_accept_hdr *hdr = mem;
+ pjsip_accept_hdr *hdr = (pjsip_accept_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -822,7 +823,7 @@ PJ_DEF(pjsip_accept_hdr*) pjsip_accept_hdr_create(pj_pool_t *pool)
PJ_DEF(pjsip_allow_hdr*) pjsip_allow_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_allow_hdr *hdr = mem;
+ pjsip_allow_hdr *hdr = (pjsip_allow_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -845,7 +846,7 @@ PJ_DEF(pjsip_allow_hdr*) pjsip_allow_hdr_create(pj_pool_t *pool)
PJ_DEF(pjsip_cid_hdr*) pjsip_cid_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_cid_hdr *hdr = mem;
+ pjsip_cid_hdr *hdr = (pjsip_cid_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -879,7 +880,7 @@ static pjsip_hdr_vptr clen_hdr_vptr =
PJ_DEF(pjsip_clen_hdr*) pjsip_clen_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_clen_hdr *hdr = mem;
+ pjsip_clen_hdr *hdr = (pjsip_clen_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -941,7 +942,7 @@ static pjsip_hdr_vptr cseq_hdr_vptr =
PJ_DEF(pjsip_cseq_hdr*) pjsip_cseq_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_cseq_hdr *hdr = mem;
+ pjsip_cseq_hdr *hdr = (pjsip_cseq_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -996,7 +997,7 @@ static pjsip_cseq_hdr* pjsip_cseq_hdr_clone( pj_pool_t *pool,
static pjsip_cseq_hdr* pjsip_cseq_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_cseq_hdr *rhs )
{
- pjsip_cseq_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_cseq_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_cseq_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
return hdr;
}
@@ -1020,7 +1021,7 @@ static pjsip_hdr_vptr contact_hdr_vptr =
PJ_DEF(pjsip_contact_hdr*) pjsip_contact_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_contact_hdr *hdr = mem;
+ pjsip_contact_hdr *hdr = (pjsip_contact_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1112,7 +1113,7 @@ static pjsip_contact_hdr* pjsip_contact_hdr_clone(pj_pool_t *pool,
if (hdr->star)
return hdr;
- hdr->uri = pjsip_uri_clone(pool, rhs->uri);
+ hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri);
hdr->q1000 = rhs->q1000;
hdr->expires = rhs->expires;
pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param);
@@ -1123,7 +1124,7 @@ static pjsip_contact_hdr*
pjsip_contact_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_contact_hdr *rhs)
{
- pjsip_contact_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_contact_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_contact_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
return hdr;
@@ -1149,7 +1150,7 @@ static pjsip_hdr_vptr ctype_hdr_vptr =
PJ_DEF(pjsip_ctype_hdr*) pjsip_ctype_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_ctype_hdr *hdr = mem;
+ pjsip_ctype_hdr *hdr = (pjsip_ctype_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1227,7 +1228,7 @@ PJ_DEF(pjsip_expires_hdr*) pjsip_expires_hdr_init( pj_pool_t *pool,
void *mem,
int value)
{
- pjsip_expires_hdr *hdr = mem;
+ pjsip_expires_hdr *hdr = (pjsip_expires_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1266,7 +1267,7 @@ static pjsip_hdr_vptr fromto_hdr_vptr =
PJ_DEF(pjsip_from_hdr*) pjsip_from_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_from_hdr *hdr = mem;
+ pjsip_from_hdr *hdr = (pjsip_from_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1285,7 +1286,7 @@ PJ_DEF(pjsip_from_hdr*) pjsip_from_hdr_create( pj_pool_t *pool )
PJ_DEF(pjsip_to_hdr*) pjsip_to_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_to_hdr *hdr = mem;
+ pjsip_to_hdr *hdr = (pjsip_to_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1354,7 +1355,7 @@ static pjsip_fromto_hdr* pjsip_fromto_hdr_clone( pj_pool_t *pool,
hdr->type = rhs->type;
hdr->name = rhs->name;
hdr->sname = rhs->sname;
- hdr->uri = pjsip_uri_clone(pool, rhs->uri);
+ hdr->uri = (pjsip_uri*) pjsip_uri_clone(pool, rhs->uri);
pj_strdup( pool, &hdr->tag, &rhs->tag);
pjsip_param_clone( pool, &hdr->other_param, &rhs->other_param);
@@ -1365,7 +1366,7 @@ static pjsip_fromto_hdr*
pjsip_fromto_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_fromto_hdr *rhs)
{
- pjsip_fromto_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_fromto_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_fromto_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
return hdr;
@@ -1380,7 +1381,7 @@ PJ_DEF(pjsip_max_fwd_hdr*) pjsip_max_fwd_hdr_init( pj_pool_t *pool,
void *mem,
int value)
{
- pjsip_max_fwd_hdr *hdr = mem;
+ pjsip_max_fwd_hdr *hdr = (pjsip_max_fwd_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1406,7 +1407,7 @@ PJ_DEF(pjsip_min_expires_hdr*) pjsip_min_expires_hdr_init( pj_pool_t *pool,
void *mem,
int value )
{
- pjsip_min_expires_hdr *hdr = mem;
+ pjsip_min_expires_hdr *hdr = (pjsip_min_expires_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1440,7 +1441,7 @@ static pjsip_hdr_vptr routing_hdr_vptr =
PJ_DEF(pjsip_rr_hdr*) pjsip_rr_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_rr_hdr *hdr = mem;
+ pjsip_rr_hdr *hdr = (pjsip_rr_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1460,7 +1461,7 @@ PJ_DEF(pjsip_rr_hdr*) pjsip_rr_hdr_create( pj_pool_t *pool )
PJ_DEF(pjsip_route_hdr*) pjsip_route_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_route_hdr *hdr = mem;
+ pjsip_route_hdr *hdr = (pjsip_route_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1520,7 +1521,7 @@ static int pjsip_routing_hdr_print( pjsip_routing_hdr *hdr,
static pjsip_routing_hdr* pjsip_routing_hdr_clone( pj_pool_t *pool,
const pjsip_routing_hdr *rhs )
{
- pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_routing_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_routing_hdr);
init_hdr(hdr, rhs->type, rhs->vptr);
pjsip_name_addr_init(&hdr->name_addr);
@@ -1532,7 +1533,7 @@ static pjsip_routing_hdr* pjsip_routing_hdr_clone( pj_pool_t *pool,
static pjsip_routing_hdr* pjsip_routing_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_routing_hdr *rhs )
{
- pjsip_routing_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_routing_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_routing_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone( pool, &hdr->other_param, &rhs->other_param);
return hdr;
@@ -1546,7 +1547,7 @@ static pjsip_routing_hdr* pjsip_routing_hdr_shallow_clone( pj_pool_t *pool,
PJ_DEF(pjsip_require_hdr*) pjsip_require_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_require_hdr *hdr = mem;
+ pjsip_require_hdr *hdr = (pjsip_require_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1569,7 +1570,7 @@ PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_init( pj_pool_t *pool,
void *mem,
int value )
{
- pjsip_retry_after_hdr *hdr = mem;
+ pjsip_retry_after_hdr *hdr = (pjsip_retry_after_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1593,7 +1594,7 @@ PJ_DEF(pjsip_retry_after_hdr*) pjsip_retry_after_hdr_create(pj_pool_t *pool,
PJ_DEF(pjsip_supported_hdr*) pjsip_supported_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_supported_hdr *hdr = mem;
+ pjsip_supported_hdr *hdr = (pjsip_supported_hdr*) mem;
PJ_UNUSED_ARG(pool);
init_hdr(hdr, PJSIP_H_SUPPORTED, &generic_array_hdr_vptr);
@@ -1615,7 +1616,7 @@ PJ_DEF(pjsip_supported_hdr*) pjsip_supported_hdr_create(pj_pool_t *pool)
PJ_DEF(pjsip_unsupported_hdr*) pjsip_unsupported_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_unsupported_hdr *hdr = mem;
+ pjsip_unsupported_hdr *hdr = (pjsip_unsupported_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1648,7 +1649,7 @@ static pjsip_hdr_vptr via_hdr_vptr =
PJ_DEF(pjsip_via_hdr*) pjsip_via_hdr_init( pj_pool_t *pool,
void *mem )
{
- pjsip_via_hdr *hdr = mem;
+ pjsip_via_hdr *hdr = (pjsip_via_hdr*) mem;
PJ_UNUSED_ARG(pool);
@@ -1755,7 +1756,7 @@ static pjsip_via_hdr* pjsip_via_hdr_clone( pj_pool_t *pool,
static pjsip_via_hdr* pjsip_via_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_via_hdr *rhs )
{
- pjsip_via_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_via_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_via_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
return hdr;
@@ -1773,9 +1774,9 @@ PJ_DEF(pjsip_warning_hdr*) pjsip_warning_hdr_create( pj_pool_t *pool,
const pj_str_t str_warning = { "Warning", 7 };
pj_str_t hvalue;
- hvalue.ptr = pj_pool_alloc(pool, 10 + /* code */
- host->slen + 2 + /* host */
- text->slen + 2); /* text */
+ hvalue.ptr = (char*) pj_pool_alloc(pool, 10 + /* code */
+ host->slen + 2 + /* host */
+ text->slen + 2); /* text */
hvalue.slen = pj_ansi_sprintf(hvalue.ptr, "%u %.*s \"%.*s\"",
code, (int)host->slen, host->ptr,
(int)text->slen, text->ptr);
@@ -1813,7 +1814,7 @@ PJ_DEF(void*) pjsip_clone_text_data( pj_pool_t *pool, const void *data,
char *newdata = "";
if (len) {
- newdata = pj_pool_alloc(pool, len);
+ newdata = (char*) pj_pool_alloc(pool, len);
pj_memcpy(newdata, data, len);
}
return newdata;
@@ -1855,7 +1856,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_msg_body_clone( pj_pool_t *pool,
pjsip_msg_body *new_body;
pj_status_t status;
- new_body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));
+ new_body = PJ_POOL_ALLOC_T(pool, pjsip_msg_body);
PJ_ASSERT_RETURN(new_body, NULL);
status = pjsip_msg_body_copy(pool, new_body, body);
@@ -1873,7 +1874,7 @@ PJ_DEF(pjsip_msg_body*) pjsip_msg_body_create( pj_pool_t *pool,
PJ_ASSERT_RETURN(pool && type && subtype && text, NULL);
- body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));
+ body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
PJ_ASSERT_RETURN(body != NULL, NULL);
pj_strdup(pool, &body->content_type.type, type);
diff --git a/pjsip/src/pjsip/sip_parser.c b/pjsip/src/pjsip/sip_parser.c
index ea24a71a..644532ec 100644
--- a/pjsip/src/pjsip/sip_parser.c
+++ b/pjsip/src/pjsip/sip_parser.c
@@ -250,7 +250,7 @@ void pjsip_concat_param_imp( pj_str_t *param, pj_pool_t *pool,
int len;
len = param->slen + pname->slen + pvalue->slen + 3;
- p = new_param = pj_pool_alloc(pool, len);
+ p = new_param = (char*) pj_pool_alloc(pool, len);
if (param->slen) {
int old_len = param->slen;
@@ -1001,7 +1001,7 @@ parse_headers:
* as body.
*/
if (ctype_hdr && scanner->curptr!=scanner->end) {
- pjsip_msg_body *body = pj_pool_alloc(pool, sizeof(pjsip_msg_body));
+ pjsip_msg_body *body = PJ_POOL_ALLOC_T(pool, pjsip_msg_body);
body->content_type.type = ctype_hdr->media.type;
body->content_type.subtype = ctype_hdr->media.subtype;
body->content_type.param = ctype_hdr->media.param;
@@ -1022,7 +1022,7 @@ parse_headers:
if (err_list) {
pjsip_parser_err_report *err_info;
- err_info = pj_pool_alloc(pool, sizeof(*err_info));
+ err_info = PJ_POOL_ALLOC_T(pool, pjsip_parser_err_report);
err_info->except_code = PJ_GET_EXCEPTION();
err_info->line = scanner->line;
/* Scanner's column is zero based, so add 1 */
@@ -1250,8 +1250,9 @@ static pjsip_uri *int_parse_uri_or_name_addr( pj_scanner *scanner, pj_pool_t *po
PJ_THROW(PJSIP_SYN_ERR_EXCEPTION);
}
- uri = (*func)( scanner, pool,
- (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)== 0);
+ uri = (pjsip_uri*)
+ (*func)(scanner, pool,
+ (opt & PJSIP_PARSE_URI_IN_FROM_TO_HDR)==0);
} else {
@@ -1379,7 +1380,7 @@ static void* int_parse_sip_url( pj_scanner *scanner,
url->lr_param = 1;
} else {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = pname;
p->value = pvalue;
pj_list_insert_before(&url->other_param, p);
@@ -1391,7 +1392,7 @@ static void* int_parse_sip_url( pj_scanner *scanner,
if (parse_params && *scanner->curptr == '?') {
do {
pjsip_param *param;
- param = pj_pool_alloc(pool, sizeof(pjsip_param));
+ param = PJ_POOL_ALLOC_T(pool, pjsip_param);
int_parse_hparam(scanner, pool, &param->name, &param->value);
pj_list_insert_before(&url->header_param, param);
} while (*scanner->curptr == '&');
@@ -1623,7 +1624,7 @@ static void int_parse_contact_param( pjsip_contact_hdr *hdr,
int_parse_param( scanner, pool, &pname, &pvalue, 0);
if (!parser_stricmp(pname, pjsip_Q_STR) && pvalue.slen) {
- char *dot_pos = pj_memchr(pvalue.ptr, '.', pvalue.slen);
+ char *dot_pos = (char*) pj_memchr(pvalue.ptr, '.', pvalue.slen);
if (!dot_pos) {
hdr->q1000 = pj_strtoul(&pvalue);
} else {
@@ -1635,7 +1636,7 @@ static void int_parse_contact_param( pjsip_contact_hdr *hdr,
hdr->expires = pj_strtoul(&pvalue);
} else {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = pname;
p->value = pvalue;
pj_list_insert_before(&hdr->other_param, p);
@@ -1773,7 +1774,7 @@ static void parse_hdr_fromto( pj_scanner *scanner,
hdr->tag = pvalue;
} else {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = pname;
p->value = pvalue;
pj_list_insert_before(&hdr->other_param, p);
@@ -1871,7 +1872,7 @@ static void int_parse_via_param( pjsip_via_hdr *hdr, pj_scanner *scanner,
else
hdr->rport_param = 0;
} else {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
p->name = pname;
p->value = pvalue;
pj_list_insert_before(&hdr->other_param, p);
@@ -1911,7 +1912,7 @@ static void parse_hdr_rr_route( pj_scanner *scanner, pj_pool_t *pool,
pj_memcpy(&hdr->name_addr, temp, sizeof(*temp));
while (*scanner->curptr == ';') {
- pjsip_param *p = pj_pool_alloc(pool, sizeof(pjsip_param));
+ pjsip_param *p = PJ_POOL_ALLOC_T(pool, pjsip_param);
int_parse_param(scanner, pool, &p->name, &p->value, 0);
pj_list_insert_before(&hdr->other_param, p);
}
diff --git a/pjsip/src/pjsip/sip_resolve.c b/pjsip/src/pjsip/sip_resolve.c
index 8faa57d4..04c36986 100644
--- a/pjsip/src/pjsip/sip_resolve.c
+++ b/pjsip/src/pjsip/sip_resolve.c
@@ -103,7 +103,7 @@ PJ_DEF(pj_status_t) pjsip_resolver_create( pj_pool_t *pool,
pjsip_resolver_t *resolver;
PJ_ASSERT_RETURN(pool && p_res, PJ_EINVAL);
- resolver = pj_pool_zalloc(pool, sizeof(*resolver));
+ resolver = PJ_POOL_ZALLOC_T(pool, pjsip_resolver_t);
*p_res = resolver;
return PJ_SUCCESS;
@@ -278,7 +278,7 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver,
#if PJSIP_HAS_RESOLVER
/* Build the query state */
- query = pj_pool_zalloc(pool, sizeof(struct query));
+ query = PJ_POOL_ZALLOC_T(pool, struct query);
pj_ansi_snprintf(query->objname, sizeof(query->objname), "rsvjob%X",
resolver->job_id++);
query->resolver = resolver;
@@ -298,7 +298,7 @@ PJ_DEF(void) pjsip_resolve( pjsip_resolver_t *resolver,
query->naptr[0].order = 0;
query->naptr[0].pref = 0;
query->naptr[0].type = type;
- query->naptr[0].target_name.ptr =
+ query->naptr[0].target_name.ptr = (char*)
pj_pool_alloc(pool, target->addr.host.slen + 12);
if (type == PJSIP_TRANSPORT_TLS)
@@ -639,7 +639,7 @@ static void dns_callback(void *user_data,
pj_status_t status,
pj_dns_parsed_packet *pkt)
{
- struct query *query = user_data;
+ struct query *query = (struct query*) user_data;
unsigned i;
/* Proceed to next stage */