Changeset 668


Ignore:
Timestamp:
Aug 9, 2006 1:53:59 PM (16 years ago)
Author:
bennylp
Message:

Fixed run-time bug with simple_ua and pjsip-perf sample.

Location:
pjproject/trunk/pjsip-apps/src/samples
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/samples/pjsip-perf.c

    r657 r668  
    397397    pj_bool_t has_initial = PJ_TRUE; 
    398398 
     399    PJ_UNUSED_ARG(h); 
     400 
    399401    entry->id = 0; 
    400402    send_response(call->inv, NULL, 200, &has_initial); 
     
    533535    } else { 
    534536        /* Send the 200 response immediately . */   
    535         status = pjsip_inv_send_msg(call->inv, tdata);  
     537        status = send_response(call->inv, rdata, 200, &has_initial); 
    536538        PJ_ASSERT_ON_FAIL(status == PJ_SUCCESS, return PJ_TRUE); 
    537539    } 
  • pjproject/trunk/pjsip-apps/src/samples/simpleua.c

    r582 r668  
    257257    PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 
    258258 
    259     /*  
    260      * Initialize RTP socket info for the media. 
    261      * The RTP socket is hard-codec to port 4000. 
    262      */ 
    263     status = pj_sock_socket(PJ_AF_INET, PJ_SOCK_DGRAM, 0, &g_med_skinfo.rtp_sock); 
    264     PJ_ASSERT_RETURN(status == PJ_SUCCESS, 1); 
    265259     
    266     pj_sockaddr_in_init( &g_med_skinfo.rtp_addr_name,  
    267                          pjsip_endpt_name(g_endpt), 4000); 
    268  
    269     status = pj_sock_bind(g_med_skinfo.rtp_sock, &g_med_skinfo.rtp_addr_name, 
    270                           sizeof(pj_sockaddr_in)); 
    271     if (status != PJ_SUCCESS) { 
    272         app_perror( THIS_FILE,  
    273                     "Unable to bind RTP socket",  
    274                     status); 
    275         return 1; 
    276     } 
    277  
    278  
    279     /* For simplicity, ignore RTCP socket. */ 
    280     g_med_skinfo.rtcp_sock = PJ_INVALID_SOCKET; 
    281     g_med_skinfo.rtcp_addr_name = g_med_skinfo.rtp_addr_name; 
    282  
    283      
    284     /* Create media transport */ 
    285     status = pjmedia_transport_udp_attach(g_med_endpt, NULL, &g_med_skinfo, 
    286                                           0, &g_med_transport); 
     260    /*  
     261     * Create media transport used to send/receive RTP/RTCP socket. 
     262     * One media transport is needed for each call. Application may 
     263     * opt to re-use the same media transport for subsequent calls. 
     264     */ 
     265    status = pjmedia_transport_udp_create(g_med_endpt, NULL, 4000, 0,  
     266                                          &g_med_transport); 
    287267    if (status != PJ_SUCCESS) { 
    288268        app_perror(THIS_FILE, "Unable to create media transport", status); 
    289269        return 1; 
    290270    } 
     271 
     272    /*  
     273     * Get socket info (address, port) of the media transport. We will 
     274     * need this info to create SDP (i.e. the address and port info in 
     275     * the SDP). 
     276     */ 
     277    { 
     278        pjmedia_transport_udp_info udp_info; 
     279 
     280        pjmedia_transport_udp_get_info(g_med_transport, &udp_info); 
     281        pj_memcpy(&g_med_skinfo, &udp_info.skinfo,  
     282                  sizeof(pjmedia_sock_info)); 
     283    } 
     284 
    291285 
    292286    /* 
Note: See TracChangeset for help on using the changeset viewer.