void *pjsip_p_c_f_a_hdr_clone(pj_pool_t* pool, const void* o) { pjsip_p_c_f_a_hdr* hdr = pjsip_p_c_f_a_hdr_create(pool); pjsip_p_c_f_a_hdr* other = (pjsip_p_c_f_a_hdr*)o; pjsip_param_clone(pool, &hdr->ccf, &other->ccf); pjsip_param_clone(pool, &hdr->ecf, &other->ecf); pjsip_param_clone(pool, &hdr->other_param, &other->other_param); return hdr; }
static pjsip_www_authenticate_hdr* pjsip_www_authenticate_hdr_clone( pj_pool_t *pool, const pjsip_www_authenticate_hdr *rhs) { /* This function also serves Proxy-Authenticate header. */ pjsip_www_authenticate_hdr *hdr; if (rhs->type == PJSIP_H_WWW_AUTHENTICATE) hdr = pjsip_www_authenticate_hdr_create(pool); else hdr = pjsip_proxy_authenticate_hdr_create(pool); pj_strdup(pool, &hdr->scheme, &rhs->scheme); if (pj_stricmp2(&hdr->scheme, "digest") == 0) { pj_strdup(pool, &hdr->challenge.digest.realm, &rhs->challenge.digest.realm); pj_strdup(pool, &hdr->challenge.digest.domain, &rhs->challenge.digest.domain); pj_strdup(pool, &hdr->challenge.digest.nonce, &rhs->challenge.digest.nonce); pj_strdup(pool, &hdr->challenge.digest.opaque, &rhs->challenge.digest.opaque); hdr->challenge.digest.stale = rhs->challenge.digest.stale; pj_strdup(pool, &hdr->challenge.digest.algorithm, &rhs->challenge.digest.algorithm); pj_strdup(pool, &hdr->challenge.digest.qop, &rhs->challenge.digest.qop); pjsip_param_clone(pool, &hdr->challenge.digest.other_param, &rhs->challenge.digest.other_param); } else if (pj_stricmp2(&hdr->scheme, "pgp") == 0) { pj_assert(0); return NULL; } else { pj_assert(0); return NULL; } return hdr; }
PJ_DEF(void) pjsip_sip_uri_assign(pj_pool_t *pool, pjsip_sip_uri *url, const pjsip_sip_uri *rhs) { pj_strdup( pool, &url->user, &rhs->user); pj_strdup( pool, &url->passwd, &rhs->passwd); pj_strdup( pool, &url->host, &rhs->host); url->port = rhs->port; pj_strdup( pool, &url->user_param, &rhs->user_param); pj_strdup( pool, &url->method_param, &rhs->method_param); pj_strdup( pool, &url->transport_param, &rhs->transport_param); url->ttl_param = rhs->ttl_param; pj_strdup( pool, &url->maddr_param, &rhs->maddr_param); pjsip_param_clone(pool, &url->other_param, &rhs->other_param); pjsip_param_clone(pool, &url->header_param, &rhs->header_param); url->lr_param = rhs->lr_param; }
static pjsip_authorization_hdr* pjsip_authorization_hdr_clone( pj_pool_t *pool, const pjsip_authorization_hdr *rhs) { /* This function also serves Proxy-Authorization header. */ pjsip_authorization_hdr *hdr; if (rhs->type == PJSIP_H_AUTHORIZATION) hdr = pjsip_authorization_hdr_create(pool); else hdr = pjsip_proxy_authorization_hdr_create(pool); pj_strdup(pool, &hdr->scheme, &rhs->scheme); if (pj_stricmp2(&hdr->scheme, "digest") == 0) { pj_strdup(pool, &hdr->credential.digest.username, &rhs->credential.digest.username); pj_strdup(pool, &hdr->credential.digest.realm, &rhs->credential.digest.realm); pj_strdup(pool, &hdr->credential.digest.nonce, &rhs->credential.digest.nonce); pj_strdup(pool, &hdr->credential.digest.uri, &rhs->credential.digest.uri); pj_strdup(pool, &hdr->credential.digest.response, &rhs->credential.digest.response); pj_strdup(pool, &hdr->credential.digest.algorithm, &rhs->credential.digest.algorithm); pj_strdup(pool, &hdr->credential.digest.cnonce, &rhs->credential.digest.cnonce); pj_strdup(pool, &hdr->credential.digest.opaque, &rhs->credential.digest.opaque); pj_strdup(pool, &hdr->credential.digest.qop, &rhs->credential.digest.qop); pj_strdup(pool, &hdr->credential.digest.nc, &rhs->credential.digest.nc); pjsip_param_clone(pool, &hdr->credential.digest.other_param, &rhs->credential.digest.other_param); } else if (pj_stricmp2(&hdr->scheme, "pgp") == 0) { pj_assert(0); return NULL; } else { pj_assert(0); return NULL; } return hdr; }
pjsip_routing_hdr* identity_hdr_clone(pj_pool_t* pool, const pjsip_routing_hdr* rhs) { pjsip_routing_hdr *hdr = identity_hdr_create(pool, rhs->name); pjsip_name_addr_assign(pool, &hdr->name_addr, &rhs->name_addr); pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param); return hdr; }
static pjsip_min_se_hdr* min_se_hdr_clone(pj_pool_t *pool, const pjsip_min_se_hdr *hsrc) { pjsip_min_se_hdr *hdr = pjsip_min_se_hdr_create(pool); hdr->min_se = hsrc->min_se; pjsip_param_clone(pool, &hdr->other_param, &hsrc->other_param); return hdr; }
void* pjsip_session_expires_hdr_clone(pj_pool_t* pool, const void* o) { pjsip_session_expires_hdr* hdr = pjsip_session_expires_hdr_create(pool); pjsip_session_expires_hdr* other = (pjsip_session_expires_hdr*)o; hdr->expires = other->expires; hdr->refresher = other->refresher; pjsip_param_clone(pool, &hdr->other_param, &other->other_param); return hdr; }
void *pjsip_reject_contact_hdr_clone(pj_pool_t* pool, const void* o) { pjsip_reject_contact_hdr* hdr = pjsip_reject_contact_hdr_create(pool); pjsip_reject_contact_hdr* other = (pjsip_reject_contact_hdr*)o; pjsip_param_clone(pool, &hdr->feature_set, &other->feature_set); return hdr; }
static pjsip_event_hdr* pjsip_event_hdr_clone( pj_pool_t *pool, const pjsip_event_hdr *rhs) { pjsip_event_hdr *hdr = pjsip_event_hdr_create(pool); pj_strdup(pool, &hdr->event_type, &rhs->event_type); pj_strdup(pool, &hdr->id_param, &rhs->id_param); pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param); return hdr; }
static pjsip_sess_expires_hdr* se_hdr_clone(pj_pool_t *pool, const pjsip_sess_expires_hdr *hsrc) { pjsip_sess_expires_hdr *hdr = pjsip_sess_expires_hdr_create(pool); hdr->sess_expires = hsrc->sess_expires; pj_strdup(pool, &hdr->refresher, &hsrc->refresher); pjsip_param_clone(pool, &hdr->other_param, &hsrc->other_param); return hdr; }
void *pjsip_p_c_v_hdr_clone(pj_pool_t* pool, const void* o) { pjsip_p_c_v_hdr* hdr = pjsip_p_c_v_hdr_create(pool); pjsip_p_c_v_hdr* other = (pjsip_p_c_v_hdr*)o; pj_strdup(pool, &hdr->icid, &other->icid); pj_strdup(pool, &hdr->orig_ioi, &other->orig_ioi); pj_strdup(pool, &hdr->term_ioi, &other->term_ioi); pj_strdup(pool, &hdr->icid_gen_addr, &other->icid_gen_addr); pjsip_param_clone(pool, &hdr->other_param, &other->other_param); return hdr; }
static pjsip_replaces_hdr* replaces_hdr_clone( pj_pool_t *pool, const pjsip_replaces_hdr *rhs) { pjsip_replaces_hdr *hdr = pjsip_replaces_hdr_create(pool); pj_strdup(pool, &hdr->call_id, &rhs->call_id); pj_strdup(pool, &hdr->to_tag, &rhs->to_tag); pj_strdup(pool, &hdr->from_tag, &rhs->from_tag); hdr->early_only = rhs->early_only; pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param); return hdr; }
void *pjsip_accept_contact_hdr_clone(pj_pool_t* pool, const void* o) { pjsip_accept_contact_hdr* hdr = pjsip_accept_contact_hdr_create(pool); pjsip_accept_contact_hdr* other = (pjsip_accept_contact_hdr*)o; hdr->required_match = other->required_match; hdr->explicit_match = other->explicit_match; pjsip_param_clone(pool, &hdr->feature_set, &other->feature_set); return hdr; }
static pjsip_sub_state_hdr* pjsip_sub_state_hdr_clone(pj_pool_t *pool, const pjsip_sub_state_hdr *rhs) { pjsip_sub_state_hdr *hdr = pjsip_sub_state_hdr_create(pool); pj_strdup(pool, &hdr->sub_state, &rhs->sub_state); pj_strdup(pool, &hdr->reason_param, &rhs->reason_param); hdr->retry_after = rhs->retry_after; hdr->expires_param = rhs->expires_param; pjsip_param_clone(pool, &hdr->other_param, &rhs->other_param); return hdr; }
/* Clone tel: URI */ static pjsip_tel_uri* tel_uri_clone(pj_pool_t *pool, const pjsip_tel_uri *rhs) { pjsip_tel_uri *uri = pjsip_tel_uri_create(pool); pj_strdup(pool, &uri->number, &rhs->number); pj_strdup(pool, &uri->context, &rhs->context); pj_strdup(pool, &uri->ext_param, &rhs->ext_param); pj_strdup(pool, &uri->isub_param, &rhs->isub_param); pjsip_param_clone(pool, &uri->other_param, &rhs->other_param); return uri; }