Changeset 4353 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
- Timestamp:
- Feb 19, 2013 4:16:37 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r4350 r4353 3157 3157 /* Check if we need to lock codec */ 3158 3158 need_lock_codec = check_lock_codec(call); 3159 need_lock_codec = PJ_TRUE; 3159 3160 3160 3161 /* Check if reinvite is really needed */ … … 3258 3259 if (a) pjmedia_sdp_attr_add(&m->attr_count, m->attr, a); 3259 3260 } 3260 3261 3261 } 3262 3262 } 3263 3263 } 3264 3265 /* Put back original direction and "c=0.0.0.0" line */ 3266 { 3267 const pjmedia_sdp_session *cur_sdp; 3268 3269 /* Get local active SDP */ 3270 status = pjmedia_sdp_neg_get_active_local(call->inv->neg, &cur_sdp); 3271 if (status != PJ_SUCCESS) 3272 return status; 3273 3274 /* Make sure media count has not been changed */ 3275 if (call->med_cnt != cur_sdp->media_count) 3276 return PJMEDIA_SDPNEG_EINSTATE; 3277 3278 for (i = 0; i < call->med_cnt; ++i) { 3279 const pjmedia_sdp_media *m = cur_sdp->media[i]; 3280 pjmedia_sdp_media *new_m = new_offer->media[i]; 3281 pjsua_call_media *call_med = &call->media[i]; 3282 pjmedia_sdp_attr *a = NULL; 3283 3284 /* Update direction to the current dir */ 3285 pjmedia_sdp_media_remove_all_attr(new_m, "sendrecv"); 3286 pjmedia_sdp_media_remove_all_attr(new_m, "sendonly"); 3287 pjmedia_sdp_media_remove_all_attr(new_m, "recvonly"); 3288 pjmedia_sdp_media_remove_all_attr(new_m, "inactive"); 3289 3290 if (call_med->dir == PJMEDIA_DIR_ENCODING_DECODING) { 3291 a = pjmedia_sdp_attr_create(pool, "sendrecv", NULL); 3292 } else if (call_med->dir == PJMEDIA_DIR_ENCODING) { 3293 a = pjmedia_sdp_attr_create(pool, "sendonly", NULL); 3294 } else if (call_med->dir == PJMEDIA_DIR_DECODING) { 3295 a = pjmedia_sdp_attr_create(pool, "recvonly", NULL); 3296 } else { 3297 const pjmedia_sdp_conn *conn; 3298 a = pjmedia_sdp_attr_create(pool, "inactive", NULL); 3299 3300 /* Also check if the original c= line address is zero */ 3301 conn = m->conn; 3302 if (!conn) 3303 conn = cur_sdp->conn; 3304 if (pj_strcmp2(&conn->addr, "0.0.0.0")==0 || 3305 pj_strcmp2(&conn->addr, "0")==0) 3306 { 3307 if (!new_m->conn) { 3308 new_m->conn = PJ_POOL_ZALLOC_T(pool, pjmedia_sdp_conn); 3309 } 3310 3311 if (pj_strcmp2(&new_m->conn->addr, "0.0.0.0")) { 3312 new_m->conn->net_type = pj_str("IN"); 3313 new_m->conn->addr_type = pj_str("IP4"); 3314 new_m->conn->addr = pj_str("0.0.0.0"); 3315 } 3316 } 3317 } 3318 3319 pj_assert(a); 3320 pjmedia_sdp_media_add_attr(new_m, a); 3321 } 3322 } 3323 3264 3324 3265 3325 if (rem_can_update) {
Note: See TracChangeset
for help on using the changeset viewer.