SIP URIs and Asterisk
Configure Asterisk for use with SIP URIs
This article describes how to set up Asterisk for incoming and outgoing SIP URI calls. The configuration examples in this article assume the DNS domain to be flintstones.org and the user's SIP URI to be sip:fred@flintstones.org. Please adjust user and domain names to your own needs accordingly.
Introduction
A SIP URI is a universal resource identifier that points to a SIP user's SIP phone or telephone extension. A SIP URI looks similar to an email address, for example sip:fred@flintstones.org. Using SIP URIs, no telephone number is needed to make telephone calls from one SIP user to another.
DNS configuration
Add the following DNS SRV record to your DNS domain's zone, replacing 'flintstones.org' with your own DNS domain and the IP addresses with the IP addresses of your own servers:
; SIP server/proxy and its backup server/proxy - Asterisk server sip.fintstones.org. 21600 IN A 10.20.30.40 sip2.fintstones.org. 21600 IN A 10.20.30.41 ; ; DNS SRV records for SIP _sip._udp.flintstones.org. 21600 IN SRV 10 0 5060 sip.flintstones.org. _sip._udp.flintstones.org. 21600 IN SRV 20 0 5060 sip2.flintstones.org.
Note that it can take up to 72 hours for these changes to propagate throughout the internet due to the distributed architecture of the DNS system.
Asterisk SIP URI configuration
SIP configuration
Add the following to /etc/asterisk/sip.conf :
[general] context=SIP-incoming srvlookup=yes ; this may already be in the [general] section of sip.conf
Dialplan configuration
Add the following to /etc/asterisk/extensions.conf, replacing 'fred' with your own name and 'SIP/2001'
with the extension of your own telephone:
[SIP-incoming] ; incoming calls via unauthenticated SIP
;
; incoming calls for SIP URI fred@flintstones.org
exten => fred,1,NoOp(Incoming call via unauthenticated SIP from ${CALLERID})
exten => fred,2,Dial(SIP/2001,60,r)
exten => fred,3,Hangup
Don't forget to tell Asterisk to reload
Use the Asterisk command line ...
*CLI> reload
Alternatively, use Asterisk Launcher to reload ...
Dialing SIP URIs
To dial by SIP URI, you will need a SIP phone that supports SIP URI dialing. SIP soft phones generally support SIP URI dialing. SIP hardware phones may need the SIP URI to be entered into a phone book and the phone book entry to be linked to a short dial. For details, please refer to the user manual of your SIP phone.
To let Asterisk dial by SIP URI, enter extensions to /etc/asterisk/extensions.conf as shown
in the example below:
[SIP-URIs] ; outgoing SIP calls to SIP URIs ; ; Extension 3733 (FRED) mapped to SIP URI fred@flintstones.org exten => 3733,1,NoOp(Outgoing SIP call to sip:fred@flintstones.org) exten => 3733,2,Dial(SIP/fred@flintstones.org,60,r) exten => 3733,3,Hangup [your context] include => SIP-URIs ; make context SIP-URIs visible here
Join the Macintosh Telephony Mailing List
List membership is free. Click here for details.
Legal Disclaimer
Asterisk is a trademark of Digium Inc. Apple, Cocoa, Macintosh and MacOS X are trademarks of Apple Inc. The Asterisk software is released under the GNU General Public License (GPL). The Asterisk for Macintosh Distribution and related utilities are maintained and released by Sunrise Telephone Systems in accordance with the GPL whilst Apple's and Digium's trademarks are mentioned for reference only in order to inform about the origin and purpose of the software. The mentioning of those marks does not imply any kind of endorsement neither by Apple Inc nor by Digium Inc. A4M is a trademark of Sunrise Telephone Systems. A4M specific icons shown on this page are the property of Sunrise Telephone Systems, their use for other purposes than use or redistribution of the unmodified A4M software distribution or parts thereof requires written permission.