Changeset 882


Ignore:
Timestamp:
Jan 14, 2007 12:39:45 AM (18 years ago)
Author:
bennylp
Message:

Continuing work on ticket #50: make explicit transport selection works for sending response

Location:
pjproject/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r864 r882  
    28922892    } 
    28932893 
     2894    /* Add UDP transport unless it's disabled. */ 
     2895    if (!app_config.no_udp) { 
     2896        pjsua_acc_id aid; 
     2897 
     2898        status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, 
     2899                                        &app_config.udp_cfg,  
     2900                                        &transport_id); 
     2901        if (status != PJ_SUCCESS) 
     2902            goto on_error; 
     2903 
     2904        /* Add local account */ 
     2905        pjsua_acc_add_local(transport_id, PJ_TRUE, &aid); 
     2906        //pjsua_acc_set_transport(aid, transport_id); 
     2907        pjsua_acc_set_online_status(current_acc, PJ_TRUE); 
     2908    } 
     2909 
    28942910    /* Add TCP transport unless it's disabled */ 
    28952911    if (!app_config.no_tcp) { 
     
    29062922    } 
    29072923 
    2908     /* Add UDP transport unless it's disabled. */ 
    2909     if (!app_config.no_udp) { 
    2910         status = pjsua_transport_create(PJSIP_TRANSPORT_UDP, 
    2911                                         &app_config.udp_cfg,  
    2912                                         &transport_id); 
    2913         if (status != PJ_SUCCESS) 
    2914             goto on_error; 
    2915  
    2916         /* Add local account */ 
    2917         pjsua_acc_add_local(transport_id, PJ_TRUE, NULL); 
    2918         pjsua_acc_set_online_status(current_acc, PJ_TRUE); 
    2919     } 
    29202924 
    29212925#if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 
  • pjproject/trunk/pjsip/include/pjsip/sip_dialog.h

    r879 r882  
    231231 * Lock/bind dialog to a specific transport/listener. This is optional, 
    232232 * as normally transport will be selected automatically based on the  
    233  * destination of requests upon resolver completion. When the dialog is  
    234  * explicitly bound to the specific transport/listener, all UAC transactions 
     233 * destination of messages upon resolver completion. When the dialog is  
     234 * explicitly bound to the specific transport/listener, all transactions 
    235235 * originated by this dialog will use the specified transport/listener 
    236236 * when sending outgoing requests. 
  • pjproject/trunk/pjsip/include/pjsip/sip_transaction.h

    r879 r882  
    219219 * Lock/bind transaction to a specific transport/listener. This is optional, 
    220220 * as normally transport will be selected automatically based on the  
    221  * destination of the request upon resolver completion. Also it's only valid 
    222  * for UAC transaction (to send outgoing request), since for UAS the 
    223  * transport will be selected according to rules about handling incoming 
    224  * request (most likely it will use the transport where the request is 
    225  * coming from if ";rport" parameter is present in Via header). 
    226  * 
    227  * @param tsx       The UAC transaction. 
     221 * destination of the message upon resolver completion. 
     222 * 
     223 * @param tsx       The transaction. 
    228224 * @param sel       Transport selector containing the specification of 
    229225 *                  transport or listener to be used by this transaction 
  • pjproject/trunk/pjsip/include/pjsip/sip_transport.h

    r881 r882  
    212212        pjsip_transport *transport; 
    213213        pjsip_tpfactory *listener; 
     214        void            *ptr; 
    214215    } u; 
    215216 
  • pjproject/trunk/pjsip/src/pjsip/sip_dialog.c

    r881 r882  
    13261326    pjsip_dlg_inc_lock(dlg); 
    13271327 
     1328    /* If the dialog is locked to transport, make sure that transaction 
     1329     * is locked to the same transport too. 
     1330     */ 
     1331    if (dlg->tp_sel.type != tsx->tp_sel.type || 
     1332        dlg->tp_sel.u.ptr != tsx->tp_sel.u.ptr) 
     1333    { 
     1334        status = pjsip_tsx_set_transport(tsx, &dlg->tp_sel); 
     1335        pj_assert(status == PJ_SUCCESS); 
     1336    } 
     1337 
     1338    /* Ask transaction to send the response */ 
    13281339    status = pjsip_tsx_send_msg(tsx, tdata); 
    13291340 
  • pjproject/trunk/pjsip/src/pjsip/sip_transaction.c

    r879 r882  
    13751375 
    13761376    /* Must be UAC transaction */ 
    1377     PJ_ASSERT_RETURN(tsx && sel && tsx->role == PJSIP_ROLE_UAC, PJ_EINVAL); 
     1377    PJ_ASSERT_RETURN(tsx && sel, PJ_EINVAL); 
    13781378 
    13791379    /* Start locking the transaction. */ 
Note: See TracChangeset for help on using the changeset viewer.