[Asterisk-Users] SIP config documentation

Costa Tsaousis costa at tsaousis.gr
Tue Feb 17 17:28:36 MST 2004


Hi all,

I was trying to figure out all the valid options for a sip.conf and I
believe I found a few weird things (or just a few things that are weird
to me :) Anyway, I decided to post this here together with my questions
and notes in case other people need this info too or have similar
questions.

First, let me state what the Handbook says: type=user is a SIP user
agent that initiates calls (through asterisk) while type=peer is a SIP
user agent that can only receive calls from asterisk.

Having said that, my examination of chan_sip.c shows that:


		> UP < options of U=user, P=peer
type=		; UP, user, peer or friend (=user+peer)
context=	; UP, the context name for placing calls

Q1: Why is there a context for peers?


permit=		; UP access control
deny=		; UP access control
auth=		; UP plaintext, md5
secret=		; UP user's password in plaintext
md5secret=	; UP user's password in MD5 format in
"<user>:asterisk:<secret>" format
dtmfmode=	; UP DTMF detection: inband, rfc2833, or info
canreinvite=	; UP yes, no or update.

If set to no, * will be a media gateway.

Q2: What the "update" option does?


callerid=	; U- caller id of the user: "Name <number>".

Q3: A lot of issues here:
a. If I place here a SIP address (<user at domain.com>), asterisk STRIPS
the dots (it actually strips: "()-." - this is done in callerid.c) which
of course destroys the callerid.

Stripping of the dot character, really destroys the use of variables in
contexts. Since the outgoing call from, and the incoming call to, the
same user have different caller ids, a lot of asterisk's beauty is lost
when programming advanced things in extensions.conf.

b. If the callerid contains anything other than just a number, then when
asterisk sends the call, for example, to another asterisk box (via SRV
lookups) it removes the non-numeric callerid and places there the word
"asterisk".

This destroys the whole idea of SIP. If I place a call from the * at my
office, to the * at my home, here is what is happening:

Office * callerid:		->	Home Phone gets:
Costa Tsaousis <costa at a.com>	->	Costa Tsaousis <asterisk>
Costa Tsaousis <123 at a.com>	->	Costa Tsaousis <asterisk>
Costa Tsaousis <123>		->	Costa Tsaousis <123>

The last is AGAIN wrong, since the home phone does not know WHICH "123"
it is. It should be "<123 at a.com>" for the home phone to be able to call
it back and for me to know which "Costa Tsaousis" called!


callgroup=	; UP
pckupgroup=	; UP

Q4: Since a user cannot accept calls, why to setup call pickup for
him/her?


language=	; U- language for voice messages and indications

Q5: Why a peer does not have a language? What if we want to call someone
with an IVR menu (via a .call file)? How we can choose the language for
him/her? (yes, I know this can be set in the context the call will
enter, but I think the elegant solution is to have this information
here).


accountcode=	; U- CDR's account code
incominglimit=	; U- concurrent call limitations ( >= 0 )
outgoinglimit=	; U- concurrent call limitations ( >= 0 )

Q6: How is it possible for a type=user phone to have BOTH incoming and
outgoing limits?


amaflags=	; U- default, ommit, billing or documentation
disallow=	; UP Disallow codecs
allow=		; UP Allow codecs in order of preference
insecure=	; UP yes, no : don't check source IP/port
restrictcid=	; U- yes, no : don't send caller id
nat=		; -P yes, no : Support NAT. (breaks RFC)
fromdomain=	; -P Domain to show in the domain field of the outgoing call
TO the peer.
fromuser=	; -P User to show in the user field of the outgoing call TO
the peer.
host=		; -P dynamic or an IP address
mask=		; -P netmask for host= parameter.
port=		; -P port for host= parameter.
defaultip=	; -P if the peer does not register with us, where we should
try to find it by default.

Q7: I am really lost with these. I understand defaultip pretty well, but
then, what is exactly the use of host, port and mask, for peers? Does
this have to do something with nat=yes in order to set our asterisk
"public view", or what?


username=	; -P username to send to the peer when calling the peer

Q7: Since this is a peer option, it is really very badly documented in
the various documents. All these documents state that this is used when
the phone's login name is different from the default. But then, since
this is a peer option it is ignored for type=user agents and is used
only when asterisk is calling the phone.


qualify=	; -P yes, no or milliseconds : peer monitoring
mailbox=	; -P mailbox number for message waiting indication.

These are all the options I found for peers and users.


Just for your reference, these are all the [general] options for SIP:

[general]

context=	; Default context for incoming SIP calls
dtmfmode=	; inband, rfc2833, or info
language=	; voice messages language
canreinvite=	; yes, no, update. If no, * will be a media gateway
callerid=	; Default caller id (name only & becomes fromuser too)

The effects of the callerid option are very funny. The only thing that
produces valid SIP headers is just a word. The default is: asterisk


fromdomain=	; Default domain to put in outgoing SIP calls
nat=		; NAT support
autocreatepeer=	; Automatically create peers from incoming calls?
srvlookup	; Enable SRV lookups on outbound calls
pedantic=	; Enable slow, pedantic checking for Pingtel

As stated in the code, pedantic, actually enabled RFC compatibility!
It is just that this compatibility is somewhat expensive in system
resources.


videosupport=	; Turn on support for SIP video
notifymimetype=	; Allow overriding of mime type in NOTIFY
tos=		; lowdelay, throughput, reliability, mincost, none, or a number
maxexpirey=	; seconds of incoming registrations we allow (max)
defaultexpirey=	; Default seconds of incoming/outgoing registrations
port=		; Port to listen to
bindaddr=	; Address to bind to
localnet=	; ???
localmask=	; ???
externip=	; Address that we're going to put in SIP messages if we're
behind a NAT
disallow=	; Disallow codecs
allow=		; Allow codecs in order of preference

And finally, if mySQL friends is enabled:
dbuser=		; the database user
dbpass=		; the database user's password
dbhost=		; where the database is running
dbname=		; the name of the database to choose


Kind regards,

Costa






More information about the asterisk-users mailing list