Opened 15 years ago

Closed 15 years ago

Last modified 15 years ago

#866 closed enhancement (fixed)

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

Reported by: bennylp Owned by: bennylp
Priority: critical Milestone: release-1.4
Component: pjsua-lib Version: trunk
Keywords: sipit24 Cc: johan
Backport to 1.x milestone: Backported:

Description (last modified by bennylp)

Currently if STUN server is down, PJSUA-LIB initialization will fail. Having more than one STUN servers will increase the robustness of the application in this case.

Also it may be desirable to allow application startup to continue when STUN servers fail to be contacted. Some firewall with SIP ALG (notably Microsoft Forefront Threat Management Gateway) may decidedly block STUN traffic, since it can manipulate private address in SIP packet into public address.

Change History (7)

comment:1 Changed 15 years ago by bennylp

  • Keywords sipit24 added
  • Milestone changed from Sipit24 to release-1.3
  • Version changed from Sipit24 to trunk

comment:2 Changed 15 years ago by bennylp

  • Cc johan added
  • Priority changed from normal to critical

comment:3 Changed 15 years ago by bennylp

  • Milestone changed from release-1.3 to release-1.4

comment:4 Changed 15 years ago by bennylp

  • Description modified (diff)
  • Summary changed from Option to continue application startup without STUN to Allow application to specify more than one STUN servers for more robustness, and continue application startup if STUN resolution fails

comment:5 Changed 15 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

Done in r2864:

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
  • By default, PJSUA-LIB startup will continue even when STUN fails to be contacted. This behavior is configurable via the new pjsua_config.stun_ignore_failure setting (which by default is set to TRUE)
  • 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

comment:6 Changed 15 years ago by bennylp

Some test data for future reference:

  • --stun-srv stun.pjsip.org
  • --stun-srv stun.pjsip.org:3478
  • --stun-srv pjsip.org --nameserver 192.168.0.1
  • --stun-srv pjsip.org:3478 --nameserver 192.168.0.1
  • --stun-srv sip.pjsip.org --nameserver 192.168.0.1
  • --stun-srv sip.pjsip.org:3478 --nameserver 192.168.0.1
  • --stun-srv helloworld --stun-srv stun.pjsip.org
  • --stun-srv 192.168.0.2 --stun-srv stun.pjsip.org
  • --stun-srv 192.168.0.2 --stun-srv 192.168.0.3 --stun-srv stun.pjsip.org
  • --stun-srv helloworld --stun-srv stun.pjsip.org --nameserver 192.168.0.1
  • --stun-srv 208.109.222.137 --nameserver 192.168.0.1
  • --stun-srv 208.109.222.137:3478 --nameserver 192.168.0.1
  • --stun-srv stun.pjsip.org:12345 --stun-srv stun.pjsip.org:3478
  • --stun-srv helloworld --stun-srv 192.168.0.2


comment:7 Changed 15 years ago by nanang

In r2895:

  • Fixed compile error caused by implicit conversion from void* in test_stun_on_status().
Note: See TracTickets for help on using tickets.