Ignore:
Timestamp:
Feb 24, 2010 5:43:34 AM (15 years ago)
Author:
nanang
Message:

Ticket #1032:

  • Initial version of server domain name verification:
    • Updated SSL certificate info, especially identities info
    • Updated verification mechanism as in the specifications in ticket desc.
    • Added server domain name info in pjsip_tx_data.
    • Added alternative API for acquiring transport and creating transport of transport factory to include pjsip_tx_data param.
    • Server identity match criteria:
      • full host name match
      • wild card not accepted
      • if identity is URI, it must be SIP/SIPS URI
  • Initial version of transport state notifications:
    • Added new API to set transport state callback in PJSIP and PJSUA.
    • Defined states: connected/disconnected, accepted/rejected, verification errors.
  • Minors:
    • Updated SSL socket test: dump verification result, test of requiring client cert, and few minors.
    • Updated test cert to include subjectAltName extensions.
    • Added SSL certificate dump function.
    • Updated max number of socket async operations in Symbian sample apps (RSocketServ::Connect()) to 32 (was default 8).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/symbian_ua/ua.cpp

    r2999 r3106  
    271271} 
    272272 
     273/* 
     274 * Transport status notification 
     275 */ 
     276static pj_bool_t on_transport_state(pjsip_transport *tp, pj_uint32_t state, 
     277                                    const pjsip_transport_state_info *info) 
     278{ 
     279    char host_port[128]; 
     280 
     281    pj_ansi_snprintf(host_port, sizeof(host_port), "[%.*s:%d]", 
     282                     (int)tp->remote_name.host.slen, 
     283                     tp->remote_name.host.ptr, 
     284                     tp->remote_name.port); 
     285 
     286    if (state & PJSIP_TP_STATE_CONNECTED) { 
     287        PJ_LOG(3,(THIS_FILE, "SIP transport %s is connected to %s",  
     288                 tp->type_name, host_port)); 
     289    }  
     290    else if (state & PJSIP_TP_STATE_ACCEPTED) { 
     291        PJ_LOG(3,(THIS_FILE, "SIP transport %s accepted %s", 
     292                 tp->type_name, host_port)); 
     293    }  
     294    else if (state & PJSIP_TP_STATE_DISCONNECTED) { 
     295        char buf[100]; 
     296 
     297        snprintf(buf, sizeof(buf), "SIP transport %s is disconnected from %s", 
     298                 tp->type_name, host_port); 
     299        pjsua_perror(THIS_FILE, buf, info->status); 
     300    } 
     301    else if (state & PJSIP_TP_STATE_REJECTED) { 
     302        char buf[100]; 
     303 
     304        snprintf(buf, sizeof(buf), "SIP transport %s rejected %s", 
     305                 tp->type_name, host_port); 
     306        pjsua_perror(THIS_FILE, buf, info->status); 
     307    } 
     308 
     309#if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 
     310 
     311    if (!pj_ansi_stricmp(tp->type_name, "tls") && info->ext_info && 
     312        (state == PJSIP_TP_STATE_CONNECTED ||  
     313         (state & PJSIP_TP_STATE_TLS_VERIF_ERROR))) 
     314    { 
     315        pjsip_tls_state_info *tls_info = (pjsip_tls_state_info*)info->ext_info; 
     316        pj_ssl_sock_info *ssl_sock_info = (pj_ssl_sock_info*) 
     317                                          tls_info->ssl_sock_info; 
     318        char buf[2048]; 
     319 
     320        /* Dump server TLS certificate */ 
     321        pj_ssl_cert_info_dump(ssl_sock_info->remote_cert_info, "  ", 
     322                              buf, sizeof(buf)); 
     323        PJ_LOG(4,(THIS_FILE, "TLS cert info of %s:\n%s", host_port, buf)); 
     324    } 
     325 
     326#endif 
     327    return PJ_TRUE; 
     328} 
     329 
    273330 
    274331//#include<e32debug.h> 
     
    331388    cfg.cb.on_call_replaced = &on_call_replaced; 
    332389    cfg.cb.on_nat_detect = &on_nat_detect; 
     390    cfg.cb.on_transport_state = &on_transport_state; 
    333391     
    334392    if (SIP_PROXY) { 
     
    10551113     
    10561114    // Initialize RSocketServ 
    1057     if ((err=aSocketServer.Connect()) != KErrNone) 
     1115    if ((err=aSocketServer.Connect(32)) != KErrNone) 
    10581116        return PJ_STATUS_FROM_OS(err); 
    10591117     
Note: See TracChangeset for help on using the changeset viewer.