Суббота (11/28/09)

11:38:39
#egrep -v "^\;|^\ *$" /etc/asterisk/sip.conf
[general]
context=default                 ; Default context for incoming calls
allowoverlap=no                 ; Disable overlap dialing support. (Default is yes)
                                ; Default is enabled
                                ; defaults to "asterisk". If you set a system name in
                                ; asterisk.conf, it defaults to that system name
                                ; Realms MUST be globally unique according to RFC 3261
                                ; Set this to your host name or domain name
bindport=5060                   ; UDP Port to bind to (SIP standard port is 5060)
                                ; bindport is the local UDP port that Asterisk will listen on
bindaddr=0.0.0.0                ; IP address to bind to (0.0.0.0 binds to all)
srvlookup=yes                   ; Enable DNS SRV lookups on outbound calls
                                ; Note: Asterisk only uses the first host
                                ; in SRV records
                                ; Disabling DNS SRV lookups disables the
                                ; ability to place SIP calls based on domain
                                ; names to some other SIP users on the Internet
                                ; If configured, Asterisk will only allow
                                ; INVITE and REFER to non-local domains
                                ; Use "sip show domains" to list local domains
                                ; international character conversions in URIs
                                ; and multiline formatted headers for strict
                                ; SIP compatibility (defaults to "no")
                                ; and subscriptions (seconds)
                                ; Defaults to 100 ms
                                ; fully. Enable this option to not get error messages
                                ; when sending MWI to phones with this bug.
                                ; Message-Account in the MWI notify message
                                ; defaults to "asterisk"
                                ; This may also be set for individual users/peers
                                ; use 'never' to never use in-band signalling, even in cases
                                ; where some buggy devices might not render it
                                ; Valid values: yes, no, never Default: never
                                ; Note that promiscredir when redirects are made to the
                                ; local system will cause loops since Asterisk is incapable
                                ; of performing a "hairpin" call.
                                ; a valid phone number
                                ; Other options:
                                ; info : SIP INFO messages
                                ; inband : Inband audio (requires 64 kbit codec -alaw, ulaw)
                                ; auto : Use rfc2833 if offered, inband otherwise
                                ; in the this section to get any video support at all.
                                ; You can turn it off on a per peer basis if the general
                                ; video support is enabled, but you can't enable it for
                                ; one peer only without enabling in the general section.
                                ; Videosupport and maxcallbitrate is settable
                                ; for peers and users as well
                                ; performs events (e.g. hold)
                                ; for any reason, always reject with '401 Unauthorized'
                                ; instead of letting the requester know whether there was
                                ; a matching user or peer for their request
                                ; order instead of RFC3551 packing order (this is required
                                ; for Sipura and Grandstream ATAs, among others). This is
                                ; contrary to the RFC3551 specification, the peer _should_
                                ; be negotiating AAL2-G726-32 instead :-(
                                ; your localnet setting. Unless you have some sort of strange network
                                ; setup you will not need to enable this.
                                ; on the audio channel
                                ; when we're not on hold. This is to be able to hangup
                                ; a call in the case of a phone disappearing from the net,
                                ; like a powerloss or grandma tripping over a cable.
                                ; on the audio channel
                                ; when we're on hold (must be > rtptimeout)
                                ; (default is off - zero)
                                ; the moment the channel loads this configuration
                                ; (see sip history / sip no history)
                                ; SIP history is output to the DEBUG logging channel
                                ; Useful to limit subscriptions to local extensions
                                ; Settable per peer/user also
                                ; Turning on notifyringing and notifyhold will add a lot
                                ; more database transactions if you are using realtime.
                                ; status notification when you are using type=friend
                                ; Inbound calls, that really apply to the user part
                                ; of a friend will now be added to and compared with
                                ; the peer limit instead of applying two call limits,
                                ; one for the peer and one for the user.
                                ; "sip show inuse" will only show active calls on
                                ; the peer side of a "type=friend" object if this
                                ; setting is turned on.
                                ; 0 = continue forever, hammering the other server
                                ; until it accepts the registration
                                ; Default is 0 tries, continue forever
                                ; messages if we're behind a NAT
                                ; The externip and localnet is used
                                ; when registering and communicating with other proxies
                                ; that we're registered with
                                ; external host, and Asterisk will
                                ; perform DNS queries periodically.  Not
                                ; recommended for production
                                ; environments!  Use externip instead
                                ; used
                                ; You may add multiple local networks.  A reasonable
                                ; set of defaults are:
                                ; yes = Always ignore info and assume NAT
                                ; no = Use NAT mode only according to RFC3581 (;rport)
                                ; never = Never attempt NAT mode or RFC3581 support
                                ; route = Assume NAT, don't send rport
                                ; (work around more UNIDEN bugs)
                                ; RTP media stream (audio) to go directly from
                                ; the caller to the callee.  Some devices do not
                                ; support this (especially if one of them is behind a NAT).
                                ; The default setting is YES. If you have all clients
                                ; behind a NAT, or for some other reason wants Asterisk to
                                ; stay in the audio path, you may want to turn this off.
                                ; In Asterisk 1.4 this setting also affect direct RTP
                                ; at call setup (a new feature in 1.4 - setting up the
                                ; call directly between the endpoints instead of sending
                                ; a re-INVITE).
                                ; the call directly with media peer-2-peer without re-invites.
                                ; Will not work for video and cases where the callee sends
                                ; RTP payloads and fmtp headers in the 200 OK that does not match the
                                ; callers INVITE. This will also fail if canreinvite is enabled when
                                ; the device is actually behind NAT.
                                ; (reinvite) but only when the peer where the media is being
                                ; sent is known to not be behind a NAT (as the RTP core can
                                ; determine it based on the apparent IP address the media
                                ; arrives from).
                                ; instead of INVITE. This can be combined with 'nonat', as
                                ; 'canreinvite=update,nonat'. It implies 'yes'.
                                ; just like friends added from the config file only on a
                                ; as-needed basis? (yes|no)
                                ; Default= no
                                ; If set to yes, when a SIP UA registers successfully, the ip address,
                                ; the origination port, the registration period, and the username of
                                ; the UA will be set to database via realtime.
                                ; If not present, defaults to 'yes'.
                                ; as if it had just registered? (yes|no|<seconds>)
                                ; If set to yes, when the registration expires, the friend will
                                ; vanish from the configuration until requested again. If set
                                ; to an integer, friends expire within this number of seconds
                                ; instead of the registration interval.
                                ;
                                ; For non-realtime peers, when their registration expires, the
                                ; information will _not_ be removed from memory or the Asterisk database
                                ; if you attempt to place a call to the peer, the existing information
                                ; will be used in spite of it having expired
                                ;
                                ; For realtime peers, when the peer is retrieved from realtime storage,
                                ; the registration information will be used regardless of whether
                                ; it has expired or not; if it expires while the realtime peer
                                ; is still in memory (due to caching or other reasons), the
                                ; information will not be removed from realtime storage
                                ; Add domain and configure incoming context
                                ; for external calls to this domain
                                ; You can have several "domain" settings
                                ; Default is yes
                                ; name and local IP to domain list.
                                ; non-peers, use your primary domain "identity"
                                ; for From: headers instead of just your IP
                                ; address. This is to be polite and
                                ; it may be a mandatory requirement for some
                                ; destinations which do not have a prior
                                ; account relationship with your server.
                              ; SIP channel. Defaults to "no". An enabled jitterbuffer will
                              ; be used only if the sending side can create and the receiving
                              ; side can not accept jitter. The SIP channel can accept jitter,
                              ; thus a jitterbuffer on the receive SIP side will be used only
                              ; if it is forced and enabled.
                              ; channel. Defaults to "no".
                              ; resynchronized. Useful to improve the quality of the voice, with
                              ; big jumps in/broken timestamps, usually sent from exotic devices
                              ; and programs. Defaults to 1000.
                              ; channel. Two implementations are currently available - "fixed"
                              ; (with size always equals to jbmaxsize) and "adaptive" (with
                              ; variable size, actually the new jb of IAX2). Defaults to fixed.
[authentication]
                                        ; Call-limits will not be enforced on real-time peers,
                                        ; since they are not stored in-memory
                                        ; Also used as "defaultport" in combination with "defaultip" settings
                                ; on incoming calls to Asterisk
                                ; No registration allowed
                                ; from the phone to asterisk
                                ; 1 for the explicit peer, 1 for the explicit user,
                                ; remember that a friend equals 1 peer and 1 user in
                                ; memory
                                ; This will affect your subscriptions as well.
                                ; There is no combined call counter for a "friend"
                                ; so there's currently no way in sip.conf to limit
                                ; to one inbound or outbound call per phone. Use
                                ; the group counters in the dial plan for that.
                                ;
                                ; listed with allow= does NOT matter!
                                ; See doc/callingpres.txt for more information
[xlite1]
type=friend
regexten=2222
callerid="cherep" <1234>
host=dynamic                    ; This device needs to register
canreinvite=no                  ; Typically set to NO if behind NAT
disallow=all
allow=gsm                       ; GSM consumes far less bandwidth than ulaw
allow=ulaw
allow=alaw
                                ; subscribes for mailbox notification
                                ; sets the Message-Account in the MWI notify message
                                ; defaults to global vmexten which defaults to "asterisk"
                                ; Normally you do NOT need to set this parameter
                                ; matching port number
                                ; Helps with NAT session
                                ; qualify=yes uses default value
                                ; Send SIP and RTP to the IP address that packet is
                                ; received from instead of trusting SIP headers
                                ; RTP media stream (audio) to go directly from
                                ; the caller to the callee.  Some devices do not
                                ; support this (especially if one of them is
                                ; behind a NAT).
                                ; Normally you do NOT need to set this parameter
                                ; You must have this turned on or DTMF reception will work improperly.
                                ; if the nat option is enabled. If a single RTP packet is received Asterisk will know the
                                ; external IP address of the remote device. If port forwarding is done at the client side
                                ; then UDPTL will flow to the remote device.