;==========================TRANSPORT SECTION OPTIONS=========================
[transport-udp]
type = transport
protocol = udp
bind = 0.0.0.0
;TOS of SIP signaling packets
tos = 0x68
cos = 3

[transport-tcp]
type = transport
protocol = tcp
bind = 0.0.0.0
;TOS of SIP signaling packets
tos = 0x68
cos = 3

;==========================SYSTEM SECTION OPTIONS=========================
[system]
type=system
; Timer t1 sets the timeout after which pjsip gives up on waiting for a response from
; the remote party.  The general rule is to set this to slightly higher than the round-trip
; time to the furthest remote party.  Although the default of 500ms is safe, this timer
; controls other timing aspects of the of the stack so reducing it is in your best interest.
; Unless you have a provider or remote phones with more than a 100ms RTT, setting this to
; 100ms (the minimum) is probably safe.  If you have outlier phones such as cell phones
; with VoIP clients, setting it to 250ms is probably safe.
timer_t1=100
 
; Timer B is technically the INVITE transaction timeout but it also controls other aspects
; of stack timing.  It's default is 32 seconds but its minimum is (64 * timer_t1) which
; would also be 32 seconds if timer_t1 were left at its default of 500ms.  Unfortunately,
; this timer has the side effect of controlling how long completed transactions are kept in
; memory so on a busy PBX, a setting of 32 seconds will probably result in higher than
; necessary memory utilization.  For most installations, 6400ms is fine.
timer_b=6400
						
; Sets the threadpool size at startup.
; Setting this higher can help Asterisk get through high startup loads
; such as when large numbers of phones are attempting to re-register or
; re-subscribe.
threadpool_initial_size=20
 
; When more threads are needed, how many should be created?
; Adding 5 at a time is probably safe.
threadpool_auto_increment=5
 
; Destroy idle threads after this timeout.
; Idle threads do have a memory overhead but it's slight as is the overhead of starting a new thread.
; However, starting and stopping threads frequently can cause memory fragmentation.  If the call volume
; is fairly consistent, this parameter is less important since threads will tend to get continuous
; activity.  In "spikey" situations, setting the timeout higher will decrease the probability
; of fragmentation.  Don't obsess over this setting.  Setting it to 2 minutes is probably safe
; for all PBX usage patterns.
threadpool_idle_timeout=120
 
; Set the maximum size of the pool.
; This is the most important settings.  Setting it too low will slow the transaction rate possibly
; causing timeouts on clients.  Setting it too high will use more memory, increase the chances of
; deadlocks and possibly cause other resources such as CPU and I/O to become exhausted.
; For a busy 8 core PBX, 100 is probably safe.  Setting this to 0 will allow the pool to grow
; as high as the system will allow.  This is probably not what you want. :)  Setting it to 500
; is also probably not what you want.  With that many threads, Asterisk will be thrashing and
; attempting to use more memory than can be allocated to a 32-bit process.  If memory starts
; increasing, lowering this value might actually help.
threadpool_max_size=100


;==========================GLOBAL SECTION OPTIONS=========================
[global]

;  SYNOPSIS: Options that apply globally to all SIP communications
;max_forwards=70        ; Value used in Max Forwards header for SIP requests
                        ; (default: "70")
