summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip-ua
diff options
context:
space:
mode:
Diffstat (limited to 'pjsip/src/pjsip-ua')
-rw-r--r--pjsip/src/pjsip-ua/sip_inv.c61
-rw-r--r--pjsip/src/pjsip-ua/sip_reg.c38
-rw-r--r--pjsip/src/pjsip-ua/sip_replaces.c8
-rw-r--r--pjsip/src/pjsip-ua/sip_xfer.c26
4 files changed, 74 insertions, 59 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c
index e08e10d2..44d073b4 100644
--- a/pjsip/src/pjsip-ua/sip_inv.c
+++ b/pjsip/src/pjsip-ua/sip_inv.c
@@ -229,7 +229,7 @@ static pj_bool_t mod_inv_on_rx_request(pjsip_rx_data *rdata)
if (dlg == NULL)
return PJ_FALSE;
- inv = dlg->mod_data[mod_inv.mod.id];
+ inv = (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id];
/* Report to dialog that we handle INVITE, CANCEL, BYE, ACK.
* If we need to send response, it will be sent in the state
@@ -411,7 +411,7 @@ PJ_DEF(pjsip_module*) pjsip_inv_usage_instance(void)
*/
PJ_DEF(pjsip_inv_session*) pjsip_dlg_get_inv_session(pjsip_dialog *dlg)
{
- return dlg->mod_data[mod_inv.mod.id];
+ return (pjsip_inv_session*) dlg->mod_data[mod_inv.mod.id];
}
@@ -452,7 +452,7 @@ PJ_DEF(pj_status_t) pjsip_inv_create_uac( pjsip_dialog *dlg,
options |= PJSIP_INV_SUPPORT_TIMER;
/* Create the session */
- inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));
+ inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session);
pj_assert(inv != NULL);
inv->pool = dlg->pool;
@@ -577,8 +577,8 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata,
}
/* Parse and validate SDP */
- status = pjmedia_sdp_parse(rdata->tp_info.pool, body->data, body->len,
- &sdp);
+ status = pjmedia_sdp_parse(rdata->tp_info.pool,
+ (char*)body->data, body->len, &sdp);
if (status == PJ_SUCCESS)
status = pjmedia_sdp_validate(sdp);
@@ -650,7 +650,7 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata,
* We just assume that peer supports standard INVITE, ACK, CANCEL, and BYE
* implicitly by sending this INVITE.
*/
- allow = pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL);
+ allow = (pjsip_allow_hdr*) pjsip_msg_find_hdr(msg, PJSIP_H_ALLOW, NULL);
if (allow) {
unsigned i;
const pj_str_t STR_UPDATE = { "UPDATE", 6 };
@@ -668,7 +668,8 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata,
}
/* Check Supported header */
- sup_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL);
+ sup_hdr = (pjsip_supported_hdr*)
+ pjsip_msg_find_hdr(msg, PJSIP_H_SUPPORTED, NULL);
if (sup_hdr) {
unsigned i;
pj_str_t STR_100REL = { "100rel", 6};
@@ -683,7 +684,8 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata,
}
/* Check Require header */
- req_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL);
+ req_hdr = (pjsip_require_hdr*)
+ pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL);
if (req_hdr) {
unsigned i;
const pj_str_t STR_100REL = { "100rel", 6};
@@ -742,7 +744,8 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata,
NULL);
pj_assert(h);
if (h) {
- sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h);
+ sup_hdr = (pjsip_supported_hdr*)
+ pjsip_hdr_clone(rdata->tp_info.pool, h);
pj_list_push_back(&res_hdr_list, sup_hdr);
}
}
@@ -782,7 +785,8 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata,
NULL);
pj_assert(h);
if (h) {
- sup_hdr = pjsip_hdr_clone(rdata->tp_info.pool, h);
+ sup_hdr = (pjsip_supported_hdr*)
+ pjsip_hdr_clone(rdata->tp_info.pool, h);
pj_list_push_back(&res_hdr_list, sup_hdr);
}
@@ -814,7 +818,7 @@ on_return:
while (h != &res_hdr_list) {
pjsip_hdr *cloned;
- cloned = pjsip_hdr_clone(tdata->pool, h);
+ cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h);
PJ_ASSERT_RETURN(cloned, PJ_ENOMEM);
pjsip_msg_add_hdr(tdata->msg, cloned);
@@ -874,7 +878,7 @@ PJ_DEF(pj_status_t) pjsip_inv_create_uas( pjsip_dialog *dlg,
options |= PJSIP_INV_SUPPORT_TIMER;
/* Create the session */
- inv = pj_pool_zalloc(dlg->pool, sizeof(pjsip_inv_session));
+ inv = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_inv_session);
pj_assert(inv != NULL);
inv->pool = dlg->pool;
@@ -893,7 +897,7 @@ PJ_DEF(pj_status_t) pjsip_inv_create_uas( pjsip_dialog *dlg,
pjsip_msg_body *body = msg->body;
/* Parse and validate SDP */
- status = pjmedia_sdp_parse(inv->pool, body->data, body->len,
+ status = pjmedia_sdp_parse(inv->pool, (char*)body->data, body->len,
&rem_sdp);
if (status == PJ_SUCCESS)
status = pjmedia_sdp_validate(rem_sdp);
@@ -935,8 +939,7 @@ PJ_DEF(pj_status_t) pjsip_inv_create_uas( pjsip_dialog *dlg,
inv->invite_tsx = pjsip_rdata_get_tsx(rdata);
/* Attach our data to the transaction. */
- tsx_inv_data = pj_pool_zalloc(inv->invite_tsx->pool,
- sizeof(struct tsx_inv_data));
+ tsx_inv_data = PJ_POOL_ZALLOC_T(inv->invite_tsx->pool, struct tsx_inv_data);
tsx_inv_data->inv = inv;
inv->invite_tsx->mod_data[mod_inv.mod.id] = tsx_inv_data;
@@ -997,12 +1000,12 @@ PJ_DEF(pj_status_t) pjsip_inv_terminate( pjsip_inv_session *inv,
static void *clone_sdp(pj_pool_t *pool, const void *data, unsigned len)
{
PJ_UNUSED_ARG(len);
- return pjmedia_sdp_session_clone(pool, data);
+ return pjmedia_sdp_session_clone(pool, (const pjmedia_sdp_session*)data);
}
static int print_sdp(pjsip_msg_body *body, char *buf, pj_size_t len)
{
- return pjmedia_sdp_print(body->data, buf, len);
+ return pjmedia_sdp_print((const pjmedia_sdp_session*)body->data, buf, len);
}
@@ -1014,7 +1017,7 @@ PJ_DEF(pj_status_t) pjsip_create_sdp_body( pj_pool_t *pool,
const pj_str_t STR_SDP = { "sdp", 3 };
pjsip_msg_body *body;
- body = pj_pool_zalloc(pool, sizeof(pjsip_msg_body));
+ body = PJ_POOL_ZALLOC_T(pool, pjsip_msg_body);
PJ_ASSERT_RETURN(body != NULL, PJ_ENOMEM);
body->content_type.type = STR_APPLICATION;
@@ -1082,7 +1085,7 @@ PJ_DEF(pj_status_t) pjsip_inv_invite( pjsip_inv_session *inv,
hdr = inv->dlg->inv_hdr.next;
while (hdr != &inv->dlg->inv_hdr) {
- pjsip_msg_add_hdr(tdata->msg,
+ pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
pjsip_hdr_shallow_clone(tdata->pool, hdr));
hdr = hdr->next;
}
@@ -1117,14 +1120,14 @@ PJ_DEF(pj_status_t) pjsip_inv_invite( pjsip_inv_session *inv,
/* Add Allow header. */
hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_ALLOW, NULL);
if (hdr) {
- pjsip_msg_add_hdr(tdata->msg,
+ pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
pjsip_hdr_shallow_clone(tdata->pool, hdr));
}
/* Add Supported header */
hdr = pjsip_endpt_get_capability(inv->dlg->endpt, PJSIP_H_SUPPORTED, NULL);
if (hdr) {
- pjsip_msg_add_hdr(tdata->msg,
+ pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
pjsip_hdr_shallow_clone(tdata->pool, hdr));
}
@@ -1177,9 +1180,9 @@ static pj_status_t inv_check_sdp_in_incoming_msg( pjsip_inv_session *inv,
pjmedia_sdp_session *sdp;
/* Get/attach invite session's transaction data */
- tsx_inv_data = tsx->mod_data[mod_inv.mod.id];
+ tsx_inv_data = (struct tsx_inv_data*) tsx->mod_data[mod_inv.mod.id];
if (tsx_inv_data == NULL) {
- tsx_inv_data = pj_pool_zalloc(tsx->pool, sizeof(struct tsx_inv_data));
+ tsx_inv_data = PJ_POOL_ZALLOC_T(tsx->pool, struct tsx_inv_data);
tsx_inv_data->inv = inv;
tsx->mod_data[mod_inv.mod.id] = tsx_inv_data;
}
@@ -1207,7 +1210,8 @@ static pj_status_t inv_check_sdp_in_incoming_msg( pjsip_inv_session *inv,
/* Parse the SDP body. */
- status = pjmedia_sdp_parse(rdata->tp_info.pool, msg->body->data,
+ status = pjmedia_sdp_parse(rdata->tp_info.pool,
+ (char*)msg->body->data,
msg->body->len, &sdp);
if (status != PJ_SUCCESS) {
char errmsg[PJ_ERR_MSG_SIZE];
@@ -1587,7 +1591,8 @@ PJ_DEF(pj_status_t) pjsip_inv_reinvite( pjsip_inv_session *inv,
const pj_str_t STR_CONTACT = { "Contact", 7 };
pj_strdup_with_null(inv->dlg->pool, &tmp, new_contact);
- contact_hdr = pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT,
+ contact_hdr = (pjsip_contact_hdr*)
+ pjsip_parse_hdr(inv->dlg->pool, &STR_CONTACT,
tmp.ptr, tmp.slen, NULL);
if (!contact_hdr) {
status = PJSIP_EINVALIDURI;
@@ -1684,7 +1689,7 @@ PJ_DEF(pj_status_t) pjsip_inv_send_msg( pjsip_inv_session *inv,
pjsip_dlg_inc_lock(inv->dlg);
- tsx_inv_data = pj_pool_zalloc(inv->pool, sizeof(struct tsx_inv_data));
+ tsx_inv_data = PJ_POOL_ZALLOC_T(inv->pool, struct tsx_inv_data);
tsx_inv_data->inv = inv;
pjsip_dlg_dec_lock(inv->dlg);
@@ -1700,7 +1705,7 @@ PJ_DEF(pj_status_t) pjsip_inv_send_msg( pjsip_inv_session *inv,
/* Can only do this to send response to original INVITE
* request.
*/
- PJ_ASSERT_RETURN((cseq=pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL
+ PJ_ASSERT_RETURN((cseq=(pjsip_cseq_hdr*)pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL))!=NULL
&& (cseq->cseq == inv->invite_tsx->cseq),
PJ_EINVALIDOP);
@@ -2415,7 +2420,7 @@ static void inv_on_state_confirmed( pjsip_inv_session *inv, pjsip_event *e)
accept = pjsip_endpt_get_capability(dlg->endpt, PJSIP_H_ACCEPT,
NULL);
if (accept) {
- pjsip_msg_add_hdr(tdata->msg,
+ pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)
pjsip_hdr_clone(tdata->pool, accept));
}
diff --git a/pjsip/src/pjsip-ua/sip_reg.c b/pjsip/src/pjsip-ua/sip_reg.c
index e77273ad..dc15fefc 100644
--- a/pjsip/src/pjsip-ua/sip_reg.c
+++ b/pjsip/src/pjsip-ua/sip_reg.c
@@ -103,13 +103,13 @@ PJ_DEF(pj_status_t) pjsip_regc_create( pjsip_endpoint *endpt, void *token,
pool = pjsip_endpt_create_pool(endpt, "regc%p", 1024, 1024);
PJ_ASSERT_RETURN(pool != NULL, PJ_ENOMEM);
- regc = pj_pool_zalloc(pool, sizeof(struct pjsip_regc));
+ regc = PJ_POOL_ZALLOC_T(pool, pjsip_regc);
regc->pool = pool;
regc->endpt = endpt;
regc->token = token;
regc->cb = cb;
- regc->contact_buf = pj_pool_alloc(pool, PJSIP_REGC_CONTACT_BUF_SIZE);
+ regc->contact_buf = (char*)pj_pool_alloc(pool, PJSIP_REGC_CONTACT_BUF_SIZE);
regc->expires = PJSIP_REGC_EXPIRATION_NOT_SPECIFIED;
status = pjsip_auth_clt_init(&regc->auth_sess, endpt, regc->pool, 0);
@@ -386,13 +386,15 @@ static pj_status_t create_request(pjsip_regc *regc,
pjsip_hdr *route_pos;
const pjsip_route_hdr *route;
- route_pos = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
+ route_pos = (pjsip_hdr*)
+ pjsip_msg_find_hdr(tdata->msg, PJSIP_H_VIA, NULL);
if (!route_pos)
route_pos = &tdata->msg->hdr;
route = regc->route_set.next;
while (route != &regc->route_set) {
- pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, route);
+ pjsip_hdr *new_hdr = (pjsip_hdr*)
+ pjsip_hdr_shallow_clone(tdata->pool, route);
pj_list_insert_after(route_pos, new_hdr);
route_pos = new_hdr;
route = route->next;
@@ -405,7 +407,8 @@ static pj_status_t create_request(pjsip_regc *regc,
hdr = regc->hdr_list.next;
while (hdr != &regc->hdr_list) {
- pjsip_hdr *new_hdr = pjsip_hdr_shallow_clone(tdata->pool, hdr);
+ pjsip_hdr *new_hdr = (pjsip_hdr*)
+ pjsip_hdr_shallow_clone(tdata->pool, hdr);
pjsip_msg_add_hdr(tdata->msg, new_hdr);
hdr = hdr->next;
}
@@ -432,10 +435,12 @@ PJ_DEF(pj_status_t) pjsip_regc_register(pjsip_regc *regc, pj_bool_t autoreg,
/* Add Contact header. */
msg = tdata->msg;
- pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool,
+ pjsip_msg_add_hdr(msg, (pjsip_hdr*)
+ pjsip_hdr_shallow_clone(tdata->pool,
regc->contact_hdr));
if (regc->expires_hdr)
- pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool,
+ pjsip_msg_add_hdr(msg, (pjsip_hdr*)
+ pjsip_hdr_shallow_clone(tdata->pool,
regc->expires_hdr));
if (regc->timer.id != 0) {
@@ -470,7 +475,8 @@ PJ_DEF(pj_status_t) pjsip_regc_unregister(pjsip_regc *regc,
return status;
msg = tdata->msg;
- pjsip_msg_add_hdr(msg, pjsip_hdr_shallow_clone(tdata->pool,
+ pjsip_msg_add_hdr(msg, (pjsip_hdr*)
+ pjsip_hdr_shallow_clone(tdata->pool,
regc->contact_hdr));
pjsip_msg_add_hdr( msg, (pjsip_hdr*)regc->unreg_expires_hdr);
@@ -553,7 +559,7 @@ static void call_callback(pjsip_regc *regc, pj_status_t status, int st_code,
static void regc_refresh_timer_cb( pj_timer_heap_t *timer_heap,
struct pj_timer_entry *entry)
{
- pjsip_regc *regc = entry->user_data;
+ pjsip_regc *regc = (pjsip_regc*) entry->user_data;
pjsip_tx_data *tdata;
pj_status_t status;
@@ -587,7 +593,7 @@ static void regc_refresh_timer_cb( pj_timer_heap_t *timer_heap,
static void tsx_callback(void *token, pjsip_event *event)
{
pj_status_t status;
- pjsip_regc *regc = token;
+ pjsip_regc *regc = (pjsip_regc*) token;
pjsip_transaction *tsx = event->body.tsx_state.tsx;
/* Decrement pending transaction counter. */
@@ -653,16 +659,19 @@ static void tsx_callback(void *token, pjsip_event *event)
rdata = event->body.tsx_state.src.rdata;
msg = rdata->msg_info.msg;
- hdr = pjsip_msg_find_hdr( msg, PJSIP_H_CONTACT, NULL);
+ hdr = (pjsip_contact_hdr*)
+ pjsip_msg_find_hdr( msg, PJSIP_H_CONTACT, NULL);
while (hdr) {
contact[contact_cnt++] = hdr;
hdr = hdr->next;
if (hdr == (void*)&msg->hdr)
break;
- hdr = pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, hdr);
+ hdr = (pjsip_contact_hdr*)
+ pjsip_msg_find_hdr(msg, PJSIP_H_CONTACT, hdr);
}
- expires = pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL);
+ expires = (pjsip_expires_hdr*)
+ pjsip_msg_find_hdr(msg, PJSIP_H_EXPIRES, NULL);
if (expires)
expiration = expires->ivalue;
@@ -740,7 +749,8 @@ PJ_DEF(pj_status_t) pjsip_regc_send(pjsip_regc *regc, pjsip_tx_data *tdata)
/* Increment CSeq */
cseq = ++regc->cseq_hdr->cseq;
- cseq_hdr = pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
+ cseq_hdr = (pjsip_cseq_hdr*)
+ pjsip_msg_find_hdr(tdata->msg, PJSIP_H_CSEQ, NULL);
cseq_hdr->cseq = cseq;
/* Increment pending transaction first, since transaction callback
diff --git a/pjsip/src/pjsip-ua/sip_replaces.c b/pjsip/src/pjsip-ua/sip_replaces.c
index 545c4267..284c2828 100644
--- a/pjsip/src/pjsip-ua/sip_replaces.c
+++ b/pjsip/src/pjsip-ua/sip_replaces.c
@@ -52,7 +52,7 @@ static pjsip_endpoint *the_endpt;
PJ_DEF(pjsip_replaces_hdr*) pjsip_replaces_hdr_create(pj_pool_t *pool)
{
- pjsip_replaces_hdr *hdr = pj_pool_zalloc(pool, sizeof(*hdr));
+ pjsip_replaces_hdr *hdr = PJ_POOL_ZALLOC_T(pool, pjsip_replaces_hdr);
hdr->type = PJSIP_H_OTHER;
hdr->name.ptr = "Replaces";
hdr->name.slen = 8;
@@ -108,7 +108,7 @@ static pjsip_replaces_hdr*
replaces_hdr_shallow_clone( pj_pool_t *pool,
const pjsip_replaces_hdr *rhs )
{
- pjsip_replaces_hdr *hdr = pj_pool_alloc(pool, sizeof(*hdr));
+ pjsip_replaces_hdr *hdr = PJ_POOL_ALLOC_T(pool, pjsip_replaces_hdr);
pj_memcpy(hdr, rhs, sizeof(*hdr));
pjsip_param_shallow_clone(pool, &hdr->other_param, &rhs->other_param);
return hdr;
@@ -144,7 +144,7 @@ static pjsip_hdr *parse_hdr_replaces(pjsip_parse_ctx *ctx)
} else if (pj_stricmp(&pname, &early_only_tag)==0) {
hdr->early_only = PJ_TRUE;
} else {
- pjsip_param *param = pj_pool_alloc(ctx->pool, sizeof(pjsip_param));
+ pjsip_param *param = PJ_POOL_ALLOC_T(ctx->pool, pjsip_param);
param->name = pname;
param->value = pvalue;
pj_list_push_back(&hdr->other_param, param);
@@ -318,7 +318,7 @@ on_return:
while (h != &res_hdr_list) {
pjsip_hdr *cloned;
- cloned = pjsip_hdr_clone(tdata->pool, h);
+ cloned = (pjsip_hdr*) pjsip_hdr_clone(tdata->pool, h);
PJ_ASSERT_RETURN(cloned, PJ_ENOMEM);
pjsip_msg_add_hdr(tdata->msg, cloned);
diff --git a/pjsip/src/pjsip-ua/sip_xfer.c b/pjsip/src/pjsip-ua/sip_xfer.c
index f772f78d..a4c46629 100644
--- a/pjsip/src/pjsip-ua/sip_xfer.c
+++ b/pjsip/src/pjsip-ua/sip_xfer.c
@@ -179,7 +179,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_create_uac( pjsip_dialog *dlg,
goto on_return;
/* Create xfer session */
- xfer = pj_pool_zalloc(dlg->pool, sizeof(pjsip_xfer));
+ xfer = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_xfer);
xfer->dlg = dlg;
xfer->sub = sub;
if (user_cb)
@@ -248,7 +248,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_create_uas( pjsip_dialog *dlg,
goto on_return;
/* Create server xfer subscription */
- xfer = pj_pool_zalloc(dlg->pool, sizeof(pjsip_xfer));
+ xfer = PJ_POOL_ZALLOC_T(dlg->pool, pjsip_xfer);
xfer->dlg = dlg;
xfer->sub = sub;
if (user_cb)
@@ -286,7 +286,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_initiate( pjsip_evsub *sub,
/* Get the xfer object. */
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION);
/* refer_to_uri argument MAY be NULL for subsequent REFER requests,
@@ -373,7 +373,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_notify( pjsip_evsub *sub,
PJ_ASSERT_RETURN(sub, PJ_EINVAL);
/* Get the xfer object. */
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION);
@@ -398,7 +398,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_notify( pjsip_evsub *sub,
pj_strdup(xfer->dlg->pool, &xfer->last_st_text, xfer_st_text);
/* Create sipfrag content. */
- body = pj_pool_alloc(tdata->pool, 128);
+ body = (char*) pj_pool_alloc(tdata->pool, 128);
bodylen = pj_ansi_snprintf(body, 128, "SIP/2.0 %u %.*s",
xfer_st_code,
(int)xfer_st_text->slen,
@@ -409,7 +409,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_notify( pjsip_evsub *sub,
/* Create SIP message body. */
- msg_body = pj_pool_zalloc(tdata->pool, sizeof(pjsip_msg_body));
+ msg_body = PJ_POOL_ZALLOC_T(tdata->pool, pjsip_msg_body);
msg_body->content_type.type = STR_MESSAGE;
msg_body->content_type.subtype = STR_SIPFRAG;
msg_body->content_type.param = STR_SIPFRAG_VERSION;
@@ -447,7 +447,7 @@ PJ_DEF(pj_status_t) pjsip_xfer_current_notify( pjsip_evsub *sub,
PJ_ASSERT_RETURN(sub, PJ_EINVAL);
/* Get the xfer object. */
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_RETURN(xfer != NULL, PJSIP_ENOREFERSESSION);
pjsip_dlg_inc_lock(xfer->dlg);
@@ -480,7 +480,7 @@ static void xfer_on_evsub_state( pjsip_evsub *sub, pjsip_event *event)
{
pjsip_xfer *xfer;
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
if (xfer->user_cb.on_evsub_state)
@@ -496,7 +496,7 @@ static void xfer_on_evsub_tsx_state( pjsip_evsub *sub, pjsip_transaction *tsx,
{
pjsip_xfer *xfer;
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
if (xfer->user_cb.on_tsx_state)
@@ -515,7 +515,7 @@ static void xfer_on_evsub_rx_refresh( pjsip_evsub *sub,
{
pjsip_xfer *xfer;
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
if (xfer->user_cb.on_rx_refresh) {
@@ -556,7 +556,7 @@ static void xfer_on_evsub_rx_notify( pjsip_evsub *sub,
{
pjsip_xfer *xfer;
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
if (xfer->user_cb.on_rx_notify)
@@ -571,7 +571,7 @@ static void xfer_on_evsub_client_refresh(pjsip_evsub *sub)
{
pjsip_xfer *xfer;
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
if (xfer->user_cb.on_client_refresh) {
@@ -594,7 +594,7 @@ static void xfer_on_evsub_server_timeout(pjsip_evsub *sub)
{
pjsip_xfer *xfer;
- xfer = pjsip_evsub_get_mod_data(sub, mod_xfer.id);
+ xfer = (pjsip_xfer*) pjsip_evsub_get_mod_data(sub, mod_xfer.id);
PJ_ASSERT_ON_FAIL(xfer!=NULL, {return;});
if (xfer->user_cb.on_server_timeout) {