Ignore:
Timestamp:
Oct 5, 2010 4:32:04 PM (11 years ago)
Author:
nanang
Message:

Fix #1143:

  • Fixed no audio bug when pjsua with SRTP optional-with-duplicated-offer calls pjsua with SRTP disabled, by updating active media index after SDP negotiation done.
  • Fixed bug in generating SDP, pjsua_media_channel_create_sdp(), by making sure all media in the SDP candidate are aligned with current active SDP before calling pjmedia_transport_encode_sdp().
  • Fixed bug in modifying SDP for call hold, the media index to be modified was hardcoded to 0, should be active media index.
  • Added python tests for calls with SRTP optional-with-duplicated-offer.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c

    r3330 r3334  
    35813581                                           pjmedia_sdp_session *sdp) 
    35823582{ 
     3583    pjmedia_sdp_media *m; 
     3584 
    35833585    /* Call-hold is done by set the media direction to 'sendonly'  
    35843586     * (PJMEDIA_DIR_ENCODING), except when current media direction is  
     
    35923594     *  configuration to use c=0.0.0.0 for call hold. 
    35933595     */ 
     3596 
     3597    m = sdp->media[call->audio_idx]; 
     3598 
    35943599    if (call->call_hold_type == PJSUA_CALL_HOLD_TYPE_RFC2543) { 
    35953600        pjmedia_sdp_conn *conn; 
     
    35973602 
    35983603        /* Get SDP media connection line */ 
    3599         conn = sdp->media[0]->conn; 
     3604        conn = m->conn; 
    36003605        if (!conn) 
    36013606            conn = sdp->conn; 
     
    36053610 
    36063611        /* Remove existing directions attributes */ 
    3607         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "sendrecv"); 
    3608         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "sendonly"); 
    3609         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "recvonly"); 
    3610         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "inactive"); 
     3612        pjmedia_sdp_media_remove_all_attr(m, "sendrecv"); 
     3613        pjmedia_sdp_media_remove_all_attr(m, "sendonly"); 
     3614        pjmedia_sdp_media_remove_all_attr(m, "recvonly"); 
     3615        pjmedia_sdp_media_remove_all_attr(m, "inactive"); 
    36113616 
    36123617        /* Add inactive attribute */ 
    36133618        attr = pjmedia_sdp_attr_create(pool, "inactive", NULL); 
    3614         pjmedia_sdp_media_add_attr(sdp->media[0], attr); 
     3619        pjmedia_sdp_media_add_attr(m, attr); 
    36153620 
    36163621 
     
    36193624 
    36203625        /* Remove existing directions attributes */ 
    3621         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "sendrecv"); 
    3622         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "sendonly"); 
    3623         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "recvonly"); 
    3624         pjmedia_sdp_media_remove_all_attr(sdp->media[0], "inactive"); 
     3626        pjmedia_sdp_media_remove_all_attr(m, "sendrecv"); 
     3627        pjmedia_sdp_media_remove_all_attr(m, "sendonly"); 
     3628        pjmedia_sdp_media_remove_all_attr(m, "recvonly"); 
     3629        pjmedia_sdp_media_remove_all_attr(m, "inactive"); 
    36253630 
    36263631        if (call->media_dir & PJMEDIA_DIR_ENCODING) { 
    36273632            /* Add sendonly attribute */ 
    36283633            attr = pjmedia_sdp_attr_create(pool, "sendonly", NULL); 
    3629             pjmedia_sdp_media_add_attr(sdp->media[0], attr); 
     3634            pjmedia_sdp_media_add_attr(m, attr); 
    36303635        } else { 
    36313636            /* Add inactive attribute */ 
    36323637            attr = pjmedia_sdp_attr_create(pool, "inactive", NULL); 
    3633             pjmedia_sdp_media_add_attr(sdp->media[0], attr); 
     3638            pjmedia_sdp_media_add_attr(m, attr); 
    36343639        } 
    36353640    } 
     
    36733678{ 
    36743679    pjsua_call *call; 
    3675     pjmedia_sdp_conn *conn; 
     3680    pjmedia_sdp_conn *conn = NULL; 
    36763681    pjmedia_sdp_session *answer; 
    36773682    pj_status_t status; 
     
    36813686    call = (pjsua_call*) inv->dlg->mod_data[pjsua_var.mod.id]; 
    36823687 
    3683     conn = offer->media[0]->conn; 
     3688    if (call->audio_idx < (int)offer->media_count) 
     3689        conn = offer->media[call->audio_idx]->conn; 
     3690 
    36843691    if (!conn) 
    36853692        conn = offer->conn; 
Note: See TracChangeset for help on using the changeset viewer.