diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-04-22 18:32:16 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-04-22 18:32:16 +0000 |
commit | 56e13a2ee2d08c46cf873e907139ea0d6cfb984a (patch) | |
tree | e27f4ae5564841ac0c9b284654f4c98fae2751c6 /pjnath | |
parent | 2db61b49e4a45ea4f65371a7d3b5d8244809058f (diff) |
Report NAT type as unknown rather than UDP blocked when test 1B failed (could happen when port 3479 is blocked). Thanks Helmut Wolf for the info.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1936 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjnath')
-rw-r--r-- | pjnath/src/pjnath/nat_detect.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/pjnath/src/pjnath/nat_detect.c b/pjnath/src/pjnath/nat_detect.c index 7eef39ec..cbe10503 100644 --- a/pjnath/src/pjnath/nat_detect.c +++ b/pjnath/src/pjnath/nat_detect.c @@ -734,9 +734,26 @@ static void on_request_complete(pj_stun_session *stun_sess, case PJNATH_ESTUNTIMEDOUT: /* * Strangely test 1B has failed. Maybe connectivity was - * lost? + * lost? Or perhaps port 3489 (the usual port number in + * CHANGED-ADDRESS) is blocked? */ - end_session(sess, PJ_SUCCESS, PJ_STUN_NAT_TYPE_BLOCKED); + switch (sess->result[ST_TEST_3].status) { + case PJ_SUCCESS: + /* Although test 1B failed, test 3 was successful. + * It could be that port 3489 is blocked, while the + * NAT itself looks to be a Restricted one. + */ + end_session(sess, PJ_SUCCESS, + PJ_STUN_NAT_TYPE_RESTRICTED); + break; + default: + /* Can't distinguish between Symmetric and Port + * Restricted, so set the type to Unknown + */ + end_session(sess, PJ_SUCCESS, + PJ_STUN_NAT_TYPE_ERR_UNKNOWN); + break; + } break; default: /* |