Ignore:
Timestamp:
Sep 21, 2011 10:20:01 AM (8 years ago)
Author:
ming
Message:

Re #1266: Asynchronous media transport creation

  • Add feature that allows ICE media transport to be created asynchronously.
  • Add new callback, e.g. on_call_media_transport_state(call_id, state_struct) to report media transport status.
  • Handle outgoing calls while creating media transport asynchronously.
File:
1 edited

Legend:

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

    r3756 r3763  
    149149    pjsip_media_type_init(&msg_data->multipart_ctype, NULL, NULL); 
    150150    pj_list_init(&msg_data->multipart_parts); 
     151} 
     152 
     153PJ_DEF(pjsua_msg_data*) pjsua_msg_data_clone(pj_pool_t *pool, 
     154                                             const pjsua_msg_data *rhs) 
     155{ 
     156    pjsua_msg_data *msg_data; 
     157    const pjsip_hdr *hdr; 
     158    const pjsip_multipart_part *mpart; 
     159 
     160    PJ_ASSERT_RETURN(pool && rhs, NULL); 
     161 
     162    msg_data = PJ_POOL_ZALLOC_T(pool, pjsua_msg_data); 
     163    PJ_ASSERT_RETURN(msg_data != NULL, NULL); 
     164 
     165    pj_list_init(&msg_data->hdr_list); 
     166    hdr = rhs->hdr_list.next; 
     167    while (hdr != &rhs->hdr_list) { 
     168        pj_list_push_back(&msg_data->hdr_list, pjsip_hdr_clone(pool, hdr)); 
     169        hdr = hdr->next; 
     170    } 
     171 
     172    pj_strdup(pool, &msg_data->content_type, &rhs->content_type); 
     173    pj_strdup(pool, &msg_data->msg_body, &rhs->msg_body); 
     174 
     175    pjsip_media_type_cp(pool, &msg_data->multipart_ctype, 
     176                        &rhs->multipart_ctype); 
     177 
     178    pj_list_init(&msg_data->multipart_parts); 
     179    mpart = rhs->multipart_parts.next; 
     180    while (mpart != &rhs->multipart_parts) { 
     181        pj_list_push_back(&msg_data->multipart_parts, 
     182                          pjsip_multipart_clone_part(pool, mpart)); 
     183        mpart = mpart->next; 
     184    } 
     185 
     186    return msg_data; 
    151187} 
    152188 
Note: See TracChangeset for help on using the changeset viewer.