need to build one small app for any suitable stable version of Asterisk say 1.4.2 where we can install this app and it will do following for me.
Any incoming call will come to this Asterisk, it will look at the call DID number and connect with MYSQL Server to check the type of DID defined in MYSQL Database. Asterisk should take action on the DID only when it is active. If it's not Active then Asterisk should discard this incoming SIP INVITE request.
But if the DID is active then Asterisk should identify if it is a SIP DID or FAX DID? If it is a SIP DID then it should look at the routing in the same table in MYSQL. Say for example a DID 14169920513 is a DID in the table and the destination is 900 [url removed, login to view] so this means any call coming for 14169920512 should be forwarded to my SIP extension 900 [url removed, login to view] which is my second asterisk or any other IP PBX.
A table in MySQL Table may look like this
PK_ID DID Type Active Route
1 14169920512 Fax 0
2 14169920513 PSTN 1 900 [url removed, login to view]
3 14169920514 PSTN 0
4 14169920515 Fax 1 jarrad [url removed, login to view]
I can't put the complete email address here due to restriction in posting this project. I hope you understand that above are the locations where DID or Fax should be routed.
But in case if this number 14169920515 is defined as a Fax number in the same MYSQL Table then Asterisk should handle this DID as a fax number and should convert this into a PDF file and send to email which also will be defined in the same MYSQL table next to it as jarrad [url removed, login to view] so in other words, Asterisk don't have to go through [url removed, login to view] each time and just look at this MYSQL Database for each incoming/outgoing call to verify on what it should do with this call. Treat it as a fax or voip.
For fax handling you can use either SANDSP or Call Weaver. I have heard more about Call Weaver is a better solution because SANDSP is not recommended by all for [url removed, login to view] based Fax handling for DIDs.
CDR for DIDs and FAX
When any call comes in, Asterisk will maintain the CDR of these calls going through the system. In case if any fax page is going through then Asterisk will maintain CDR of the FAX based on the number of Fax pages gone through the system.
This CDR should be easily accessible.
Any active Call should be easily monitored using any graphical interface where we can see remotely how many active calls are going through the system or how many fax sessions are happening at any moment.
This add-on module should be available in easy installable form to end user. For example in RPM form or any other form that is just executable and this executable should ask the user to point to MYSQL Server and point connectivity details of MYSQL Server including user/password etc. Easy installation is a very important requirement so this way we just install the RPM in any suitable stable Asterisk version and it should work and remote management should of this application should be Web based.
So using this Web based management, we should be able to see Active Calls, Active Fax sessions and should be able to easily add/remove more DIDs from the Database at any time or make the DIDs active or Inactive whenever required.
For more questions please do not hesitate to get in touch with me.