You are on page 1of 20

MENU

S earch....
LOGIN | REGIST ER

View

Discussion (18)

Hist ory

A st er isk con g sip .con f


T ap he re to co mp are the to p Vo IP
p ro vid e rs

Page Contents
Ast erisk as a SIP client
Example:
Anot her example
SIP Configurat ion - general
SIP configurat ions - peers and client s
Not es
Examples
Peer/User Sect ions
Not es
Using Ast erisk t oget her wit h SER
Using Ast erisk t oget her wit h OpenSER
Cont rolling sip.conf from out side
Version not es
See also
Configurat ion file for Ast erisk SIP channels, for bot h inbound and out bound calls.
St art ing wit h Ast erisk v1.2.0: T he global opt ion "port " in 1.0.X t hat is used t o set which port t o bind
t o has been changed t o "bindpo rt " t o be more consist ent wit h t he ot her channel drivers and t o
avoid confusion wit h t he "port " opt ion for users/peers.

St art ing wit h Ast erisk v1.6.0: T he previously deprecat ed opt ions "insecure=very" and "insecure=yes"
have now been removed. "insecure=invit e,port " is t he equivalent of "insecure=very"

[tammari]
type=friend
callerid="Tuomas Tammisalo" <1000>
username=tammari
host=dynamic
secret=********
regcontext=tammari-internal
regexten=1005
dtmfmode=rfc2833
insecure=invite,port
canreinvite=yes
nat=yes
qualify=yes
context=merus-sipphone
pickupgroup=1
callgroup=1
mailbox=1000@ default

A st er isk as a S I P clien t
In sip.conf under [general] add a re gis t e r definit ion:
Format :
regist er => user[:secret [:aut huser]]@host [:port ][/ext ension]
or
regist er => fromuser@fromdomain:secret @host
or
regist er => fromuser@fromdomain:secret :aut huser@host :port /ext ension
See also: bug 14367 wit h a document at ion fix for 1.6.
If you have problems wit h your net work connect ion going up and down (e.g. an unreliable cable
connect ion) and you keep losing your sip regist ry, you may want t o add re gis t e ra t t e m pt s and
re gis t e rt im e o ut set t ings t o t he general sect ion above t he regist er definit ions. Set t ing
re gis t e ra t t e m pt s =0 will force Ast erisk t o at t empt t o reregist er unt il it can (t he default is 10
t ries). re gis t e rt im e o ut set s t he lengt h of t ime in seconds bet ween regist rat ion at t empt s (t he
default is 20 seconds).
In case of DynDNS issues, for example wit h myast erisk.dyndns.org changing it s IP, you might want
t o consider t aking a look at ddclient t o aut omat e a "sip reload" in t he CLI.

P.S. Not e for sipgat e.co.uk users: /ext ension must be your sipgat e number (t his is not t rue; I am
using "99" --jrc) - define one t o accept t his in your ext ensions.conf. An alt ernat e port does not seem
t o work wit h sipgat e.co.uk unless it is defined as t he bindport in sip.conf wit hout t he [:port ] synt ax.

E x ampl e :

; Register 2345@ mysipprovider.com with authname 2345 at mysipprovider.com at sip prov


register => 2345:password@ mysipprovider.com/1234

; Register 1235@ mysipprovider.com with authname 1235 and realm mysipprovider.com at p


; (as needed by budgetphone.nl):
register => 1235@ mysipprovider.com:password:1235@ proxyof.mysipprovider.com

user is t he user id for t his SIP server (ex 2345)


aut huser is t he opt ional aut horizat ion user for t he SIP server
sec ret is t he user's password
host is t he domain or host name for t he SIP server. This SIP server needs a definit ion in
a sect ion of it s own in SIP.conf (mysipprovider.com).
port send t he regist er request t o t his port at host . Default s t o 5060
/1234 is t he Ast erisk cont act ext ension. 1234 is put int o t he cont act header in t he
SIP Regist er message. The cont act ext ension is used by remot e SIP server when it
needs t o send a call t o Ast erisk. See t he example below. The default cont ext
ext ension is "s".

Agreed, it 's not very good t o have a lot of cleart ext passwords in t his t ext file, but t hat 's how it
works now.
You only need t o regist er if a) you want t o be called, and b) you appear t o t he ot her side as having a
dynamic IP address. Check t he success of your own server's regist rat ions at t he CLI wit h "SIP SHOW
REGIST RY", whereas you can obt ain a list of client s t hat regist ered wit h your server wit h t he help of
"SIP SHOW PEERS". You may examine all det ails of a peer's regist rat ion wit h "SIP SHOW PEER
<NAME>". Ent er "HELP SIP" at t he CLI for addit ional commands.
T he server definit ion for out going calls looks like t his:
[mysipprovider-out ]
t ype=peer
secret =password
username=2345
host =sipserver.mysipprovider.com
fromuser=2345
fromdomain=fwd.pulver.com
canreinvit e=no

