Scripted Changes to Outbound Rules

Discussion in '3CX Phone System - General' started by joebocop, Sep 30, 2014.

Thread Status:
Not open for further replies.
  1. joebocop

    Joined:
    Dec 12, 2013
    Messages:
    96
    Likes Received:
    0
    Hello,

    I have a client in a remote location where internet service experiences frequent degradation. This means that I have to respond to ping time alerts and make changes to the outbound rules in 3CX so that calls are not routed over VoIP trunks during periods of poor service.

    Are outbound rules (or even the order in which they are applied) able to be modified via a config file or something similar? I am thinking of writing a simple Python script which verifies ping times to VoIP providers and automatically adjusts 3CX outbound rules (or their order) accordingly.

    Possible, do you think? Where is the text file containing the outbound rules config located?

    Thank you.
     
  2. craigreilly

    craigreilly Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    3,132
    Likes Received:
    211
    I'm going to guess the rules are in the Database...
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. joebocop

    Joined:
    Dec 12, 2013
    Messages:
    96
    Likes Received:
    0
    I wonder if an UPDATE statement would be immediately respected by 3CX.... afterhours testing is imminent.
     
  4. joebocop

    Joined:
    Dec 12, 2013
    Messages:
    96
    Likes Received:
    0
    Seems the well-published "logsviewer" postgres user lacks the required privileges to SELECT or UPDATE on the "outboundroute" and "outboundrule" tables.

    Any clues as to from where the credentials for the "phonesystem" user may be gleaned?
     
  5. Raf Wenger

    Joined:
    Apr 5, 2010
    Messages:
    23
    Likes Received:
    0
    @jobocop you'll find the necessary login info to the database in the 3CXPhoneSystem.ini file located at c:\program files\3CX PhoneSystem\bin

    Look for the values under dbUser and dbPassword for the database called phonesystem.

    You might need to install PGAdmin on your PBX as access to the database might be restricted to localhost (it's a PostgreSQL feature).
    I have tried to directly update the database to make changes to all the extensions at once but noticed the changes were not applied. You might get better luck.
    Hope this helps.
     
  6. mands72

    Joined:
    Dec 1, 2014
    Messages:
    4
    Likes Received:
    0
    Have you already found a way how to create or update rules through the database?
    I have to do a project to get shortcut numbers (addressbook-) from a Public Folder in Exchange and to insert the entries as outgoing rules in 3CX phone system. Users are used from their old phone system to have user managable shortcuts for numbers and the only way seems to be through the outgoing rules.

    I guess I need to insert / update the "outboundroute" and "outboundrule" tables but how can I apply it to the running system? The only one way I have until now is to restart all 3CX Windows Services. Is there another way without interrupting the 3CX Services and stopping the users to be able to make phone calls? I want to sync the Exchange addressbook entries into the outgoing rules dynamically a few days per day.

    Thanks for and help :mrgreen:
     
  7. Raf Wenger

    Joined:
    Apr 5, 2010
    Messages:
    23
    Likes Received:
    0
    Hi Mands72
    We were in the exact same situation when I introduced 3CX to my company. Users wanted their quick dials for suppliers, customers, etc..
    I did look at using outbound rules for that but found it way too tedious.
    In the end I created an extension for each quick dial (say 710 for supplier X) and setup a forwarding rule for each where if the phone is busy or unregistered (as they will all be) then dial the full number for supplier X.

    Funny enough, a couple of years down the track using 3CX I run a report to see how often the quick dials are being used. Out of 80 staff only 2 were using the quick dial and only to 3 different numbers (we had over 50 quick dials setup).
    Seeing this, I removed all the quick dials and created phonebook entries instead.
    Now if someone want to call a supplier they do it from the 3cx client.

    Fun times! Good luck!
     
  8. joebocop

    Joined:
    Dec 12, 2013
    Messages:
    96
    Likes Received:
    0
    This remains an issue for us. Internet service frequently degrades to the point that VoIP calls are impossible, but 3CX does not failover to outbound rule #2 unless the link is severed completely. This means we have to manually make the switchover in the web interface each time the internet service becomes unreliable.

    Has anyone drawn up a script or some other such technique for monitoring an internet connection's health (Nagios?) and then failng over/failing back using 3CX's outbound rules system?

    Thank you.
     
Thread Status:
Not open for further replies.