; ; SIP Configuration example for Asterisk ; ; 2005-12-18 jtodd@loligo.com v1.1 ; ; This is a SIP.edu version of the sip.conf file. It is greatly condensed, ; and assumes default values for many of the configuration options. If you ; would like to see the "full" file with all options and descriptions, it has ; been saved at "/etc/asterisk/sip.conf.orig" if you are running the install ; image which is all pre-configured. ; ; This config assumes that this Asterisk server will be located on a public IP ; address. There are ways to make this work through NAT, but they are complex ; and will cause much pulling of hair. See the complete configs for NAT ; direction if you dare, which are in the "stock" Asterisk sip.conf file. ; ; ** PLEASE READ ALL CONFIGURATIONS AND MODIFY TO SUIT ** ; ; [general] ; ; Default context in extensions.conf to send inbound calls from "remote" hosts ; if not specified in a specific peer statement below. ; context=from-internet ; ; Bind to SIP port 5060, and to all IP addresses on this system ; bindport=5060 bindaddr=0.0.0.0 ; ; ; When looking up outbound SIP destinations, use SRV records to determine the ; correct host to which to send invites. Many ISN records may result in URI's ; which look like "bob@other.edu" and then other.edu in turn has an SRV record ; for the destination. ; srvlookup=yes ; ; What domains does this system serve? If you are accepting calls for "bigu.edu" ; on this system via an SRV record, as well as accepting calls for the canonical ; name of "voip.bigu.edu", then add multiple lines for each domain. Also add a ; line for the IP address, just in case. ; ; ***** CHANGE THESE TO MATCH YOUR SITE ***** domain=bigu.edu domain=voip.bigu.edu domain=1.2.3.4 ; ; ; I leave this in place so that people who skip reading this file will at least ; have some small hope of completing a call. This adds the IP address and canonical ; hostname (if that gets changed!) to the domain= list. ; autodomain=yes ; ; Set the DiffServ Express Forwarding (EF) bits for both SIP signalling and RTP data. ; If you experience problems with this, set to "none" (without quotes) ; tos=0xB8 ; ; ; First, disallow all codecs, then allow only G.711 ulaw and G.711 alaw. This config ; actually has most other codecs deactivated, so permitting them in this list would ; lead to failed calls. The assumptions for the device on which this is running are ; very limited (Soekris 4801) so the codecs like iLBC and G.726 have been turned off. ; G.729 requires a commercial license from Digium, and G.723.1 isn't permitted at all. ; If you wish to use iLBC and G.726 etc., you'll need to comment out the "noload" lines ; in /etc/asterisk/modules.conf which refer to those functions and codecs. (Actually, ; you'll need to make the changes in /stat/etc/asterisk/modules.conf to make the changes ; "permanent" - don't forget to "mount -o rw,remount /" in order to write those files.) ; disallow=all allow=ulaw allow=alaw ; ; ; Sometimes you may need to "relax" the DTMF detection routines. Experiment with this ; setting if people can't access touch-tone based systems through this platform. ; ;relaxdtmf=yes ; ; Hang up on calls that have had no RTP packets in 60 seconds, and on held calls if ; no RTP for 300 seconds. ; rtptimeout=60 rtpholdtimeout=300 ; ; Set the User-Agent: string in SIP headers for debugging and sanity ; useragent=Asterisk 1.2.0 SIP.edu 20051125 ; ; Allow 302 redirects so that remote destinations can point you in the right direction in ; case of forwarding rules at the remote side. ; promiscredir=yes ; ; Set DTMF mode to "automatic" meaning use RFC2833 if the other side supports it, ; otherwise use inband. Since we're using exclusively G.711, inband isn't such ; a problem as it is otherwise. ; dtmfmode=auto ; ; ; ; Now, let's list some SIP peers. These are specific user agents/proxies to which ; we are sending/receiving calls from. These are not "devices" or "users", ; but remote systems which have fixed locations and services. There ; is really no difference between these and other SIP peer entries, but ; we use them in a different way so they are separate from other SIP peer ; entries. ; ; *****CHANGE THESE TO SUIT YOUR SITE IF YOU HAVE TELLO SERVICE***** ;[tello] ;type=friend ;username= ;secret= ;host=zcr.tello.com ;insecure=very ;context=from-internet ;qualify=4000 ; ; ; ; So, from here down we are specifying individual SIP endpoints, which ; typically are associated with "users" though not necessarily. ; ; The example user is commented out so as not to create a security risk. ; ; *****CHANGE OR ADD THESE TO MATCH USERS YOU MAY HAVE WITH SIP UA'S***** ; ; You can name the SIP peer whatever you want, but this name is what ; will be used in any Dial statements in extensions.conf. Using the ; username is suggested here. It is also possible to name SIP devices ; with the extension number, if you are going for an all-numeric ; plan. ; ;[thikita] ; ; This device will accept and create calls. ; ;type=friend ; ; Sure, let's support video if the device can send it. ; ;videosupport=true ; ; Send the equivalent of "pings" to the device every 60 seconds, so that ; we keep NAT translations open as well as so that if the device vanishes ; we can immediately disqualify it instead of waiting around until it's ; registration expires. ; ;qualify=3000 ; ; Accept registrations dynamically for this device from any IP address. ; ;host=dynamic ; ; Assume that the device is behind NAT. This may or may not ; break things if it is not behind NAT. Change to "no" ; if one-way audio happens. ; ;nat=yes ; ; To what context in extensions.conf should calls from this user ; get sent? This is going to be different than where we send calls ; from the "Internet", since we can trust clients with whom we ; have a username/password negotiation. ; ;context=from-sip-clients ; ; What is the username and password assocaited with this device? ; Typically, this matches the SIP peername, but might not. ; ;username=thikita ;secret=banizzle9 ; ; We "force" the From: identity to be what we think it should be, ; since trusting the software indications from the user is possibly ; a bad idea (otherwise you will notice calls from "Bullwinkle Moose" ; and other colorful names flowing around your network.) ; ;callerid="Toichi Hikita" ; ; We set an arbitrary variable (E164NUMBER) to equal the regular ; phone number for this user. We use this when we're sending ; calls from SIP to the PSTN, so we can associate the correct ; caller ID with the call on the outbound side. ; ;setvar=E164NUMBER=14159998123 ; ; ; end sip.conf