PJ_DEF(pj_status_t) pjsip_target_assign_status( pjsip_target *target,
					        pj_pool_t *pool,
					        int status_code,
					        const pj_str_t *reason)
{
    PJ_ASSERT_RETURN(target && pool && status_code && reason, PJ_EINVAL);

    target->code = (pjsip_status_code)status_code;
    pj_strdup(pool, &target->reason, reason);

    return PJ_SUCCESS;
}
PJ_DEF(pj_status_t) pjsip_target_assign_status( pjsip_target *target,
					        pj_pool_t *pool,
					        int status_code,
					        const pj_str_t *reason)
{
    PJ_ASSERT_RETURN(target && pool && status_code && reason, PJ_EINVAL);

    target->code = (pjsip_status_code)status_code;
    pj_strdup(pool, &target->reason, reason);

    return PJ_SUCCESS;
}