summaryrefslogtreecommitdiff
path: root/pjsip/include/pjsua-lib/pjsua_internal.h
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-08-12 11:03:23 +0000
committerBenny Prijono <bennylp@teluu.com>2009-08-12 11:03:23 +0000
commit8df6724ddca5de98cfdc21316fb5d7e5de95d726 (patch)
treee48368d28208f4454071f196f49f7cddf3b0e9ba /pjsip/include/pjsua-lib/pjsua_internal.h
parentc4851558e0c60e8a8929473631b825e1945f239b (diff)
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 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2864 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/include/pjsua-lib/pjsua_internal.h')
-rw-r--r--pjsip/include/pjsua-lib/pjsua_internal.h28
1 files changed, 23 insertions, 5 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua_internal.h b/pjsip/include/pjsua-lib/pjsua_internal.h
index d80f5d1d..03c6627c 100644
--- a/pjsip/include/pjsua-lib/pjsua_internal.h
+++ b/pjsip/include/pjsua-lib/pjsua_internal.h
@@ -212,6 +212,22 @@ typedef struct pjsua_conf_setting
unsigned bits_per_sample;
} pjsua_conf_setting;
+typedef struct pjsua_stun_resolve
+{
+ PJ_DECL_LIST_MEMBER(struct pjsua_stun_resolve);
+
+ pj_pool_t *pool; /**< Pool */
+ unsigned count; /**< # of entries */
+ pj_str_t *srv; /**< Array of entries */
+ unsigned idx; /**< Current index */
+ void *token; /**< App token */
+ pj_stun_resolve_cb cb; /**< App callback */
+ pj_bool_t blocking; /**< Blocking? */
+ pj_status_t status; /**< Session status */
+ pj_sockaddr addr; /**< Result */
+ pj_stun_sock *stun_sock; /**< Testing STUN sock */
+} pjsua_stun_resolve;
+
/**
* Global pjsua application data.
@@ -241,6 +257,7 @@ struct pjsua_data
pj_stun_config stun_cfg; /**< Global STUN settings. */
pj_sockaddr stun_srv; /**< Resolved STUN server address */
pj_status_t stun_status; /**< STUN server status. */
+ pjsua_stun_resolve stun_res; /**< List of pending STUN resolution*/
pj_dns_resolver *resolver; /**< DNS resolver. */
/* Detected NAT type */
@@ -350,6 +367,12 @@ PJ_INLINE(pjsua_im_data*) pjsua_im_data_dup(pj_pool_t *pool,
#define PJSUA_UNLOCK()
#endif
+/******
+ * STUN resolution
+ */
+/* Resolve the STUN server */
+pj_status_t resolve_stun_server(pj_bool_t wait);
+
/**
* Normalize route URI (check for ";lr" and append one if it doesn't
* exist and pjsua_config.force_lr is set.
@@ -357,11 +380,6 @@ PJ_INLINE(pjsua_im_data*) pjsua_im_data_dup(pj_pool_t *pool,
pj_status_t normalize_route_uri(pj_pool_t *pool, pj_str_t *uri);
/**
- * Resolve STUN server.
- */
-pj_status_t pjsua_resolve_stun_server(pj_bool_t wait);
-
-/**
* Handle incoming invite request.
*/
pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata);