Changeset 4985 for pjproject


Ignore:
Timestamp:
Mar 2, 2015 3:04:19 AM (9 years ago)
Author:
nanang
Message:

Fixed #1816: Restart media transport on following forked media.

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsip-ua/sip_inv.h

    r4653 r4985  
    411411    void                *mod_data[PJSIP_MAX_MODULE];/**< Modules data.      */ 
    412412    struct pjsip_timer  *timer;                     /**< Session Timers.    */ 
     413    pj_bool_t            following_fork;            /**< Internal, following 
     414                                                         forked media?      */ 
    413415}; 
    414416 
  • pjproject/trunk/pjsip/src/pjsip-ua/sip_inv.c

    r4975 r4985  
    18951895    } 
    18961896 
     1897    /* Initialize info that we are following forked media */ 
     1898    inv->following_fork = PJ_FALSE; 
     1899 
    18971900    /* MUST NOT do multiple SDP offer/answer in a single transaction, 
    18981901     * EXCEPT if: 
     
    19471950                return status; 
    19481951            } 
     1952 
     1953            inv->following_fork = PJ_TRUE; 
    19491954 
    19501955        } else { 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c

    r4980 r4985  
    26912691                pjmedia_transport_info tp_info; 
    26922692                pjmedia_srtp_info *srtp_info; 
     2693 
     2694                if (call->inv->following_fork) { 
     2695                    /* Normally media transport will automatically restart 
     2696                     * itself (if needed, based on info from the SDP) in 
     2697                     * pjmedia_transport_media_start(), however in "following 
     2698                     * forked media" case (see #1644), we need to explicitly 
     2699                     * restart it as it cannot detect fork scenario from 
     2700                     * the SDP only. 
     2701                     */ 
     2702                    status = pjmedia_transport_media_stop(call_med->tp); 
     2703                    if (status != PJ_SUCCESS) { 
     2704                        PJ_PERROR(1,(THIS_FILE, status, 
     2705                                     "pjmedia_transport_media_stop() failed " 
     2706                                     "for call_id %d media %d", 
     2707                                     call_id, mi)); 
     2708                        continue; 
     2709                    } 
     2710                    status = pjmedia_transport_media_create(call_med->tp, 
     2711                                                            tmp_pool, 
     2712                                                            0, NULL, mi); 
     2713                    if (status != PJ_SUCCESS) { 
     2714                        PJ_PERROR(1,(THIS_FILE, status, 
     2715                                     "pjmedia_transport_media_create() failed " 
     2716                                     "for call_id %d media %d", 
     2717                                     call_id, mi)); 
     2718                        continue; 
     2719                    } 
     2720                } 
    26932721 
    26942722                /* Start/restart media transport based on info in SDP */ 
Note: See TracChangeset for help on using the changeset viewer.