...
- 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 This is what the line should like.shellCode Block mydestination = $myhostname, $mydomain, localhost
- Restart Postfix and Relay access denied will not occur again.
Making changes in the dialplan
...
Assuming that we want to route calls towards an emergency service directly from the dialplan, you will add the following snippet in the the extension_custom.conf
file file.shell
Code Block |
---|
[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.
Shell |
---|
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.