Documentation: Updates for info about NAT-related settings and fixes for pjsip.conf.sample

Added another NAT example to pjsip.conf.sample. We had a few mentions of NAT configuration throughout the sample, but I added another for a little bit more clarity.

Additionally many pjsip options were affected by the change to snake case, so I fixed any instances of those options in pjsip.conf.

I regenerated the config option list (at the bottom of the file) from a new xml config doc dump, so all the snake case changes should be reflected there, as well as any other changes to those options.

(issue ASTERISK-23004)
(closes issue ASTERISK-23004)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/3086/
........

Merged revisions 404405 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
changes/97/197/1
Rusty Newton 12 years ago
parent efd7c40712
commit 06b577f7dc

@ -81,7 +81,7 @@
; ;
; For the NAT transport example, be aware that the options starting with ; For the NAT transport example, be aware that the options starting with
; the prefix "external_" will only apply to communication with addresses ; the prefix "external_" will only apply to communication with addresses
; outside the range set with "localnet=". ; outside the range set with "local_net=".
; ;
; IPv6: For endpoints using IPv6, remember to set "rtp_ipv6=yes" so that the RTP ; IPv6: For endpoints using IPv6, remember to set "rtp_ipv6=yes" so that the RTP
; engine will also be able to bind to an IPv6 address. ; engine will also be able to bind to an IPv6 address.
@ -102,7 +102,7 @@
;type=transport ;type=transport
;protocol=udp ;protocol=udp
;bind=0.0.0.0 ;bind=0.0.0.0
;localnet=192.0.2.0/24 ;local_net=192.0.2.0/24
;external_media_address=203.0.113.1 ;external_media_address=203.0.113.1
;external_signaling_address=203.0.113.1 ;external_signaling_address=203.0.113.1
@ -197,7 +197,7 @@
;context=from-external ;context=from-external
;disallow=all ;disallow=all
;allow=ulaw ;allow=ulaw
;outbound_auth=mytrunk ;outbound_auth=mytrunk_auth
;aors=mytrunk ;aors=mytrunk
; ;A few NAT relevant options that may come in handy. ; ;A few NAT relevant options that may come in handy.
;force_rport=yes ;It's a good idea to read the configuration help for each ;force_rport=yes ;It's a good idea to read the configuration help for each
@ -291,13 +291,13 @@
;aggregate_mwi=yes ;aggregate_mwi=yes
;mailboxes=6001@default,7001@default ;mailboxes=6001@default,7001@default
;mwifromuser=6001 ;mwi_from_user=6001
; ;
; Extension and Device state options ; Extension and Device state options
; ;
;devicestate_busy_at=1 ;device_state_busy_at=1
;allowsubscribe=yes ;allow_subscribe=yes
;subminexpiry=30 ;sub_min_expiry=30
;[6001] ;[6001]
;type=auth ;type=auth
@ -310,6 +310,49 @@
;max_contacts=1 ;max_contacts=1
;contact=sip:6001@192.0.2.1:5060 ;contact=sip:6001@192.0.2.1:5060
;===============ENDPOINT BEHIND NAT OR FIREWALL===============================
;
; This example assumes your transport is configured with a public IP and the
; endpoint itself is behind NAT and maybe a firewall, rather than having
; Asterisk behind NAT. For the sake of simplicity, we'll assume a typical
; VOIP phone. The most important settings to configure are:
;
; * direct_media, to ensure Asterisk stays in the media path
; * rtp_symmetric and force_rport options to help the far-end NAT/firewall
;
; Depending on the settings of your remote SIP device or NAT/firewall device
; you may have to experiment with a combination of these settings.
;
; If both Asterisk and the remote phones are a behind NAT/firewall then you'll
; have to make sure to use a transport with appropriate settings (as in the
; transport-udp-nat example).
;
;[6002]
;type=endpoint
;transport=transport-udp
;context=from-internal
;disallow=all
;allow=ulaw
;auth=6002
;aors=6002
;direct_media=no
;rtp_symmetric=yes
;force_rport=yes
;ice_support=yes ;This is specific to clients that support NAT traversal
;for media via ICE,STUN,TURN. See the wiki at:
;https://wiki.asterisk.org/wiki/x/D4FHAQ
;for a deeper explanation of this topic.
;[6002]
;type=auth
;auth_type=userpass
;password=6002
;username=6002
;[6002]
;type=aor
;max_contacts=2
;============EXAMPLE ACL CONFIGURATION========================================== ;============EXAMPLE ACL CONFIGURATION==========================================
; ;
@ -330,7 +373,7 @@
; ;
;[acl] ;[acl]
;type=acl ;type=acl
;contactacl=example_contact_acl1 ;contact_acl=example_contact_acl1
; Define your own ACL here in pjsip.conf and ; Define your own ACL here in pjsip.conf and
; permit or deny by IP address or range. ; permit or deny by IP address or range.
@ -346,10 +389,10 @@
; ;
;[acl] ;[acl]
;type=acl ;type=acl
;contactdeny=0.0.0.0/0.0.0.0 ;contact_deny=0.0.0.0/0.0.0.0
;contactpermit=209.16.236.0/24 ;contact_permit=209.16.236.0/24
;contactpermit=209.16.236.1 ;contact_permit=209.16.236.1
;contactpermit=209.16.236.2,209.16.236.3 ;contact_permit=209.16.236.2,209.16.236.3
; Restrict based on Contact Headers rather than IP and use ; Restrict based on Contact Headers rather than IP and use
; advanced syntax. Note the bang symbol used for "NOT", so we can deny ; advanced syntax. Note the bang symbol used for "NOT", so we can deny
@ -357,8 +400,8 @@
; ;
;[acl] ;[acl]
;type=acl ;type=acl
;contactdeny=0.0.0.0/0.0.0.0 ;contact_deny=0.0.0.0/0.0.0.0
;contactpermit=209.16.236.0 ;contact_permit=209.16.236.0
;permit=209.16.236.0/24, !209.16.236.12/32 ;permit=209.16.236.0/24, !209.16.236.12/32
@ -390,17 +433,19 @@
; "no") ; "no")
;disallow= ; Media Codec s to disallow (default: "") ;disallow= ; Media Codec s to disallow (default: "")
;dtmf_mode=rfc4733 ; DTMF mode (default: "rfc4733") ;dtmf_mode=rfc4733 ; DTMF mode (default: "rfc4733")
;external_media_address= ; IP used for External Media handling (default: ;media_address= ; IP address used in SDP for media handling (default: "")
; "")
;force_rport=yes ; Force use of return port (default: "yes") ;force_rport=yes ; Force use of return port (default: "yes")
;ice_support=no ; Enable the ICE mechanism to help traverse NAT (default: "no") ;ice_support=no ; Enable the ICE mechanism to help traverse NAT (default: "no")
;identify_by=username ; Way s for Endpoint to be identified (default: ;identify_by=username ; Way s for Endpoint to be identified (default:
; "username") ; "username")
;redirect_method=user ; How redirects received from an endpoint are handled
; (default: "user")
;mailboxes= ; Mailbox es to be associated with (default: "") ;mailboxes= ; Mailbox es to be associated with (default: "")
;moh_suggest=default ; Default Music On Hold class (default: "default") ;moh_suggest=default ; Default Music On Hold class (default: "default")
;outbound_auth= ; Authentication object used for outbound requests (default: ;outbound_auth= ; Authentication object used for outbound requests (default:
; "") ; "")
;outbound_proxy= ; Proxy through which to send requests (default: "") ;outbound_proxy= ; Proxy through which to send requests a full SIP URI
; must be provided (default: "")
;rewrite_contact=no ; Allow Contact header to be rewritten with the source ;rewrite_contact=no ; Allow Contact header to be rewritten with the source
; IP address port (default: "no") ; IP address port (default: "no")
;rtp_ipv6=no ; Allow use of IPv6 for RTP traffic (default: "no") ;rtp_ipv6=no ; Allow use of IPv6 for RTP traffic (default: "no")
@ -439,7 +484,8 @@
; to be returned as device state (default: "0") ; to be returned as device state (default: "0")
;t38_udptl=no ; Whether T 38 UDPTL support is enabled or not (default: "no") ;t38_udptl=no ; Whether T 38 UDPTL support is enabled or not (default: "no")
;t38_udptl_ec=none ; T 38 UDPTL error correction method (default: "none") ;t38_udptl_ec=none ; T 38 UDPTL error correction method (default: "none")
;t38_udptl_maxdatagram=0 ; T 38 UDPTL maximum datagram size (default: "0") ;t38_udptl_maxdatagram=0 ; T 38 UDPTL maximum datagram size (default:
; "0")
;fax_detect=no ; Whether CNG tone detection is enabled (default: "no") ;fax_detect=no ; Whether CNG tone detection is enabled (default: "no")
;t38_udptl_nat=no ; Whether NAT support is enabled on UDPTL sessions ;t38_udptl_nat=no ; Whether NAT support is enabled on UDPTL sessions
; (default: "no") ; (default: "no")
@ -469,19 +515,20 @@
;cos_video=0 ; Priority for video streams (default: "0") ;cos_video=0 ; Priority for video streams (default: "0")
;allow_subscribe=yes ; Determines if endpoint is allowed to initiate ;allow_subscribe=yes ; Determines if endpoint is allowed to initiate
; subscriptions with Asterisk (default: "yes") ; subscriptions with Asterisk (default: "yes")
;sub_min_expiry=0 ; The minimum allowed expiry time for subscriptions initiated ;sub_min_expiry=0 ; The minimum allowed expiry time for subscriptions
; by the endpoint (default: "0") ; initiated by the endpoint (default: "0")
;from_user= ; Username to use in From header for requests to this endpoint ;from_user= ; Username to use in From header for requests to this endpoint
; (default: "") ; (default: "")
;mwi_from_user= ; Username to use in From header for unsolicited MWI NOTIFYs to ;mwi_from_user= ; Username to use in From header for unsolicited MWI NOTIFYs to
; this endpoint (default: "") ; this endpoint (default: "")
;fromdomain= ; Domain to user in From header for requests to this endpoint ;from_domain= ; Domain to user in From header for requests to this endpoint
; (default: "") ; (default: "")
;dtls_verify= ; Verify that the provided peer certificate is valid (default: ;dtls_verify= ; Verify that the provided peer certificate is valid (default:
; "") ; "")
;dtls_rekey= ; Interval at which to renegotiate the TLS session and rekey ;dtls_rekey= ; Interval at which to renegotiate the TLS session and rekey
; the SRTP session (default: "") ; the SRTP session (default: "")
;dtls_cert_file= ; Path to certificate file to present to peer (default: "") ;dtls_cert_file= ; Path to certificate file to present to peer (default:
; "")
;dtls_private_key= ; Path to private key for certificate file (default: ;dtls_private_key= ; Path to private key for certificate file (default:
; "") ; "")
;dtls_cipher= ; Cipher to use for DTLS negotiation (default: "") ;dtls_cipher= ; Cipher to use for DTLS negotiation (default: "")
@ -502,7 +549,7 @@
; authentication config (default: "32") ; authentication config (default: "32")
;md5_cred= ; MD5 Hash used for authentication (default: "") ;md5_cred= ; MD5 Hash used for authentication (default: "")
;password= ; PlainText password used for authentication (default: "") ;password= ; PlainText password used for authentication (default: "")
;realm=asterisk ; SIP realm for endpoint (default: "asterisk") ;realm= ; SIP realm for endpoint (default: "")
;type= ; Must be auth (default: "") ;type= ; Must be auth (default: "")
;username= ; Username to use for account (default: "") ;username= ; Username to use for account (default: "")
@ -526,7 +573,7 @@
;cert_file= ; Certificate file for endpoint TLS ONLY (default: "") ;cert_file= ; Certificate file for endpoint TLS ONLY (default: "")
;cipher= ; Preferred Cryptography Cipher TLS ONLY (default: "") ;cipher= ; Preferred Cryptography Cipher TLS ONLY (default: "")
;domain= ; Domain the transport comes from (default: "") ;domain= ; Domain the transport comes from (default: "")
;external_media_address= ; External Address to use in RTP handling ;external_media_address= ; External IP address to use in RTP handling
; (default: "") ; (default: "")
;external_signaling_address= ; External address for SIP signalling (default: ;external_signaling_address= ; External address for SIP signalling (default:
; "") ; "")
@ -554,6 +601,8 @@
;uri= ; SIP URI to contact peer (default: "") ;uri= ; SIP URI to contact peer (default: "")
;expiration_time= ; Time to keep alive a contact (default: "") ;expiration_time= ; Time to keep alive a contact (default: "")
;qualify_frequency=0 ; Interval at which to qualify a contact (default: "0") ;qualify_frequency=0 ; Interval at which to qualify a contact (default: "0")
;outbound_proxy= ; Outbound proxy used when sending OPTIONS request
; (default: "")
;==========================AOR SECTION OPTIONS========================= ;==========================AOR SECTION OPTIONS=========================
@ -574,6 +623,8 @@
;qualify_frequency=0 ; Interval at which to qualify an AoR (default: "0") ;qualify_frequency=0 ; Interval at which to qualify an AoR (default: "0")
;authenticate_qualify=no ; Authenticates a qualify request if needed ;authenticate_qualify=no ; Authenticates a qualify request if needed
; (default: "no") ; (default: "no")
;outbound_proxy= ; Outbound proxy used when sending OPTIONS request
; (default: "")
;==========================SYSTEM SECTION OPTIONS========================= ;==========================SYSTEM SECTION OPTIONS=========================
@ -597,28 +648,37 @@
;==========================GLOBAL SECTION OPTIONS========================= ;==========================GLOBAL SECTION OPTIONS=========================
;[global] ;[global]
; SYNOPSIS: Options that apply globally to all SIP communications ; SYNOPSIS: Options that apply globally to all SIP communications
;max_forwards=70 ; Value used in Max Forwards header for SIP requests (default: ;max_forwards=70 ; Value used in Max Forwards header for SIP requests
; "70") ; (default: "70")
;type= ; Must be of type global (default: "") ;type= ; Must be of type global (default: "")
;user_agent= ; Value used in User Agent header for SIP requests and Server ;user_agent=Asterisk PBX SVN-branch-12-r404375 ; Value used in User Agent
; header for SIP responses (default: Populated by Asterisk ; header for SIP requests and
; Version) ; Server header for SIP
;default_outbound_endpoint= ; Endpoint to use when sending an outbound request ; responses (default: "Asterisk
; to a URI without a specified endpoint. ; PBX SVN-branch-12-r404375")
; (default: "default_outbound_endpoint") ;default_outbound_endpoint=default_outbound_endpoint ; Endpoint to use when
; sending an outbound
; request to a URI
; without a specified
; endpoint (default: "d
; efault_outbound_endpo
; int")
; MODULE PROVIDING BELOW SECTION(S): res_pjsip_acl ; MODULE PROVIDING BELOW SECTION(S): res_pjsip_acl
;==========================ACL SECTION OPTIONS========================= ;==========================ACL SECTION OPTIONS=========================
;[acl] ;[acl]
; SYNOPSIS: Access Control List ; SYNOPSIS: Access Control List
;acl= ; Name of IP ACL (default: "") ;acl= ; List of IP ACL section names in acl conf (default: "")
;contact_acl= ; Name of Contact ACL (default: "") ;contact_acl= ; List of Contact ACL section names in acl conf (default: "")
;contact_deny= ; List of Contact Header addresses to Deny (default: "") ;contact_deny= ; List of Contact header addresses to deny (default: "")
;contact_permit= ; List of Contact Header addresses to Permit (default: "") ;contact_permit= ; List of Contact header addresses to permit (default:
;deny= ; List of IP domains to deny access from (default: "") ; "")
;permit= ; List of IP domains to allow access from (default: "") ;deny= ; List of IP addresses to deny access from (default: "")
;type= ; Must be of type security (default: "") ;permit= ; List of IP addresses to permit access from (default: "")
;type= ; Must be of type acl (default: "")
@ -642,6 +702,8 @@
; "") ; "")
;retry_interval=60 ; Interval in seconds between retries if outbound ;retry_interval=60 ; Interval in seconds between retries if outbound
; registration is unsuccessful (default: "60") ; registration is unsuccessful (default: "60")
;forbidden_retry_interval=0 ; Interval used when receiving a 403 Forbidden
; response (default: "0")
;server_uri= ; SIP URI of the server to register against (default: "") ;server_uri= ; SIP URI of the server to register against (default: "")
;transport= ; Transport used for outbound authentication (default: "") ;transport= ; Transport used for outbound authentication (default: "")
;type= ; Must be of type registration (default: "") ;type= ; Must be of type registration (default: "")
@ -652,11 +714,7 @@
; MODULE PROVIDING BELOW SECTION(S): res_pjsip_endpoint_identifier_ip ; MODULE PROVIDING BELOW SECTION(S): res_pjsip_endpoint_identifier_ip
;==========================IDENTIFY SECTION OPTIONS========================= ;==========================IDENTIFY SECTION OPTIONS=========================
;[identify] ;[identify]
; SYNOPSIS: NEEDS A SYNOPSIS ; SYNOPSIS: Identifies endpoints via source IP address
;endpoint= ; Name of Endpoint (default: "") ;endpoint= ; Name of Endpoint (default: "")
;match= ; IP addresses or networks to match against (default: "") ;match= ; IP addresses or networks to match against (default: "")
;type= ; Must be of type identify (default: "") ;type= ; Must be of type identify (default: "")

Loading…
Cancel
Save