diff --git a/include/re_ice.h b/include/re_ice.h index 2982ac0..942398e 100644 --- a/include/re_ice.h +++ b/include/re_ice.h @@ -42,6 +42,7 @@ typedef void (ice_connchk_h)(int err, bool update, void *arg); /* ICE Session */ int ice_alloc(struct ice **icep, enum ice_mode mode, bool offerer); struct ice_conf *ice_conf(struct ice *ice); +void ice_set_conf(struct ice *ice, const struct ice_conf *conf); void ice_set_offerer(struct ice *ice, bool offerer); int ice_sdp_decode(struct ice *ice, const char *name, const char *value); int ice_conncheck_start(struct ice *ice); diff --git a/src/ice/ice.c b/src/ice/ice.c index f4140ea..ad6da44 100644 --- a/src/ice/ice.c +++ b/src/ice/ice.c @@ -120,6 +120,22 @@ struct ice_conf *ice_conf(struct ice *ice) } +void ice_set_conf(struct ice *ice, const struct ice_conf *conf) +{ + if (!ice || !conf) + return; + + ice->conf = *conf; + + if (ice->stun) { + + /* Update STUN Transport */ + stun_conf(ice->stun)->rto = ice->conf.rto; + stun_conf(ice->stun)->rc = ice->conf.rc; + } +} + + /** * Set the offerer flag on the ICE Session *