type=  global; Must be of type global (default: "")
;user_agent=Asterisk PBX SVN-branch-12-r404375  ; Value used in User Agent
                                                ; header for SIP requests and
                                                ; Server header for SIP
                                                ; responses (default: "Asterisk
                                                ; PBX SVN-branch-12-r404375")
;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")
;debug=no ; Enable/Disable SIP debug logging.  Valid options include yes|no
          ; or a host address (default: "no")
;keep_alive_interval=20 ; The interval (in seconds) at which to send keepalive
                        ; messages on all active connection-oriented transports
                        ; (default: "0")
;contact_expiration_check_interval=30
                        ; The interval (in seconds) to check for expired contacts.
;disable_multi_domain=no
            ; Disable Multi Domain support.
            ; If disabled it can improve realtime performace by reducing
            ; number of database requsts
            ; (default: "no")

; The order by which endpoint identifiers are given priority.
; Currently, "ip", "username", "auth_username" and "anonymous" are valid
; identifiers as registered by the res_pjsip_endpoint_identifier_* modules.
; Some modules like res_pjsip_endpoint_identifier_user register more than
; one identifier. Use the CLI command "pjsip show identifiers" to see the
; identifiers currently available.
; (default: ip,username,anonymous)
; The default identifier order is ip,username,anonymous but for a PBX environment
; with lots of phones that register, identifying by ip address first is a waste of time.
; The order should be from the most likely to be used, to the least likely to be used
; which in this case would put username first for the phones, and ip second for providers.
endpoint_identifier_order=username,ip,anonymous			


;max_initial_qualify_time=4 ; The maximum amount of time (in seconds) from
                            ; startup that qualifies should be attempted on all
                            ; contacts.  If greater than the qualify_frequency
                            ; for an aor, qualify_frequency will be used instead.
;regcontext=sipregistrations  ; If regcontext is specified, Asterisk will dynamically
                              ; create and destroy a NoOp priority 1 extension for a
                              ; given endpoint who registers or unregisters with us.
                              ; The extension added is the name of the endpoint.
;default_voicemail_extension=asterisk
                   ; The voicemail extension to send in the NOTIFY Message-Account header
                   ; if not set on endpoint or aor.
                   ; (default: "")
;
; The following unidentified_request options are only used when "auth_username"
; matching is enabled in "endpoint_identifier_order".
;
;unidentified_request_count=5   ; The number of unidentified requests that can be
                                ; received from a single IP address in
                                ; unidentified_request_period seconds before a security
                                ; event is generated. (default: 5)
;unidentified_request_period=5  ; See above.  (default: 5 seconds)
;unidentified_request_prune_interval=30
                                ; The interval at which unidentified requests
                                ; are check to see if they can be pruned.  If they're
                                ; older than twice the unidentified_request_period,
                                ; they're pruned.
;
;default_from_user=asterisk     ; When Asterisk generates an outgoing SIP request, the
                                ; From header username will be set to this value if
                                ; there is no better option (such as CallerID or
                                ; endpoint/from_user) to be used
;default_realm=asterisk         ; When Asterisk generates a challenge, the realm will be
                                ; set to this value if there is no better option (such as
                                ; auth/realm) to be used

                    ; Asterisk Task Processor Queue Size
                    ; On heavy loaded system with DB storage you may need to increase
                    ; taskprocessor queue.
                    ; If the taskprocessor queue size reached high water level,
                    ; the alert is triggered.
                    ; If the alert is set the pjsip distibutor stops processing incoming
                    ; requests until the alert is cleared.
                    ; The alert is cleared when taskprocessor queue size drops to the
                    ; low water clear level.
                    ; The next options set taskprocessor queue levels for MWI.
;mwi_tps_queue_high=500 ; Taskprocessor high water alert trigger level.
;mwi_tps_queue_low=450  ; Taskprocessor low water clear alert level.
                    ; The default is -1 for 90% of high water level.

                    ; Unsolicited MWI
                    ; If there are endpoints configured with unsolicited MWI
                    ; then res_pjsip_mwi module tries to send MWI to all endpoints on startup.
;mwi_disable_initial_unsolicited=no ; Disable sending unsolicited mwi to all endpoints on startup.
                    ; If disabled then unsolicited mwi will start processing
                    ; on the endpoint's next contact update.

;ignore_uri_user_options=no ; Enable/Disable ignoring SIP URI user field options.
                    ; If you have this option enabled and there are semicolons
                    ; in the user field of a SIP URI then the field is truncated
                    ; at the first semicolon.  This effectively makes the semicolon
                    ; a non-usable character for PJSIP endpoint names, extensions,
                    ; and AORs.  This can be useful for improving compatability with
                    ; an ITSP that likes to use user options for whatever reason.
                    ; Example:
                    ; URI: "sip:1235557890;phone-context=national@x.x.x.x;user=phone"
                    ; The user field is "1235557890;phone-context=national"
                    ; Which becomes this: "1235557890"
                    ;
                    ; Note: The caller-id and redirecting number strings obtained
                    ; from incoming SIP URI user fields are always truncated at the
                    ; first semicolon.

					
;=============ENDPOINT CONFIGURED AS A TRUNK, INBOUND AUTH AND REGISTRATION===					
;slot ISDN 2 mediatrix 3532 PRI 2 pour sortir
[PRI_2_OUT]
type = aor
contact = sip:206.167.100.42:5063
max_contacts = 50

[PRI_2_OUT]
type = identify
endpoint = PRI_2_OUT
match = 206.167.100.42


[PRI_2_OUT]
type = auth
username = PRI_2_OUT
password = xOMhxoxoyAko25OrVOO8

[PRI_2_OUT]
transport=transport-udp
type = endpoint
context = TO_PRI_2
dtmf_mode = info
disallow = all
allow = ulaw
ice_support = no
direct_media = no
tos_audio = 0xB8
cos_audio = 6
auth = PRI_2_OUT
outbound_auth = PRI_2_OUT
aors = PRI_2_OUT
100rel = yes
fax_detect = yes
t38_udptl = yes
t38_udptl_maxdatagram = 400
disable_direct_media_on_nat = yes
callerid_privacy = allowed_not_screened
language = fr
tone_zone = us