insecure=invit e,port
qualify=yes
nat =yes
cont ext =from-mysipprovider ; t his sect ion will be defined in ext ensions.conf
In ext ensions.conf you'd t hen use a st at ement like t his:
ext en => _ 9.,1,Dial(SIP/${EXT EN:1}@mysipprovider-out ,30,r)
Please not e t hat t he ${EXT EN:1} variable here ext ract s all but t he first charact ers from t he current
ext ension (t he current mat ch), in t his case: 9 + t he following digit s. Refer t o t he Ast erisk variables
Subst rings sect ion for more det ails
Here is t he sect ion(in ext ensions.conf) which rout es calls from our sip provider t o where we decide:
[from-mysipprovider]
ext en => 1234,1,Answer ; 1234 is t he cont act ext ension, default cont act ext ension is "s"
ext en => 1234,2,Dial(SIP/111,25,T t r) ; incoming calls are redirect ed t o SIP t elephone wit h number
111
ext en => 1234,3,Hangup

A n ot h er exam p le

[general]
context = (own_context in extensions.conf where recive the call )
realm = real.com
bindport=5060
srvlookup=yes
disallow=all
allow=ulaw
allow=gsm
language=en
trustrpid = yes
sendrpid = yes
register => fromuser@ fromdomain:secret@ host
register => XXXX@ YYYY.com:AAAA@ IP
[my_provider]
type=peer
fromuser=XXXX
fromdomain=YYYY.com
canreinvite=no
secret=AAAAA
insecure=invite,port
host= IP
disallow=all
allow=gsm
allow=ulaw
allow=alaw
qualify=yes
nat=no

Out bound call in ext ensions.conf


exten => _X.,1,Dial(SIP/${EXTEN}@ my_provider)

S I P C o n gur at i o n - ge ne r al
T he [general] sect ion of sip.conf includes t he following variables:

allowsubsc ribe = yes|no : Allow or Ignore Subscribe request s


allow = <codec> : Allow codecs in order of preference (Use DISALLOW=ALL first ,
before allowing ot her codecs)
disallow = all : Disallow all codecs (global configurat ion)

Ast erisk sip allowext ernaldomains = yes|no : Enable/Disable INVITE and REFER t o
non- local domains. Default yes . (New in v1.2.x).
allowguest = yes|no : Allow or reject guest calls. Default is yes . (t his can also be set
t o 'osp' if ast erisk was compiled wit h OSP support ). (New in v1.2.x).
Ast erisk sip allowoverlap = yes|no : Enable/disable overlap dialing support . Default
yes (Overlap dial provides for a longer t ime- out period bet ween digit s, also called t he
int er- digit t imer. Wit h overlap dial set t o off, t he gat eway expect s t o receive t he digit s
one right aft er t he ot her coming in t o t his line wit h very lit t le delay bet ween digit s. Wit h
overlap dial set t o on, t hen t he device wait s up t o about 2 seconds bet ween digit s).
aut oc reat epeer = yes|no : If set , anyone will be able t o log in as a peer (wit h no check
of credent ials; useful for operat ion wit h SER). Default no .
Ast erisk sip aut odomain = yes|no : Enable/disable Ast erisk's abilit y t o add local
host names and local IP address t o t he domain list . ext ernip or ext ernhost are also t aken
int o t he domain list . Default no . (New in v1.2.x).
bindaddr = IP_ Address : IP Address t o bind t o (list en on). Default 0.0.0.0 (all net work
int erfaces).
bindport = Number : UDP Port t o bind t o (list en on). Used t o be port in Ast erisk v1.0.x.
Default 5060 .
c allerid = <st ring> : Caller ID informat ion used when not hing else is available. Default s
t o ast erisk . (The abilit y t o override t he default appears t o available in Ast erisk 1.0.9.
Unsure about ot her versions.)
c anreinvit e = updat e|yes|no|nonat (global set t ing): For some reason t his default s t o
yes , so beware...
Ast erisk sip c hec kmwi = Number : Global int erval (in seconds) bet ween mailbox
checks. Default 10 seconds. (New in v1.2.x)
Ast erisk sip c ompac t headers = yes|no : Indicat es Ast erisk should send compact
(i.e. abbreviat ed) headers in t he SIP messages. Default no . (New in v1.2.x)
c ont ext = <cont ext name> : This is t he default cont ext and is used when a endpoint
has no cont ext propert y. The cont ext in sect ion of an endpoint is used t o rout e calls
f rom t hat endpoint t o t he want ed dest inat ion. The cont ext body is locat ed in
ext ensions.conf.
def ault expiry = Number : Default durat ion (in seconds) of incoming/out going
regist rat ion. Default 120 seconds.
domain = domains : Comma separat ed list of domains which Ast erisk is responsible for.
(New in Ast erisk 1.2.x)
dt mf mode = inband|info|rfc2833 (global set t ing). Default rf c 2833 . Warning: inband
very high CPU load.
dumphist ory = yes|no : Enable support for dumping of SIP conversat ion's t ransact ion
hist ory t o LOG_ DEBUG. Default no . (New in v1.2.x)

