Changeset 4592


Ignore:
Timestamp:
Sep 6, 2013 10:04:39 AM (11 years ago)
Author:
nanang
Message:

Fixed #1698: Follow account config in generating contact's secure scheme and deprecate PJSUA_SECURE_SCHEME.

Location:
pjproject/trunk/pjsip
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h

    r4586 r4592  
    25352535 
    25362536/** 
    2537  * This macro specifies the URI scheme to use in Contact header 
    2538  * when secure transport such as TLS is used. Application can specify 
    2539  * either "sip" or "sips". 
    2540  */ 
    2541 #ifndef PJSUA_SECURE_SCHEME 
    2542 #   define PJSUA_SECURE_SCHEME          "sip" 
    2543 #endif 
    2544  
    2545  
    2546 /** 
    25472537 * Maximum time to wait for unpublication transaction(s) to complete 
    25482538 * during shutdown process, before sending unregistration. The library 
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h

    r4543 r4592  
    215215    pj_str_t         display;       /**< Display name, if any.          */ 
    216216    pj_str_t         user_part;     /**< User part of local URI.        */ 
     217    pj_bool_t        is_sips;       /**< Local URI uses "sips"?         */ 
    217218    pj_str_t         contact;       /**< Our Contact header.            */ 
    218219    pj_str_t         reg_contact;   /**< Contact header for REGISTER. 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_acc.c

    r4586 r4592  
    202202        acc->srv_port = 0; 
    203203    } 
     204    acc->is_sips = PJSIP_URI_SCHEME_IS_SIPS(name_addr); 
    204205 
    205206 
     
    912913        pj_strdup_with_null(acc->pool, &acc->srv_domain, &id_sip_uri->host); 
    913914        acc->srv_port = 0; 
     915        acc->is_sips = PJSIP_URI_SCHEME_IS_SIPS(id_name_addr); 
    914916        update_reg = PJ_TRUE; 
    915917        unreg_first = PJ_TRUE; 
     
    17051707        char transport_param[32]; 
    17061708        int len; 
     1709        pj_bool_t secure; 
     1710 
     1711        secure = pjsip_transport_get_flag_from_type(tp->key.type) & 
     1712                 PJSIP_TRANSPORT_SECURE; 
    17071713 
    17081714        /* Enclose IPv6 address in square brackets */ 
     
    17281734        tmp = (char*) pj_pool_alloc(pool, PJSIP_MAX_URL_SIZE); 
    17291735        len = pj_ansi_snprintf(tmp, PJSIP_MAX_URL_SIZE, 
    1730                                "<sip:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s", 
     1736                               "<%s:%.*s%s%s%.*s%s:%d%s%.*s%s>%.*s", 
     1737                               ((secure && acc->is_sips)? "sips" : "sip"), 
    17311738                               (int)acc->user_part.slen, 
    17321739                               acc->user_part.ptr, 
     
    30803087                                     acc->display.ptr, 
    30813088                                     (acc->display.slen?"\" " : ""), 
    3082                                      (secure ? PJSUA_SECURE_SCHEME : "sip"), 
     3089                                     ((secure && acc->is_sips)? "sips" : "sip"), 
    30833090                                     (int)acc->user_part.slen, 
    30843091                                     acc->user_part.ptr, 
     
    32513258                                     acc->display.ptr, 
    32523259                                     (acc->display.slen?"\" " : ""), 
    3253                                      (secure ? PJSUA_SECURE_SCHEME : "sip"), 
     3260                                     ((secure && acc->is_sips)? "sips" : "sip"), 
    32543261                                     (int)acc->user_part.slen, 
    32553262                                     acc->user_part.ptr, 
Note: See TracChangeset for help on using the changeset viewer.