Changeset 5703


Ignore:
Timestamp:
Nov 27, 2017 8:24:50 AM (7 years ago)
Author:
ming
Message:

Fixed #2069: Add outbound proxy settings in pjsua2
Thanks to Zarko Coklin for the patch.

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua2/endpoint.hpp

    r5676 r5703  
    461461 
    462462    /** 
     463     * Specify the URL of outbound proxies to visit for all outgoing requests. 
     464     * The outbound proxies will be used for all accounts, and it will 
     465     * be used to build the route set for outgoing requests. The final 
     466     * route set for outgoing requests will consists of the outbound proxies 
     467     * and the proxy configured in the account. 
     468     */ 
     469    StringVector        outboundProxy; 
     470 
     471    /** 
    463472     * Optional user agent string (default empty). If it's empty, no 
    464473     * User-Agent header will be sent with outgoing requests. 
     
    497506 
    498507    bool                stunTryIpv6; 
     508 
    499509    /** 
    500510     * This specifies if the library startup should ignore failure with the 
  • pjproject/trunk/pjsip/src/pjsua2/endpoint.cpp

    r5676 r5703  
    174174        this->stunServer.push_back(pj2Str(ua_cfg.stun_srv[i])); 
    175175    } 
     176    for (i=0; i<ua_cfg.outbound_proxy_cnt; ++i) { 
     177        this->outboundProxy.push_back(pj2Str(ua_cfg.outbound_proxy[i])); 
     178    } 
    176179 
    177180    this->stunTryIpv6 = PJ2BOOL(ua_cfg.stun_try_ipv6); 
     
    205208    } 
    206209    pua_cfg.stun_srv_cnt = i; 
     210 
     211    for (i=0; i<this->outboundProxy.size() && 
     212              i<PJ_ARRAY_SIZE(pua_cfg.outbound_proxy); ++i) 
     213    { 
     214        pua_cfg.outbound_proxy[i] = str2Pj(this->outboundProxy[i]); 
     215    } 
     216    pua_cfg.outbound_proxy_cnt= i; 
    207217 
    208218    pua_cfg.nat_type_in_sdp = this->natTypeInSdp; 
Note: See TracChangeset for help on using the changeset viewer.