diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-12-08 21:58:31 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-12-08 21:58:31 +0000 |
commit | e1f1e702acaed16de56fb5d19fad61a1de83e070 (patch) | |
tree | 052eee4c64444b8e68f994eb4ac6b5c82692ba17 /pjsip/src/pjsua-lib/pjsua_core.c | |
parent | ec5923a4081a5014ee7242e5ef91b2af8394aceb (diff) |
Initial implementation of TLS transport for ticket #3 (still not working at all)
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@849 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_core.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_core.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c index be87a8e2..ee1439fd 100644 --- a/pjsip/src/pjsua-lib/pjsua_core.c +++ b/pjsip/src/pjsua-lib/pjsua_core.c @@ -1044,6 +1044,30 @@ PJ_DEF(pj_status_t) pjsua_transport_create( pjsip_transport_type_e type, pjsua_var.tpdata[id].local_name = tcp->addr_name; pjsua_var.tpdata[id].data.factory = tcp; +#if defined(PJSIP_HAS_TLS_TRANSPORT) && PJSIP_HAS_TLS_TRANSPORT!=0 + } else if (type == PJSIP_TRANSPORT_TLS) { + /* + * Create TLS transport. + */ + pjsip_tpfactory *tls; + + status = pjsip_tls_transport_start(pjsua_var.endpt, + &cfg->tls_key_file, + &cfg->tls_password, + &cfg->tls_ca_file, + NULL, NULL, 1, &tls); + if (status != PJ_SUCCESS) { + pjsua_perror(THIS_FILE, "Error creating SIP TLS listener", + status); + goto on_return; + } + + /* Save the transport */ + pjsua_var.tpdata[id].type = type; + pjsua_var.tpdata[id].local_name = tls->addr_name; + pjsua_var.tpdata[id].data.factory = tls; +#endif + } else { status = PJSIP_EUNSUPTRANSPORT; pjsua_perror(THIS_FILE, "Error creating transport", status); |