ext ernip = IP_ Address or a host name : Address t hat we're going t o put in SIP
messages if we're behind a NAT. If a host name is used as t he value, t hen t he IP address
associat ed wit h t he host name is looked up only once during t he reading of t he sip.conf.
If you want support for a host name associat ed wit h a dynamic IP address, use Ast erisk
sip ext ernhost .
ext ernhost = host name.t ld : (New in Ast erisk 1.2.x)
ext ernref resh = Number : Specify how oft en (in seconds) a host name DNS lookup
should be performed for t he value ent ered in 'ext ernhost '. Default 10 seconds. (New in
Ast erisk 1.2.x).
f romdomain = <domain> : Set s default From: domain in SIP messages when act ing as
a SIP UAC (client )
ignoreregexpire = yes|no : Indicat es whet her t o use Cont act informat ion about a peer
even if t he informat ion is st ale because it has reached it s expirat ion t ime. Default no .
(New in v1.2.x)
jbenable = yes|no : Enables t he use of a jit t erbuffer on t he receiving side of a SIP
channel. (Added in Version 1.4)
jbf orc e = yes|no : Forces t he use of a jit t erbuffer on t he receive side of a SIP channel.
Default s t o "no". (Added in Version 1.4)
jbmaxsiz e = Number : Max lengt h of t he jit t erbuffer in milliseconds. (Added in Version
1.4)
jbresync t hreshold = Number : Jump in t he frame t imest amps over which t he
jit t erbuffer is resynchronized. Useful t o improve t he qualit y of t he voice, wit h big jumps
in/broken t imest amps, usually sent from exot ic devices and programs. Default s t o
1000. (Added in Version 1.4)
jbimpl = fixed|adapt ive: Jit t erbuffer implement at ion, used on t he receiving side of a
SIP channel. Two implement at ions are current ly available - "fixed" (wit h size always
equals t o jbmaxsize) and "adapt ive" (wit h variable size, act ually t he new jb of IAX2).
Default s t o fixed. (Added in Version 1.4)
jblog = no|yes: Enables jit t erbuffer frame logging. Default s t o "no". (Added in Version
1.4)
language = <st ring> : Default language used by any Playback()/Background().
limit onpeers = yes|no: If set t o yes use only t he peer call count er for bot h incoming
and out going calls (ref. hint s, subscript ions, BLF; added in 1.4)
loc alnet = Net Address/Net mask : local net work and mask.
insec ure = very|yes|no|invit e|port : Specifies how t o handle connect ions wit h peers.
Default no (aut hent icat e all connect ions). invit e and port added in v1.2.x, yes and
very removed in v1.6.x, possible t o use mult iple opt ions separat ed by commas from
v1.4.x
maxexpiry = Number : Max durat ion (in seconds) of incoming regist rat ion we allow.

Default 3600 seconds.


music c lass = one of t he classes specified in musiconhold.conf
musdic onhold = same as musicclass
nat = yes|no : Please not e t hat as of Ast erisk 1.0.x nat can now have t he values:
yes|no|never|rout e. Default no which really means t o use rfc3581 t echniques.
not if ymimet ype = mediat ype/subt ype : Allow overriding of mime t ype in MWI NOTIFY
used in voicemail online messages. Valid MIME t ypes can be found here. Default
applic at ion/simple- message- summary . (New in v1.2.x).
not if yringing = yes|no : Not ify subscript ion on RINGING st at e. Default yes . (New in
v1.2.x).
out boundproxy = IP_ address or DNS SRV name (excluding t he _ sip._ udp prefix) : SRV
name, host name, or IP address of t he out bound SIP Proxy. (New in v1.2.x).
out boundproxyport = Number : UDP port number for t he Out bound SIP Proxy. (New in
v1.2.x).
pedant ic = yes|no : Enable slow, pedant ic checking of Call- ID:s, mult iline SIP headers
and URI- encoded headers. Default no (in Ast erisk 1.8 default yes ).
port = <port no> : Default SIP port of peer. (t his is not t he port for Ast erisk t o list en.
See bindport ).
progressinband = never|no|yes : If we should generat e in- band ringing always. Default
never .
promisc redir = yes|no : Allows support for 302 Redirect s; (Not e: will redirect t hem all
t o t he local ext ension ret urned in Cont act rat her t han t o t hat ext ension at t he
dest inat ion). Default no .
qualif y = yes|no|milliseconds : Check if client is reachable. If yes , t he checks occur
every 60 seconds. Default no .
realm = my realm (Change aut hent icat ion realm from ast erisk (default ) t o your own.
Requires Ast erisk v1.x)
rec ordhist ory = yes|no. Enable logging of SIP conversat ion's t ransact ion hist ory.
Default no . (New in v1.2.x).
regc ont ext = cont ext : Default cont ext t o use for SIP REGISTER replies from t he SIP
Regist rar.
regist er => <username>:<password>:[aut hid]@<sip client /peer id in
sip.conf>/<cont act > :Regist er wit h a SIP provider
regist erat t empt s = Number : Number of SIP REGISTER messages t o send t o a SIP
Regist rar before giving up. Default 0 (no limit ). (New in v1.2.x).
regist ert imeout = Number : Number of seconds t o wait for a response from a SIP
Regist rar before classifying t he SIP REGISTER has t imed out . Default 20 seconds.
(New in v1.2.x).
relaxdt mf = yes|no: Default no .

