Controlling Codec Selection in Asterisk SIP Peers

Asterisk’s sip.conf file, in /etc/asterisk, contains entries for each SIP endpoint or trunk that can communicate with the Asterisk SIP server agent. Each entry can have multiple allow and disallow keywords, which indicate what codecs are to be used for each peer. The following configuration sets up a group of LAN phones and a group of remote, WAN-connected phones:

    [general]
    disallow=all
    allow=ulaw
    allow=g279
    allow=speex

    [601]
    ; phone on same LAN as
    callerid="Jegee" <601>
    context=Cleveland
    host=dynamic
    type=friend
    username=601
    secret=browns

    [502]
    ; phone in remote location, connected by WAN
    disallow=all
    allow=g729
    callerid="Maddie" <502>
    context=Maui
    host=dynamic
    type=friend
    username=502
    secret=aloha

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.