Ignore:
Timestamp:
Dec 25, 2006 6:43:59 AM (17 years ago)
Author:
bennylp
Message:

Major TLS work (ticket #3): asynchronous socket, rather complete TLS options, and pjsua integration. The TLS support should work in both client and server mode.

File:
1 edited

Legend:

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

    r849 r861  
    10501050         * Create TLS transport. 
    10511051         */ 
     1052        /* 
     1053         * Create TCP transport. 
     1054         */ 
     1055        pjsua_transport_config config; 
     1056        pjsip_host_port a_name; 
    10521057        pjsip_tpfactory *tls; 
     1058        pj_sockaddr_in local_addr; 
     1059 
     1060        /* Supply default config if it's not specified */ 
     1061        if (cfg == NULL) { 
     1062            pjsua_transport_config_default(&config); 
     1063            config.port = 5061; 
     1064            cfg = &config; 
     1065        } 
     1066 
     1067        /* Init local address */ 
     1068        pj_sockaddr_in_init(&local_addr, 0, 0); 
     1069 
     1070        if (cfg->port) 
     1071            local_addr.sin_port = pj_htons((pj_uint16_t)cfg->port); 
     1072 
     1073        if (cfg->bound_addr.slen) { 
     1074            status = pj_sockaddr_in_set_str_addr(&local_addr,&cfg->bound_addr); 
     1075            if (status != PJ_SUCCESS) { 
     1076                pjsua_perror(THIS_FILE,  
     1077                             "Unable to resolve transport bound address",  
     1078                             status); 
     1079                goto on_return; 
     1080            } 
     1081        } 
     1082 
     1083        /* Init published name */ 
     1084        pj_bzero(&a_name, sizeof(pjsip_host_port)); 
     1085        if (cfg->public_addr.slen) 
     1086            a_name.host = cfg->public_addr; 
    10531087 
    10541088        status = pjsip_tls_transport_start(pjsua_var.endpt,  
    1055                                            &cfg->tls_key_file, 
    1056                                            &cfg->tls_password,  
    1057                                            &cfg->tls_ca_file, 
    1058                                            NULL, NULL, 1, &tls); 
     1089                                           &cfg->tls_setting,  
     1090                                           &local_addr, &a_name, 1, &tls); 
    10591091        if (status != PJ_SUCCESS) { 
    10601092            pjsua_perror(THIS_FILE, "Error creating SIP TLS listener",  
Note: See TracChangeset for help on using the changeset viewer.