Opened 12 years ago

Last modified 12 years ago

#1412 closed enhancement

Account specific NAT settings: STUN, ICE, and TURN — at Version 6

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-2.1
Component: pjsua-lib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by bennylp)

With #539 it is now possible to configure STUN, ICE, and TURN settings on per account basis. This is needed for example when application is supporting multiple accounts where one is connecting through Internet and the other is through VPN. The specification is as follows.

New STUN setting arrangements

The STUN server settings are still in the global pjsua_config. New settings are introduced in the account config to disable or enable STUN for either SIP or media transports: sip_stun_use and media_stun_use.

Rationale:
This simple arrangement is chosen over providing full STUN server settings in the account config, i.e. having the list of servers in the account config as well as in the global config. There are several difficulties with the complex approach:
  • The STUN servers in the account will need to be rechecked, and this most likely will need to block the pjsua_acc_add().
  • We need the STUN server when creating SIP UDP transport. Which STUN server to use? We definitely cannot use account's STUN server(s), because account is created later! Hence we need to provide yet another list of STUN servers in the transport config, and possibly need to recheck them too.

ICE and TURN settings per account

ICE and TURN configurations will be added to account config with the default values values taken from the global media config. Media transport creation will look for the value in account config.

Contact header generation

The initial value of Contact header will take into account whether STUN is enabled or disabled in the account. If it is disabled, local IP will be used.

Subsequent update to the Contact header doesn't change.

Via sent-by generation

Initial Via sent-by value now will be affected by STUN setting. Subsequent update of the value doesn't change; it follows the rules in #1537.

For UDP, the Via sent-by value would also use the correct interface on which the request will be sent, except if the destination is a host name which in this case the default interface will be used.

No change for TCP; the correct IP has already been displayed in the Via sent-by.

Media transports

STUN, ICE, and TURN setup of the media transports now will follow the account config settings instead.

Change History (6)

comment:1 Changed 12 years ago by bennylp

  • Backported unset
  • Type changed from defect to enhancement

comment:2 Changed 12 years ago by bennylp

  • Description modified (diff)
  • Milestone changed from release-2.x to release-2.1

comment:3 Changed 12 years ago by bennylp

  • Summary changed from Add media transport preferences (STUN, ICE settings) to account setting (thanks Régis Montoya for the suggestion) to Add transport preferences (STUN, ICE settings) to account setting (thanks Régis Montoya for the suggestion)

comment:4 Changed 12 years ago by bennylp

  • Description modified (diff)

comment:5 Changed 12 years ago by bennylp

  • Description modified (diff)

comment:6 Changed 12 years ago by bennylp

  • Description modified (diff)
  • Summary changed from Add transport preferences (STUN, ICE settings) to account setting (thanks Régis Montoya for the suggestion) to Account specific NAT settings: STUN, ICE, and TURN
Note: See TracTickets for help on using tickets.