Saturday, April 27, 2013

Asterisk and Cisco 7940 basic config file examples


Here are some very basic examples of configurations used to get a Cisco 7940 running on Asterisk.  The phone I'm using is running P0S3-8-12-00 and it's Asterisk 11.3.

Basic files used by the phone:

SIPDefault.cnf 
# file is downloaded by phone at boot up
# name is case sensitive

#image_version shows the firmware image to get from the TFTP server.
image_version: P0S3-08-12-00

# NAT/Firewall Traversal
# this seens to be required by the 7940s
# debugging SIP on the Asterisk server indicates authentication failures without it
# which in my case had nothing to do with users and passwords
nat_enable: "0"

# define your proxy / SIP server
proxy1_address: "192.168.10.2"
# tell the phone to register to the proxy
proxy_register: "1"

# define dialplan.xml as the file defining the phones dial plan
# this is not required but
# to at least avoid users needing to press the "dial" key after dialing
# or waiting for an inter-digit timeout, create a file that defines well known patterns
dial_template: "dialplan"

# define number to be dialed by messages button
# not required but given the phone has a big "messages" button
# it seems like it should work
messages_uri: "6500"


SIP0006D725E4D4.cnf
# file is downloaded by phone at boot up
# name is case sensitive
# format is SIP.cnf

# Text next to button on phone
# Like a CUCM Line Label
line1_name: Office1

# name used in Asterisk sip.conf to define SIP peer
line1_authname: "Office1"
line1_displayname: "Office1"

# secret used in Asterisk sip.conf

# using MAC address here to keep it complicated but easily remembered
line1_password: "0006D725E4D4"

# Phone Label displayed in upper right corner with no effect on SIP
# this is just cosmetic
phone_label: "7164330263"


dialplan.xml
# file is downloaded by phone at boot up
# name is case sensitive
# this is optional and will only be downloaded if exists in
# the SIPDefault.cnf file


<DIALTEMPLATE>
    <TEMPLATE MATCH="011*" Timeout="6" User="Phone"/><!-- International calls -->
    <TEMPLATE MATCH="1.........." Timeout="0" User="Phone"/> <!-- Long Distance are 1+10 digits -->
    <TEMPLATE MATCH="......." Timeout="0" User="Phone"/><!-- Local numbers are 7 digits here -->
    <TEMPLATE MATCH="*" Timeout="5"/><!-- Anything else, don't really care right now -->
</DIALTEMPLATE>


Basic file elements used by Asterisk:

sip.conf
; see extensions.conf file for how the 
: contexts below are used
[CiscoRouterIn]
context=pstn-incoming
type=friend
host=192.168.10.1
dtmfmode=rfc2833
disallow=all
allow=ulaw
; below is very important
; others said insecure = very is appropriate
; research
; http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf
insecure=port

[CiscoRouterOut]
context=pstn-outgoing
type=friend
host=192.168.10.1
dtmfmode=rfc2833
allow=ulaw
insecure=port

[Office1]
; line 1 on 7940 phone
type=friend
host=dynamic
nat=no
secret=0006D725E4D4
context=users
deny=0.0.0.0/0
permit=10.1.1.0/255.255.255.0
callerid="7164330263" <6002>
mailbox=6002@maslankavm


extensions.conf
[users]
; include access to outgoing routes from users
include=>pstn-outgoing

; how to call my phone and forward to vmail
exten=>6002,1,Dial(SIP/Office1,20)
exten=>6002,n,VoiceMail(6002@maslankavm,u)

[pstn-incoming]
;this provides access to users extensions from pstn-incoming (SIP ciscorouter1)
include=>users

[pstn-outgoing]
; dial 7 for out and strip 1
;exten=>_7.,1,Dial(SIP/${EXTEN:1}@CiscoRouterOut,60,r)
exten=>_NXXXXXX,1,Dial(SIP/${EXTEN}@CiscoRouterOut,60,r)
exten=>_1NXXNXXXXXX,1,Dial(SIP/${EXTEN}@CiscoRouterOut,60,r)


voicemail.conf
; I use GMail and will use them as my SMTP server
; T believe this requires something besides sendmail
; due to the way GMail uses TLS / SSL
; mailcmd=/usr/sbin/sendmail -t
; nice write up here: http://jonathanmanning.com/2011/07/15/how-to-configure-asterisk-to-send-voicemail-email-via-gmail-smtp-guide/
mailcmd=/usr/sbin/ssmtp -t

[maslankavm]
; here's my voicemail context and a basic mailbox that will forward to GMail
6002 => 12345,Somebody's Name,Some.Body@gmail.com,,attach=yes|tz=eastern



No comments:

Post a Comment