PJ_DEF(void) pjsua_acc_config_default(pjsua_acc_config *cfg)
{
    pjsua_media_config med_cfg;

    pj_bzero(cfg, sizeof(*cfg));

    cfg->reg_timeout = PJSUA_REG_INTERVAL;
    cfg->reg_delay_before_refresh = PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH;
    cfg->unreg_timeout = PJSUA_UNREG_TIMEOUT;
    pjsip_publishc_opt_default(&cfg->publish_opt);
    cfg->unpublish_max_wait_time_msec = PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC;
    cfg->transport_id = PJSUA_INVALID_ID;
    cfg->allow_contact_rewrite = PJ_TRUE;
    cfg->allow_via_rewrite = PJ_TRUE;
    cfg->require_100rel = pjsua_var.ua_cfg.require_100rel;
    cfg->use_timer = pjsua_var.ua_cfg.use_timer;
    cfg->timer_setting = pjsua_var.ua_cfg.timer_setting;
    cfg->lock_codec = 1;
    cfg->ka_interval = 15;
    cfg->ka_data = pj_str("\r\n");
    cfg->vid_cap_dev = PJMEDIA_VID_DEFAULT_CAPTURE_DEV;
    cfg->vid_rend_dev = PJMEDIA_VID_DEFAULT_RENDER_DEV;
#if PJMEDIA_HAS_VIDEO
    pjmedia_vid_stream_rc_config_default(&cfg->vid_stream_rc_cfg);
    pjmedia_vid_stream_sk_config_default(&cfg->vid_stream_sk_cfg);
#endif
    pjsua_transport_config_default(&cfg->rtp_cfg);
    cfg->rtp_cfg.port = DEFAULT_RTP_PORT;
    pjmedia_rtcp_fb_setting_default(&cfg->rtcp_fb_cfg);

    pjsua_media_config_default(&med_cfg);
    pjsua_ice_config_from_media_config(NULL, &cfg->ice_cfg, &med_cfg);
    pjsua_turn_config_from_media_config(NULL, &cfg->turn_cfg, &med_cfg);

    cfg->use_srtp = pjsua_var.ua_cfg.use_srtp;
    cfg->srtp_secure_signaling = pjsua_var.ua_cfg.srtp_secure_signaling;
    cfg->srtp_optional_dup_offer = pjsua_var.ua_cfg.srtp_optional_dup_offer;
    cfg->srtp_opt = pjsua_var.ua_cfg.srtp_opt;
    cfg->reg_retry_interval = PJSUA_REG_RETRY_INTERVAL;
    cfg->reg_retry_random_interval = 10;
    cfg->contact_rewrite_method = PJSUA_CONTACT_REWRITE_METHOD;
    cfg->contact_use_src_port = PJ_TRUE;
    cfg->use_rfc5626 = PJ_TRUE;
    cfg->reg_use_proxy = PJSUA_REG_USE_OUTBOUND_PROXY |
			 PJSUA_REG_USE_ACC_PROXY;
#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0
    cfg->use_stream_ka = (PJMEDIA_STREAM_ENABLE_KA != 0);
    pjmedia_stream_ka_config_default(&cfg->stream_ka_cfg);
#endif
    pj_list_init(&cfg->reg_hdr_list);
    pj_list_init(&cfg->sub_hdr_list);
    cfg->call_hold_type = PJSUA_CALL_HOLD_TYPE_DEFAULT;
    cfg->register_on_acc_add = PJ_TRUE;
    cfg->mwi_expires = PJSIP_MWI_DEFAULT_EXPIRES;

    cfg->media_stun_use = PJSUA_STUN_RETRY_ON_FAILURE;
    cfg->ip_change_cfg.shutdown_tp = PJ_TRUE;
    cfg->ip_change_cfg.hangup_calls = PJ_FALSE;
    cfg->ip_change_cfg.reinvite_flags = PJSUA_CALL_REINIT_MEDIA |
					PJSUA_CALL_UPDATE_CONTACT |
					PJSUA_CALL_UPDATE_VIA;
}
PJ_DEF(void) pjsua_acc_config_default(pjsua_acc_config *cfg)
{
    pjsua_media_config med_cfg;

    pj_bzero(cfg, sizeof(*cfg));

    cfg->reg_timeout = PJSUA_REG_INTERVAL;
    cfg->reg_delay_before_refresh = PJSIP_REGISTER_CLIENT_DELAY_BEFORE_REFRESH;
    cfg->unreg_timeout = PJSUA_UNREG_TIMEOUT;
    pjsip_publishc_opt_default(&cfg->publish_opt);
    cfg->unpublish_max_wait_time_msec = PJSUA_UNPUBLISH_MAX_WAIT_TIME_MSEC;
    cfg->transport_id = PJSUA_INVALID_ID;
    cfg->allow_contact_rewrite = PJ_TRUE;
    cfg->allow_via_rewrite = PJ_TRUE;
    cfg->require_100rel = pjsua_var.ua_cfg.require_100rel;
    cfg->use_timer = pjsua_var.ua_cfg.use_timer;
    cfg->timer_setting = pjsua_var.ua_cfg.timer_setting;
    cfg->lock_codec = 1;
    cfg->ka_interval = 15;
    cfg->ka_data = pj_str("\r\n");
    cfg->vid_cap_dev = PJMEDIA_VID_DEFAULT_CAPTURE_DEV;
    cfg->vid_rend_dev = PJMEDIA_VID_DEFAULT_RENDER_DEV;
#if PJMEDIA_HAS_VIDEO
    pjmedia_vid_stream_rc_config_default(&cfg->vid_stream_rc_cfg);
    pjmedia_vid_stream_sk_config_default(&cfg->vid_stream_sk_cfg);
#endif
    pjsua_transport_config_default(&cfg->rtp_cfg);
    cfg->rtp_cfg.port = DEFAULT_RTP_PORT;
    pjmedia_rtcp_fb_setting_default(&cfg->rtcp_fb_cfg);

    pjsua_media_config_default(&med_cfg);
    pjsua_ice_config_from_media_config(NULL, &cfg->ice_cfg, &med_cfg);
    pjsua_turn_config_from_media_config(NULL, &cfg->turn_cfg, &med_cfg);

    cfg->use_srtp = pjsua_var.ua_cfg.use_srtp;
    cfg->srtp_secure_signaling = pjsua_var.ua_cfg.srtp_secure_signaling;
    cfg->srtp_optional_dup_offer = pjsua_var.ua_cfg.srtp_optional_dup_offer;
    cfg->srtp_opt = pjsua_var.ua_cfg.srtp_opt;
    cfg->reg_retry_interval = PJSUA_REG_RETRY_INTERVAL;
    cfg->reg_retry_random_interval = 10;
    cfg->contact_rewrite_method = PJSUA_CONTACT_REWRITE_METHOD;
    cfg->contact_use_src_port = PJ_TRUE;
    cfg->use_rfc5626 = PJ_TRUE;
    cfg->reg_use_proxy = PJSUA_REG_USE_OUTBOUND_PROXY |
			 PJSUA_REG_USE_ACC_PROXY;
#if defined(PJMEDIA_STREAM_ENABLE_KA) && PJMEDIA_STREAM_ENABLE_KA!=0
    cfg->use_stream_ka = (PJMEDIA_STREAM_ENABLE_KA != 0);
    pjmedia_stream_ka_config_default(&cfg->stream_ka_cfg);
#endif
    pj_list_init(&cfg->reg_hdr_list);
    pj_list_init(&cfg->sub_hdr_list);
    cfg->call_hold_type = PJSUA_CALL_HOLD_TYPE_DEFAULT;
    cfg->register_on_acc_add = PJ_TRUE;
    cfg->mwi_expires = PJSIP_MWI_DEFAULT_EXPIRES;

    cfg->media_stun_use = PJSUA_STUN_RETRY_ON_FAILURE;
    cfg->ip_change_cfg.shutdown_tp = PJ_TRUE;
    cfg->ip_change_cfg.hangup_calls = PJ_FALSE;
    cfg->ip_change_cfg.reinvite_flags = PJSUA_CALL_REINIT_MEDIA |
					PJSUA_CALL_UPDATE_CONTACT |
					PJSUA_CALL_UPDATE_VIA;
}