Changeset 3110 for pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
- Timestamp:
- Feb 25, 2010 11:58:19 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r3106 r3110 2791 2791 * Transport status notification 2792 2792 */ 2793 static pj_bool_t on_transport_state(pjsip_transport *tp, pj_uint32_t state, 2794 const pjsip_transport_state_info *info) 2793 static void on_transport_state(pjsip_transport *tp, 2794 pjsip_transport_state state, 2795 const pjsip_transport_state_info *info) 2795 2796 { 2796 2797 char host_port[128]; … … 2801 2802 tp->remote_name.port); 2802 2803 2803 if (state & PJSIP_TP_STATE_CONNECTED) { 2804 PJ_LOG(3,(THIS_FILE, "SIP transport %s is connected to %s", 2805 tp->type_name, host_port)); 2806 } 2807 else if (state & PJSIP_TP_STATE_ACCEPTED) { 2808 PJ_LOG(3,(THIS_FILE, "SIP transport %s accepted %s", 2809 tp->type_name, host_port)); 2810 } 2811 else if (state & PJSIP_TP_STATE_DISCONNECTED) { 2812 char buf[100]; 2813 2814 snprintf(buf, sizeof(buf), "SIP transport %s is disconnected from %s", 2815 tp->type_name, host_port); 2816 pjsua_perror(THIS_FILE, buf, info->status); 2817 } 2818 else if (state & PJSIP_TP_STATE_REJECTED) { 2819 char buf[100]; 2820 2821 snprintf(buf, sizeof(buf), "SIP transport %s rejected %s", 2822 tp->type_name, host_port); 2823 pjsua_perror(THIS_FILE, buf, info->status); 2804 switch (state) { 2805 case PJSIP_TP_STATE_CONNECTED: 2806 { 2807 PJ_LOG(3,(THIS_FILE, "SIP transport %s is connected to %s", 2808 tp->type_name, host_port)); 2809 } 2810 break; 2811 2812 case PJSIP_TP_STATE_DISCONNECTED: 2813 { 2814 char buf[100]; 2815 2816 snprintf(buf, sizeof(buf), "SIP transport %s is disconnected from %s", 2817 tp->type_name, host_port); 2818 pjsua_perror(THIS_FILE, buf, info->status); 2819 } 2820 break; 2821 2822 default: 2823 break; 2824 2824 } 2825 2825 … … 2828 2828 if (!pj_ansi_stricmp(tp->type_name, "tls") && info->ext_info && 2829 2829 (state == PJSIP_TP_STATE_CONNECTED || 2830 (state & PJSIP_TP_STATE_TLS_VERIF_ERROR))) 2830 ((pjsip_tls_state_info*)info->ext_info)-> 2831 ssl_sock_info->verify_status != PJ_SUCCESS)) 2831 2832 { 2832 2833 pjsip_tls_state_info *tls_info = (pjsip_tls_state_info*)info->ext_info; 2833 pj_ssl_sock_info *ssl_sock_info = (pj_ssl_sock_info*) 2834 tls_info->ssl_sock_info; 2834 pj_ssl_sock_info *ssl_sock_info = tls_info->ssl_sock_info; 2835 2835 char buf[2048]; 2836 2836 const char *verif_msgs[32]; … … 2844 2844 /* Dump server TLS certificate verification result */ 2845 2845 verif_msg_cnt = PJ_ARRAY_SIZE(verif_msgs); 2846 pj_ssl_cert_ verify_error_st(ssl_sock_info->verify_status,2847 verif_msgs, &verif_msg_cnt);2846 pj_ssl_cert_get_verify_status_strings(ssl_sock_info->verify_status, 2847 verif_msgs, &verif_msg_cnt); 2848 2848 PJ_LOG(3,(THIS_FILE, "TLS cert verification result of %s : %s", 2849 2849 host_port, … … 2855 2855 } 2856 2856 2857 if (s tate & PJSIP_TP_STATE_TLS_VERIF_ERROR &&2857 if (ssl_sock_info->verify_status && 2858 2858 !app_config.udp_cfg.tls_setting.verify_server) 2859 2859 { … … 2864 2864 2865 2865 #endif 2866 return PJ_TRUE; 2866 2867 2867 } 2868 2868
Note: See TracChangeset
for help on using the changeset viewer.