summaryrefslogtreecommitdiff
path: root/pjsip-apps/src/symbian_ua/ua.cpp
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2007-10-26 05:35:42 +0000
committerBenny Prijono <bennylp@teluu.com>2007-10-26 05:35:42 +0000
commit90e2c2b9f5922d3959434b24bd1829fdb18e0950 (patch)
tree796576cbbf511ff75be87aaa8e78fc0c860cfe82 /pjsip-apps/src/symbian_ua/ua.cpp
parentdbeb703e133db47a744bec62a7c990f7ef0750d5 (diff)
More ticket #399: pj_sock_close() is called more than once. Also implemented NAT detection callback for Symbian UA
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1526 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip-apps/src/symbian_ua/ua.cpp')
-rw-r--r--pjsip-apps/src/symbian_ua/ua.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/pjsip-apps/src/symbian_ua/ua.cpp b/pjsip-apps/src/symbian_ua/ua.cpp
index c75432bc..75a8eb7c 100644
--- a/pjsip-apps/src/symbian_ua/ua.cpp
+++ b/pjsip-apps/src/symbian_ua/ua.cpp
@@ -57,7 +57,7 @@
//
// STUN server
-#if 0
+#if 1
// Use this to have the STUN server resolved normally
# define STUN_DOMAIN NULL
# define STUN_SERVER "stun.fwdnet.net"
@@ -216,6 +216,16 @@ static void on_call_transfer_status(pjsua_call_id call_id,
}
+/* NAT detection result */
+static void on_nat_detect(const pj_stun_nat_detect_result *res)
+{
+ if (res->status != PJ_SUCCESS) {
+ pjsua_perror(THIS_FILE, "NAT detection failed", res->status);
+ } else {
+ PJ_LOG(3, (THIS_FILE, "NAT detected as %s", res->nat_type_name));
+ }
+}
+
/* Notification that call is being replaced. */
static void on_call_replaced(pjsua_call_id old_call_id,
pjsua_call_id new_call_id)
@@ -282,7 +292,8 @@ static pj_status_t app_startup()
cfg.cb.on_typing = &on_typing;
cfg.cb.on_call_transfer_status = &on_call_transfer_status;
cfg.cb.on_call_replaced = &on_call_replaced;
-
+ cfg.cb.on_nat_detect = &on_nat_detect;
+
if (SIP_PROXY) {
cfg.outbound_proxy_cnt = 1;
cfg.outbound_proxy[0] = pj_str(SIP_PROXY);