Recently we have been doing a lot of work with FreePBX. This is an Asterisk distribution and FreePBX is the web interface that writes the Asterisk dialplan.
It was easy to get a DID to ring in to our system, you can do that through the web interface just by filling in the boxes.
Then we were asked to restrict that DID so it only allowed a certain caller to access it. Again that is fine, there is a caller ID box in the web form that allows you to do that.
Then we were asked if two callers could have access. This is trickier as the Caller ID box on the inbound route form only allows one number to be entered. But we created two inbound routes, both with the same DID, but different CallerID's and again this worked, now two phones could dial in on one DID.
Where it started to get unmanageable was when we were asked if there could be 20, 30 or 40 CallerID's with permission to call that DID. Whilst we could keep creating inbound routes, the menu structure of the web interface was going to start getting very messy showing all those additional routes just for 1 DID. Because of this we started looking at how to add these into the custom files that are hidden from the web interface.
Here is what we did.
Use WinSCP to connect to the PBX. WinSCP allows the transfer and editing of files on a linux box.
Navigate to /etc/asterisk/extensions_additional.conf - Don't change anything in here as this is a file FreePBX writes and any changes will be lost.
Open the file and do a search for your DID number, you will see a section like the one below.
[ext-did-0001]
include => ext-did-0001-custom
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})
exten => 01161234567/07971234567,1,Set(__FROM_DID=${EXTEN})
exten => 01161234567/07971234567,n,Gosub(app-blacklist-check,s,1())
exten => 01161234567/07971234567,n,Set(CDR(did)=${FROM_DID})
exten => 01161234567/07971234567,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 01161234567/07971234567,n,Set(CHANNEL(musicclass)=default)
exten => 01161234567/07971234567,n,Set(__MOHCLASS=default)
exten => 01161234567/07971234567,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 01161234567/07971234567,n,Set(CALLERPRES()=allowed_not_screened)
exten => 01161234567/07971234567,n(dest-ext),Goto(disa,1,1)
;--== end of [ext-did-0001] ==--;
What this section of the dialplan does is handle calls in on 01161234567 that have come only from 07971234567. Notice the include => ext-did-0001-custom . This causes the PBX to look for another section called [ext-did-0001-custom]. At the moment this section does not exist and we cant put it in this file, but we can put it elsewhere.
Navigate to /etc/asterisk/extensions_custom.conf - You may well find this file is empty.
Copy the [ext-did-0001] section and paste it into extensions_custom.conf
Change the section name to be [ext-did-0001-custom] and don't forget to change the section end marker to look the same. Take out the include statement You can now do a search and replace on the CallerID, it will look like this.
[ext-did-0001-custom]
exten => fax,1,Goto(${CUT(FAX_DEST,^,1)},${CUT(FAX_DEST,^,2)},${CUT(FAX_DEST,^,3)})
exten => 01161234567/07989876543,1,Set(__FROM_DID=${EXTEN})
exten => 01161234567/07989876543,n,Gosub(app-blacklist-check,s,1())
exten => 01161234567/07989876543,n,Set(CDR(did)=${FROM_DID})
exten => 01161234567/07989876543,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 01161234567/07989876543,n,Set(CHANNEL(musicclass)=default)
exten => 01161234567/07989876543,n,Set(__MOHCLASS=default)
exten => 01161234567/07989876543,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 01161234567/07989876543,n,Set(CALLERPRES()=allowed_not_screened)
exten => 01161234567/07989876543,n(dest-ext),Goto(disa,1,1)
;--== end of [ext-did-0001-custom] ==--;
You can now save the file and then close it.
If you now ask asterisk to reload the configuration you will get in from two different CallerID's. You can keep on adding further DID definitions with other CallerID's into this section and they won't show in the web interface of the system.
John Rogers
Telecom Care Ltd
Subscribe to:
Post Comments (Atom)
LetsEncrypt failure on Draytek Routers
We like to use Draytek Routers on our installs as they are easy to configure and tend to be reliable. As with all things these days https s...
-
When I looked around the internet for instructions on viewing the smdr output from the 3300's web interface I found a lot of conflicting...
-
Method 1: Sometimes it just seems as though nothing you are doing, even though you are sure it is right, is having any impact on the behavi...
-
Mitel sell the 53xx range of phones as 'Dual Mode' meaning they can be switched to SIP mode. That's great, except for the lack o...
No comments:
Post a Comment
Please keep your comments polite and free from bad language. Thanks