rt aut oc lear = yes|no|number : Aut o- Expire friends creat ed on t he fly. If yes t he


aut oexpire will be in 120 seconds. Default yes . (New in v1.2.x). Buggy up t o 1.4.19, see
bug 12707
rt c ac hef riends = yes|no : Cache realt ime friends by adding t hem t o t he int ernal list
just like friends added from t he config file. Default no . (New in v1.2.x). Buggy up t o
1.4.19, see bug 12707
rt savesysname = yes|no : If set will writ e t he value of ast erisk.conf (opt ions)
syst emname t o t he sip peer t able in t he field "regserver". Useful for mult i- server
syst ems. (New in v1.?)
rt pholdt imeout = Number : Max number of seconds of inact ivit y before t erminat ing a
call on hold. Default 0 (no limit ). (New in v1.2.x).
rt pkeepalive = Number : Number of seconds, when a RTP Keepalive packet will be
sent if no ot her RTP t raffic on t hat connect ion. Default 0 (no RTP Keepalive). (New in
v1.2.x).
rt pt imeout = Number : Number of seconds, t o wait for RTP t raffic before classify t he
connect ion as discont inued. Default 0 (no RTP t imeout ). (New in v1.2.x).
rt updat e = yes|no : Send regist ry updat es t o t he dat abase when using Realt ime
support . Default yes . (New in v1.2.x).
sendrpid = yes|no : If a Remot e- Part y- ID SIP header should be sent . Default no .
sipdebug = yes|no. Default set t ing for whet her SIP debug is enabled upon loading of
t he sip.conf. Default no . (New in v1.2.x).
srvlookup = yes|no : Enable DNS SRV lookups on calls. Default yes . (Default is no prior
t o v1.4.14)
t os = <value> : Set IP QoS paramet ers for out going media st reams (numeric values are
also accept ed, like t os=184 )
t rust rpid = yes|no : If Remot e- Part y- ID SIP header should be t rust ed. Default no .
usec lient c ode = yes|no : If yes , t hen t he Call Originat or as st at ed in t he CDR will be
changed t o what ever is specified in a X- Client Code SIP Header. Default no . (New in
v1.2.x)
usereqphone = yes|no : Indicat es whet her t o add a ";user=phone" t o t he URI. Default
no . (New in v1.2.x)
useragent = <st ring> : Allow t he SIP header "User- Agent " t o be cust omized. Default
ast erisk .
videosupport = yes|no : Turn on support for SIP video (peer specific set t ing added in
SVN Dec 21 2005, bug 5427. Default no .
vmext en = <st ring> : Dialplan ext ension t o reach mailbox. Default ast erisk . (New in
v1.2.x)
c allevent s = yes|no: Set t o yes t o receive event s on AMI when a call is put on/off
hold.

disallowed_ met hods = (1.8.x) When a dialog is st art ed wit h anot her SIP endpoint , t he
ot her endpoint should include an Allow header t elling us what SIP met hods t he endpoint
implement s. However, some endpoint s eit her do not include an Allow header or lie about
what met hods t hey implement . In t he former case, Ast erisk makes t he assumpt ion t hat
t he endpoint support s all known SIP met hods. If you know t hat your SIP endpoint does
not provide support for a specific met hod, t hen you may provide a comma- separat ed
list of met hods t hat your endpoint does not implement in t he disallowed_ met hods
opt ion. Not e t hat if your endpoint is t rut hful wit h it s Allow header, t hen t here is no need
t o set t his opt ion. This opt ion may be set in t he general sect ion or may be set per
endpoint . If t his opt ion is set bot h in t he general sect ion and in a peer sect ion, t hen t he
peer set t ing complet ely overrides t he general set t ing (i.e. t he result is *not * t he union
of t he t wo opt ions). Not e also t hat while Ast erisk current ly will parse an Allow header t o
learn what met hods an endpoint support s, t he only act ual use for t his current ly is for
det ermining if Ast erisk may send connect ed line UPDATE request s. It s use may be
expanded in t he fut ure.
pref erred_ c odec _ only = (1.8.x) Respond t o a SIP invit e wit h t he single most
preferred codec rat her t han advert ising all joint codec capabilit ies. This limit s t he ot her
side's codec choice t o exact ly what we prefer.
engine = (1.8.x) RTP engine t o use when communicat ing wit h t he device

S I P c o n gur at i o ns - pe e r s and c l i e nt s
T hese variables can be configured for each SIP peer definit ion:

(If not specified, t he configurat ion variable can be used for bot h t ype=peer and t ype=user.)

ac c ount c ode = <st ring> : Users may be associat ed wit h an account code. See
Ast erisk billing
allow = <codec> : Allow codecs in order of preference (Use DISALLOW=ALL first ,
before allowing ot her codecs)
disallow = all : Disallow all codecs for t his peer or user definit ion.
allowguest = yes|no : Allow or reject guest calls (default is yes , t his can also be set t o
'osp' if ast erisk was compiled wit h OSP support ). (New in v1.2.x).
amaf lags : Cat egorizat ion for CDR records. Choices are default , omit , billing,
document at ion. See Ast erisk billing
ast db : Appears t o insert a value in t he Ast erisk dat abase. See example below.
aut h = <aut hname> : Value assigned t o t he Digest username= SIP header.
c allerid = <st ring> : Caller ID informat ion used when not hing else is available. Default s
t o ast erisk .
busylevel = number : Number of simult aneous calls unt il user/peer is busy
c all- limit = number : Number of simult aneous calls t hrough t his user/peer.

c allgroup = num1,num2- num3 : Defines call groups for calls t o t his device.
c allingpres = number|descript ive_ t ext : Set Caller- ID present at ion on a call. Valid
descript ive values are: allowed_ not _ screened, allowed_ passed_ screen,
allowed_ failed_ screen, allowed, prohib_ not _ screened, prohib_ passed_ screen,
prohib_ failed_ screen, prohib, and unavailable. See Set CallerPres for more informat ion.
Default allowed_ not _ sc reened .
c anreinvit e = updat e|yes|no|nonat : If t he client is able t o support SIP re- invit es.
Default yes .
c id_ number = <st ring> : On incoming (t hrough t his peer) calls set s t he out bound
$CALLERID(num) t o <st ring>. (New in v.1.4.x)
c ont ext = <cont ext _ name> : If t ype=user, t he Cont ext for t he inbound call from t his
SIP user definit ion. If t ype=peer, t he Cont ext in t he dialplan for out bound calls from t his
SIP peer definit ion. If t ype=friend t he cont ext used for bot h inbound and out bound
calls t hrough t he SIP ent it ies definit ion. If no t ype=user ent ry mat ches an inbound call,
t hen a t ype=peer or t ype=friend will mat ch if t he host name or IP address defined in
host = mat ches.
def ault ip = Dot t ed.Quad.IP.Addr : Default IP address of client if host =dynamic is
specified. Used if client has not regist ered at any ot her IP address. Valid only for
t ype=peer .
def ault user = The new name for t he 'username' variable.
direc t rt pset up = yes|no: Similar t o canreinvit e, but right away passes media t o t he
ot her part y like a SIP proxy
dt mf mode = inband|info|rfc2833 : How t he client handles DTMF signalling. Default
rf c 2833 . Warning: inband very high CPU load.
f romuser = <from_ ID> : Specify user t o put in "from" inst ead of $CALLERID(number)
(overrides t he callerid) when placing calls _ t o_ peer (anot her SIP proxy). Valid only for
t ype=peer .
f romdomain = <domain> : Set s default From: domain in SIP messages when placing
calls _ t o_ peer. Valid only when in [general] sect ion or t ype=peer .
f ullc ont ac t = <sip:uri_ cont act > : SIP URI cont act for realt ime peer. Valid only for
realt ime peers.
f ullname = "Full Name" : Set s out bound $CALLERID(name). (New in v1.4.x)
host = dynamic|host name|IPAddr : How t o find t he client - IP # or host name. If you
want t he phone t o regist er it self, use t he keyword dynamic inst ead of Host IP.
inc ominglimit and out goinglimit = Number : Limit s for number of simult aneous
act ive calls for a SIP client . Valid only for t ype=peer .
insec ure : very|yes|no|invit e|port : Specifies how t o handle connect ions wit h peers.
Default no (aut hent icat e all connect ions). invit e and port added in v1.2.x, yes and
very removed in v1.6.x, possible t o use mult iple opt ions separat ed by commas from

v1.4.x
ipaddr : Dot t ed Quad IP address of t he peer. Valid only for realt ime peers.
language : A language code defined in indicat ions.conf - defines language for prompt s
mailbox = mailbox : Voicemail ext ension (for message wait ing indicat ions). Valid only
for t ype=peer . Edit : also valid for t ype=f riend (verified wit h 1.4.22.1).
md5sec ret : MD5- Hash of "<user>:==SIP_ realm==:<secret >" (can be used inst ead of
secret ). Default for aut hent icat ing t o an Ast erisk server when SIP realm is not explicit ly
declared is "<user>:ast erisk:<secret >".
music c lass = one of t he classes specified in musiconhold.conf
music onhold = Set class of musiconhold on calls from SIP phone. Calls t o t he phone
require Set MusicOnHold cmd of higher priorit y (lower numerical value of priorit y) t han
Dial cmd in dialplan in order t o set t his class for t he call. Calls have t he MusicOnHold
class set on a per call basis, not on a per phone basis, and making a call t hrough any
ext ension specifying Set MusicOnHold will override t his value for t he call.
subsc ribemwi: Inst ruct s Ast erisk t o not send NOTIFY messages for message wait ing
indicat ion (added in v1.4)
name = <name> : Name of t he realt ime peer. If t he peer is an act ual phone t hen t his will
generally be t he ext ension number of t hat phone. On some soft phones t his field
corresponds t o t he "username" field/opt ion in t he soft phone's set t ings. Valid only for
realt ime peers.
nat = yes|no : This variable changes t he behaviour of Ast erisk for client s behind a
firewall. This does not solve t he problem if Ast erisk is behind t he firewall and t he client
on t he out side. Please not e t hat Ast erisk 1.0.x nat can now have t he values:
yes |no |never |rout e ; Ast erisk 1.8 can have t he values: yes |no |f orc e_ rport |c omedia.
Default no which really means t o use rfc3581 t echniques.
out boundproxy = IP_ address or DNS SRV name (excluding t he _ sip._ udp prefix) : SRV
name, host name, or IP address of t he out bound SIP Proxy. Valid only in [general] sect ion
and t ype=peer . (New in v1.2.x).
permit , deny,mask : IP address and net work rest rict ion
pic kupgroup : Group t hat can pickup fellow workers' calls using *8 and t he Pickup()
applicat ion on t he *8 ext ension
port : SIP port of t he client
progressinband = never|no|yes : If we should generat e in- band ringing always. Default
never .
promisc redir = yes|no : Allows support for 302 Redirect s; (Not e: will redirect t hem all
t o t he local ext ension ret urned in Cont act rat her t han t o t hat ext ension at t he
dest inat ion). Default no .
qualif y = yes|no|milliseconds : Check if client is reachable. If yes , t he checks occur
every 60 seconds. Valid only in [general] sect ion and t ype=peer .

regext en =
regsec onds = seconds : Number of seconds bet ween SIP REGISTER. Valid only for
realt ime peer ent ries.
rest ric t c id : (yes/no) To have t he callerid rest rict ed - > sent as ANI; use t his t o hide
t he caller ID. This does not seem t o work. This variable has been deprecat ed as of
v1.2.x.
rt pkeepalive = seconds : Number of seconds, when a RTP Keepalive packet will be
sent if no ot her RTP t raffic on t hat connect ion. Default 0 (no RTP Keepalive). Valid
only in [general] sect ion and t ype=peer .
rt pt imeout = seconds : Terminat e call if x seconds of no RTP act ivit y when we're not
on hold. Valid only in [general] sect ion and t ype=peer .
rt pholdt imeout = seconds : Terminat e call if x seconds of no RTP act ivit y when we're
on hold (must be larger t han rt pt imeout ). Valid only in [general] sect ion and t ype=peer .
sec ret : If Ast erisk is act ing as a SIP Server, t hen t his SIP client must login wit h t his
Password (A shared secret ). If Ast erisk is act ing as a SIP client t o a remot e SIP server
t hat requires SIP INVITE aut hent icat ion, t hen t his field is used t o aut hent icat e SIP
INVITEs t hat Ast erisk sends t o t he remot e SIP server. Ast erisk 1.6.2.x: Changed t he
sec ret paramet er t o remot esec ret .
sendrpid = yes|no : If a Remot e- Part y- ID SIP header should be sent . Default no .
set var = variable=value : Channel variable t o be set for all calls from t his peer/user.
subsc ribec ont ext = <cont ext _ name> : Set a specific cont ext for SIP SUBSCRIBE
request s
t runkname : Indicat es t his peer definit ion is for a SIP t runk. As a result , t he
$CALLERID(name) will st art off blank and requires t he dialplan t o set t he
$CALLERID(name). (New in v1.6.x)
t rust rpid = yes|no : If Remot e- Part y- ID SIP header should be t rust ed. Default no .
t ype = user|peer|friend : Relat ionship t o client - out bound provider or full client ?
usec lient c ode = yes|no : If yes , t hen t he Call Originat or as st at ed in t he CDR will be
changed t o what ever is specified in a X- Client Code SIP Header. Default no. (New in
v1.2.x)
usereqphone = yes|no : Indicat es whet her t o add a ";user=phone" t o t he URI. Default
no . Valid only in [general] and t ype=peer .
username = <username[@realm]> : If Ast erisk is accept ing SIP INVITE request s from a
remot e SIP client , t his field specifies t he user name for aut hent icat ion. (Cont rast wit h
f romuser .) Also, for peers t hat regist er wit h Ast erisk, t his username is used in INVITEs
unt il we have a regist rat ion.
vmext en = <st ring> : Dialplan ext ension t o reach mailbox. Default ast erisk . Valid only
in [general] or t ype=peer .

Notes
Ast erisk 1.6 and lat er support SIP over TCP. Before t hat it only support s SIP over UDP.
Ast erisk 1.8 comes wit h IPv6 support .
For Grandst ream phones: set dt mf mode=inf o
Ast erisk uses t he incoming RTP St ream as a t iming source for sending it s out going
St ream. If t he incoming st ream is int errupt ed due t o silence suppression t hen
musiconhold will be choppy. So in conclusion, you cannot use silence suppression. Make
sure ALL SIP phones have disabled silenc e suppression. There is a solut ion for
t he silence suppression problem, see bug 5374 for det ails.

E x ampl e s
Peer/User Sections
Each SIP client t hat connect s t o Ast erisk needs a definit ion in SIP.CONF. Here is a few samples:
[grandst ream1]
t ype=friend ; eit her "friend" (peer+user), "peer" or "user"
cont ext =from-sip
username=grandst ream1 ; usually mat ches t he [sect ion] t it le
fromuser=grandst ream1 ; overrides t he callerid, e.g. required by FWD
callerid=John Doe <1234>
host =192.168.0.23 ; we have a st at ic but privat e IP address
nat =no ; t here is not NAT bet ween phone and Ast erisk
canreinvit e=yes ; allow RT P voice t raffic t o bypass Ast erisk
dt mfmode=info ; eit her RFC2833 or INFO for t he BudgeT one
mailbox=1234@default ; mailbox 1234 in voicemail cont ext "default "
disallow=all ; need t o disallow=all before we can use allow=
allow=ulaw ; Not e: In user sect ions t he order of codecs
; list ed wit h allow= does NOT mat t er!
;allow=alaw
;allow=g723.1 ; Ast erisk only support s g723.1 pass-t hru!
;allow=g729 ; Pass-t hru only unless g729 license obt ained
ast db=chan2ext /SIP/grandst ream1=1234 ; ensures an ast DB ent ry exist s
[xlit e1]
;T urn off silence suppression in X-Lit e ("T ransmit Silence"=YES)!
;Not e t hat Xlit e sends NAT keep-alive packet s, so qualify=yes is not needed
t ype=friend
username=xlit e1
callerid="Jane Smit h" <5678>

host =dynamic
nat =yes ; X-Lit e is behind a NAT rout er
canreinvit e=no ; T ypically set t o NO if behind NAT
disallow=all
allow=gsm ; GSM consumes far less bandwidt h t han G711-u (ulaw)
allow=ulaw
allow=alaw
[user1_ snomsip]
t ype=friend
secret =blah
host =dynamic
dt mfmode=inband ; Choices are inband, rfc2833, or info
default ip=192.168.0.59
mailbox=1234,2345 ; Mailbox for message wait ing indicat or
disallow=all
allow=ulaw ; since we chose 'inband' for dt mf we must use g.711
allow=alaw
[user2_ pingt el]
t ype=friend
username=user2_ pingt el
secret =blah
host =dynamic
qualify=1000 ; Consider it down if it 's 1 second t o reply
callgroup=1,3-4 ; we are member of t he call groups 1, 3 and 4
pickupgroup=1,3-4 ; we can do call pick-up wit h *8 for t he callgroups 1, 3 and 4
default ip=192.168.0.60
disallow=all
allow=ulaw
allow=alaw
allow=g729
[user3_ cisco]
t ype=friend
username=user3_ cisco
secret =blah
nat =yes ; T his phone may be nat t ed
host =dynamic
canreinvit e=no ; Cisco poops on reinvit e somet imes
qualify=200 ; Qualify peer is no more t han 200ms away
default ip=192.168.0.4
disallow=all
allow=ulaw
allow=alaw
allow=g729

[user4_ cisco1]
t ype=friend
username=user4_ cisco
fromuser=markst er ; Specify user t o put in "from" inst ead of callerid
secret =blah
default ip=192.168.0.4 ; use eit her host =dynamic or default ip=...
amaflags=default ; Choices are default , omit , billing, document at ion
account code=markst er ; Users may be associat ed wit h an account code t o ease billing
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=g723.1
T hese definit ions are document ed in t he Digium Ast erisk handbook.
Aft er you defined t hese SIP client account s in SIP.conf you are able t o login t o t he ast erisk server
from client s and place calls. T o receive calls, you need t o configure ext ensions in ext ensions.conf.
Example:

ext en => 1010,1, Dial(SIP/user3_ cisco,10,t )


If someone calls ext ension 1010, t he sip client logged in as us e r3_ c is c o is dialled in order t o
receive t he call.

Not es
t he variable ${VXML_ URL} can be used t o add addit ional it ems t o t he To: header. The
value is appended, aft er a semicolon, t o t he SIP To: header. Not e t hat previous
document at ion on t his sit e was incorrect ; t his variable has not hing t o do wit h pushing
pages t o a Cisco 7960 phone (somet hing t hat is current ly impossible in t he Cisco SIP
firmware).
t he variable ${ALERT_ INFO} can be used t o creat e a new header called Alert - Info: which
can be used t o creat e dist inct ive ringing on t he Cisco SIP- enabled phone devices wit h
f irmware version 6.0 onward . For Cisco 7940/60, ALERT_ INFO can have t he value of
any of t he following built - in ringt ones:
- Bellcore-BusyVerify
- Bellcore-St ut t er
- Bellcore-MsgWait ing
- Bellcore-dr1
- Bellcore-dr2
- Bellcore-dr3
- Bellcore-dr4

- Bellcore-dr5
It is not current ly possible t o specify a cust om ring t one, only a cadence on t he default ringt one.
You will have t o list en quit e carefully t o t ell t hat t he ringing is different . Cisco bug ID CSCec42938
t racks t he request for it t o work on cust om ring t ones.

Using Asterisk together with SER

[general]
context=OUTGOING
autocreatepeer=yes
[Provider]
type=friend
username=XXXXX
secret=XXXXX
host=xxxxx.FakeProvider.com

So when Ast erisk receives a call from SER it will "aut ocreat epeer" and give access t o t he OUT GOING
cont ext .

Using Asterisk together with OpenSER

[general]
context=OUTGOING
autocreatepeer=yes
[Provider]
type=friend
username=__what_so_ever__
secret=__what_so_ever__
host=xyz.FakeProvider.com

Ast erisk will creat e peer when receives a call from OpenSER and gives access t o t he OUT GOING
cont ext .
T o use Ast erisk and OpenSER t oget her in realt ime, see Realt ime Int egrat ion Of Ast erisk Wit h
OpenSER.

C o nt r o l l i ng si p.c o nf f r o m o ut si de

Ast erisk sip conf from mysql: As wit h all .conf files t he #include st at ement can be
applied t o insert anot her file int o sip.conf

V e r si o n no t e s
T his sect ion will document t hings t hat may break as you upgrade a version. New feat ures generally
don't break old configurat ion files.

1.2: Channel configurat ion keyword rest rict cid has been deprecat ed.
1.2.10: The general keyword "port " has changed t o "bindport ". "port " in channel
configurat ions remains as a reference t o t he remot e server.
1.4.x: Realt ime cached friends are buggy up t o 1.4.19: bug 12707

S e e al so
How t o set up a SIP t runk in t he Ast erisk PBX - Basic set up How- To/t ut orial, SIP t runk
and dialplan, t o dial out , and in.
Ast erisk 1.4 comes wit h a new adapt ive general jit t er buffer also for chan_ sip. More
det ails here by Russel.
Ast erisk sip channels: More document at ion on SIP.conf
SIP: Session Init iat ion Prot ocol
Ast erisk config ext ensions.conf: Ast erisk ext ensions.conf samples
Ast erisk at large: Running a SER proxy in front of Ast erisk
Let t ing SIP client s connect direct ly wit hout media t hrough ast erisk
Ast erisk config files
Ast erisk SIP chan_ sip2: Informat ion about Olle E. Johansson's chan_ sip2 project (was
part ially incorporat ed int o Ast erisk 1.4)
Simple sip.conf generat or (bash script ) View

