Changeset 5872
- Timestamp:
- Sep 3, 2018 7:13:40 AM (6 years ago)
- Location:
- pjproject/trunk/pjsip
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r5834 r5872 4078 4078 4079 4079 /** 4080 * Duplicate SRTP transport setting. If the \a pool argument is NULL, 4081 * a simple memcpy() will be used. 4082 * 4083 * @param pool Memory to duplicate strings. 4084 * @param dst Destination setting. 4085 * @param src Source setting. 4086 * @param check_str If set to TRUE, the function will check if strings 4087 * are identical before copying. Identical strings 4088 * will not be duplicated. 4089 * If set to FALSE, all strings will be duplicated. 4090 */ 4091 PJ_DECL(void) pjsua_srtp_opt_dup(pj_pool_t *pool, pjsua_srtp_opt *dst, 4092 const pjsua_srtp_opt *src, 4093 pj_bool_t check_str); 4094 4095 4096 /** 4080 4097 * Call this function to initialize account config with default values. 4081 4098 * -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c
r5838 r5872 140 140 pjsua_turn_config_dup(pool, &dst->turn_cfg, &src->turn_cfg); 141 141 142 pjsua_srtp_opt_dup(pool, &dst->srtp_opt, &src->srtp_opt, PJ_FALSE); 143 142 144 pj_strdup(pool, &dst->ka_data, &src->ka_data); 143 145 … … 1424 1426 acc->cfg.ip_change_cfg.hangup_calls = cfg->ip_change_cfg.hangup_calls; 1425 1427 acc->cfg.ip_change_cfg.reinvite_flags = cfg->ip_change_cfg.reinvite_flags; 1428 1429 /* SRTP setting */ 1430 pjsua_srtp_opt_dup(acc->pool, &acc->cfg.srtp_opt, &cfg->srtp_opt, 1431 PJ_TRUE); 1426 1432 1427 1433 /* RTCP-FB config */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r5856 r5872 144 144 pj_strdup_with_null(pool, &dst->stun_srv[i], &src->stun_srv[i]); 145 145 } 146 147 pjsua_srtp_opt_dup(pool, &dst->srtp_opt, &src->srtp_opt, PJ_FALSE); 146 148 } 147 149 … … 261 263 { 262 264 pj_bzero(cfg, sizeof(*cfg)); 265 } 266 267 268 PJ_DEF(void) pjsua_srtp_opt_dup( pj_pool_t *pool, pjsua_srtp_opt *dst, 269 const pjsua_srtp_opt *src, 270 pj_bool_t check_str) 271 { 272 pj_memcpy(dst, src, sizeof(*src)); 273 if (pool) { 274 unsigned i; 275 276 for (i = 0; i < src->crypto_count; i++) { 277 if (!check_str || 278 pj_stricmp(&dst->crypto[i].key, &src->crypto[i].key)) 279 { 280 pj_strdup(pool, &dst->crypto[i].key, &src->crypto[i].key); 281 } 282 if (!check_str || 283 pj_stricmp(&dst->crypto[i].name, &src->crypto[i].name)) 284 { 285 pj_strdup(pool, &dst->crypto[i].name, &src->crypto[i].name); 286 } 287 } 288 } 263 289 } 264 290
Note: See TracChangeset
for help on using the changeset viewer.