Ignore:
Timestamp:
Aug 12, 2009 11:03:23 AM (15 years ago)
Author:
bennylp
Message:

Ticket #866: Allow application to specify more than one STUN servers for more robustness, and continue application startup if STUN resolution fails

PJSUA-LIB:

  • New fields in pjsua_config to specify more than one STUN servers (the stun_srv_cnt and stun_srv array)
  • The existing stun_host and stun_domain fields are deprecated, but backward compatibility is maintained. If stun_srv_cnt is zero, the library will import the entries from stun_host and stun_domain
  • The library will now resolve the STUN server entries one by one and test it before using it
  • New auxiliary API pjsua_resolve_stun_servers() to perform resolution and test against array of STUN servers

pjsua application:

  • The "stun-srv" command line options can now be specified more than once
File:
1 edited

Legend:

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

    r2855 r2864  
    213213} pjsua_conf_setting; 
    214214 
     215typedef struct pjsua_stun_resolve 
     216{ 
     217    PJ_DECL_LIST_MEMBER(struct pjsua_stun_resolve); 
     218 
     219    pj_pool_t           *pool;      /**< Pool               */ 
     220    unsigned             count;     /**< # of entries       */ 
     221    pj_str_t            *srv;       /**< Array of entries   */ 
     222    unsigned             idx;       /**< Current index      */ 
     223    void                *token;     /**< App token          */ 
     224    pj_stun_resolve_cb   cb;        /**< App callback       */ 
     225    pj_bool_t            blocking;  /**< Blocking?          */ 
     226    pj_status_t          status;    /**< Session status     */ 
     227    pj_sockaddr          addr;      /**< Result             */ 
     228    pj_stun_sock        *stun_sock; /**< Testing STUN sock  */ 
     229} pjsua_stun_resolve; 
     230 
    215231 
    216232/** 
     
    242258    pj_sockaddr          stun_srv;  /**< Resolved STUN server address   */ 
    243259    pj_status_t          stun_status; /**< STUN server status.          */ 
     260    pjsua_stun_resolve   stun_res;  /**< List of pending STUN resolution*/ 
    244261    pj_dns_resolver     *resolver;  /**< DNS resolver.                  */ 
    245262 
     
    351368#endif 
    352369 
     370/****** 
     371 * STUN resolution 
     372 */ 
     373/* Resolve the STUN server */ 
     374pj_status_t resolve_stun_server(pj_bool_t wait); 
     375 
    353376/**  
    354377 * Normalize route URI (check for ";lr" and append one if it doesn't 
     
    356379 */ 
    357380pj_status_t normalize_route_uri(pj_pool_t *pool, pj_str_t *uri); 
    358  
    359 /** 
    360  * Resolve STUN server. 
    361  */ 
    362 pj_status_t pjsua_resolve_stun_server(pj_bool_t wait); 
    363381 
    364382/** 
Note: See TracChangeset for help on using the changeset viewer.