Back t o Ast erisk config files, Ast erisk


Created by: o ej, Last mo dificatio n: T ue 19 o f Jan, 2016 (10:19 UT C) by davemidd

Links to this page...

Please updat e t his page wit h new informat ion, just login and click on t he "Edit " or "Discussion"
t ab. Get a free login here: Regist er T hanks! - Find us on Google+
Page Changes | Comment s

Feat ured -

BUS INES S VO IP

R ES IDENT IAL VO IP

VoIP Phone &


Server SDK
vaxvoip.com

Develop SIP
Web/Soft Phone,
IP-PBX AutoDialer,
IVR & Call REC
Servers

Online File
Sharing

L AS T MO DIF PAG ES
1. Bico m Systems
2. Ho w to start a VOIP Business
3. REVE Systems
4. Cisco SPA525G2 Business IP Pho ne
5. call.center so ftpho ne
6. Vo IP So ftpho nes
7. Asterisk Cmd Vo ximal
8. T hirdLane
9. vo ip-info .o rg
10. Old News
Sho w Mo re

VO IP S PEED T ES T

G ET HELP

A sk a q ue st i o n
Invite no t accepted behavio ur
by glynrd Fri 22 o f Jul, 2016
Need help to find Ho sted Freeswitch and vo ip PST N gateway in Co lo mbia
by rvaldes Mo n 18 o f Jul, 2016
Re: Help
by ahunter3 Fri 15 o f Jul, 2016
View Mo re...

undefined
undefined

T erms of Service | Privacy Policy


2003-2016 VOIP-Info.org LLC
Powered by bit weaver

You might also like