This page showcases how to perform Postfix configuration and make changes in the dialplan on a VoipNow server.
Small Postfix configuration
The Email 2Fax application can be used for sending faxes using an e-mail client, directly from your computer. This application makes the old fax machine obsolete.
You can use PDF, TXT or TIFF files and, by sending an e-mail to out VoipNow box, the message will be sent as fax toward the destination from the e-mail subject.
Sometimes, following an upgrade or in case of a fresh install, some errors such as the following line are logged in the /var/log/maillog
files, where all the Postfix messages are logged.
Dec 8 11:26:09 sip2 postfix/smtpd[13666]: NOQUEUE: reject: RCPT from mail.myserver.me[192.168.14.72]: 554 5.7.1 <fax@myVoipNow.sip>: Relay access denied; from=<alexandruv@intern.pch> to=<fax@myVoipNow.sip> proto=SMTP helo=<mail.myserver.me>
The solution to this problem is very simple.
- Open
/etc/postifx/main.cf
in your favorite text editor (e.g. vi, vim, nano or mcedit). Look for
mydestination
line and make sure that$mydomain
is added in that line. This is what the line should like.mydestination = $myhostname, $mydomain, localhost
- Restart Postfix and Relay access denied will not occur again.
Making changes in the dialplan
Please note that it is not recommended to make any changes in the dialplan. However, if you adjust an application or a macro, you can make those changes into the /etc/asterisk/extension_custom.conf
file. Such changes will be preserved even after the upgrade.
Assuming that we want to route calls towards an emergency service directly from the dialplan, you will add the following snippet in the extension_custom.conf
file.
[app-emergency] exten => _[479]11,1,Set(CALLERCHAN=${SIP_HEADER(X-voipnow-user)}) exten => _[479]11,2,VMYSQL(Query 0 connid 14400 res:cid:ext:${CALLERCHAN}[owno].hash res:cid:ext:${CALLERCHAN}[ownona].hash res:cid:ext:${CALLERCHAN}[opasid].hash res:cid:ext:${CALLERCHAN}[oprc].hash res:cid:ext:${CALLERCHAN}[ofp].hash res:cid:ext:${CALLERCHAN}[ocan].hash ! CALL get_callerid_name_number("${CALLERCHAN}", "outbound")) exten => _[479]11,3,Set(worldno=) exten => _[479]11,4,Set(worldno_name=) exten => _[479]11,5,Set(passertedid=) exten => _[479]11,6,Set(preserve_callerid=) exten => _[479]11,7,Set(frompool=) exten => _[479]11,8,Set(canonymous=) exten => _[479]11,9,VMYSQL(Fetch foundRow ${resultid} worldno worldno_name passertedid preserve_callerid frompool canonymous) exten => _[479]11,10,VMYSQL(Clear ${resultid}) exten => _[479]11,11,GotoIf($["foo${worldno}" = "foo"]?13:12) exten => _[479]11,12,Set(CALLERID(num)=${worldno}) exten => _[479]11,13,GotoIf($["foo${worldno_name}" = "foo"]?15:14) exten => _[479]11,14,Set(CALLERID(name)=${worldno_name}) exten => _[479]11,15,SIPAddHeader(X-voipnow-channel:1) exten => _[479]11,16,Goto(20) exten => _[479]11,20,Dial(SIP/${EXTEN}@<provider hostname or IP address>)
The dialplan is reloaded using the command below and all calls to 911, 711, and 411 will be sent directly to the provider selected in the last line of the snippet code.
asterisk -rx 'dialplan reload'
extension_custom.conf
file must be included into the main dialplan file, otherwise they will not be taken into account. If you want to modify a part of the main dialplan, then the section has to be added in the extension_custom
, where all changes can be made.
Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.