Duplicating IVR entries in FreePBX 13


  • Service Provider

    I absolutely hate making IVR entries in FreePBX. It is a hundred million clicks to get anything done.

    Unlike many pieces of FreePBX, there is no duplicate button in the GUI for these.

    Like everything with FreePBX, the IVR entries are stored in the mysql database.

    So first, make one in the GUI and assign everything.
    Now we can get into mysql and see what is available.

    mysql> select * from ivr_details;
    +----+------------------------+--------------------------------+-----------+--------------+------------+---------------+-------------------------+------------------------+-----------------+-------------------+-------+--------------+-------------------+-------------------------+------------------------+---------------+-------------------------+-------------------------+-----------------+-----------------+---------+
    | id | name                   | description                    | alertinfo | announcement | directdial | invalid_loops | invalid_retry_recording | invalid_destination    | timeout_enabled | invalid_recording | retvm | timeout_time | timeout_recording | timeout_retry_recording | timeout_destination    | timeout_loops | timeout_append_announce | invalid_append_announce | timeout_ivr_ret | invalid_ivr_ret | rvolume |
    +----+------------------------+--------------------------------+-----------+--------------+------------+---------------+-------------------------+------------------------+-----------------+-------------------+-------+--------------+-------------------+-------------------------+------------------------+---------------+-------------------------+-------------------------+-----------------+-----------------+---------+
    |  1 | Cape Girardeau         | General IVR for Cape Girardeau |           |            1 | ext-local  | 3             | default                 | app-blackhole,hangup,1 | NULL            | default           |       |           10 | default           | default                 | app-blackhole,hangup,1 | 3             |                       0 |                       0 |               0 |               0 | 0       |
    +----+------------------------+--------------------------------+-----------+--------------+------------+---------------+-------------------------+------------------------+-----------------+-------------------+-------+--------------+-------------------+-------------------------+------------------------+---------------+-------------------------+-------------------------+-----------------+-----------------+---------+
    

    And the entries for it..

    mysql> select * from ivr_entries;
    +--------+-----------+-------------------------------+---------+
    | ivr_id | selection | dest                          | ivr_ret |
    +--------+-----------+-------------------------------+---------+
    |      1 | 0         | ext-group,5303,1              |       0 |
    |      1 | 1         | ext-group,5301,1              |       0 |
    |      1 | 2         | ext-group,5302,1              |       0 |
    |      1 | 3         | ext-group,5304,1              |       0 |
    |      1 | 4         | ext-group,5304,1              |       0 |
    |      1 | 8         | ext-featurecodes,*98,1        |       0 |
    |      1 | 9         | app-pbdirectory,pbdirectory,1 |       0 |
    +--------+-----------+-------------------------------+---------+
    7 rows in set (0.00 sec)
    

    If you want to not have to edit as much later, you can now make the rest of the IVRs in the GUI, but do not set any of the destinations.

    Then once your IVRs are all made you can simply copy the destinations.

    mysql> insert into ivr_entries select 2,selection,dest,ivr_ret from ivr_entries where ivr_id = 1;
    Query OK, 7 rows affected (0.00 sec)
    Records: 7  Duplicates: 0  Warnings: 0
    

    now there are two sets in the ivr_entries table and you can tweak them in the GUI easier. Or as is the case here, I do not need to change them because it is simply the night IVR that has a different message.

    mysql> select * from ivr_entries;
    +--------+-----------+-------------------------------+---------+
    | ivr_id | selection | dest                          | ivr_ret |
    +--------+-----------+-------------------------------+---------+
    |      1 | 0         | ext-group,5303,1              |       0 |
    |      1 | 1         | ext-group,5301,1              |       0 |
    |      1 | 2         | ext-group,5302,1              |       0 |
    |      1 | 3         | ext-group,5304,1              |       0 |
    |      1 | 4         | ext-group,5304,1              |       0 |
    |      1 | 8         | ext-featurecodes,*98,1        |       0 |
    |      1 | 9         | app-pbdirectory,pbdirectory,1 |       0 |
    |      2 | 0         | ext-group,5303,1              |       0 |
    |      2 | 1         | ext-group,5301,1              |       0 |
    |      2 | 2         | ext-group,5302,1              |       0 |
    |      2 | 3         | ext-group,5304,1              |       0 |
    |      2 | 4         | ext-group,5304,1              |       0 |
    |      2 | 8         | ext-featurecodes,*98,1        |       0 |
    |      2 | 9         | app-pbdirectory,pbdirectory,1 |       0 |
    +--------+-----------+-------------------------------+---------+
    14 rows in set (0.00 sec)
    

    I'll try and post some more advanced copy options later.



  • This is awesome.

    I wish their was a way to import default trunk settings. Is something similar possible?


  • Service Provider

    @bigbear said in Duplicating IVR entries in FreePBX 13:

    This is awesome.

    I wish their was a way to import default trunk settings. Is something similar possible?

    Never looked because I never have that multiple trunks from the same provider.

    Why would you have multiple trunks from the same provider?



  • @JaredBusch we have 4 border controllers for origination/termination in the U.S. So any IP where I call may originate from needs to be in a trunk. As per FreePBX developers you have to list each IP under a unique trunk.

    Generally we would route calls in and out from one region, but the others are for network failover.

    It would be nice to import them and then quickly edit each trunks user/password for the unique customer.

    On our freeswitch platform and on broadsoft this was a much different experience.



  • @JaredBusch and we are actually a voip provider. We have are own interconnects in local markets. About 10 years running now.

    This was originally a service we only provided WISP and Fiber customers. A lot of market competition has kicked up over the last 2 years so we are splitting our business up. Some guys are staying with VSAT/WISP company and the rest are going with expanding VoIP services.


  • Service Provider

    @bigbear said in Duplicating IVR entries in FreePBX 13:

    @JaredBusch and we are actually a voip provider. We have are own interconnects in local markets. About 10 years running now.

    This was originally a service we only provided WISP and Fiber customers. A lot of market competition has kicked up over the last 2 years so we are splitting our business up. Some guys are staying with VSAT/WISP company and the rest are going with expanding VoIP services.

    Okay, I was wondering WTF you were doing. As a provider I get that. This will be an entire side conversation, but that answer is yes.

    Remember FreePBX is not a PBX itself, it is simply a management layer on top of Asterisk. Everything you do in FreePBX writes to the database and then when you click the apply button, it rewrites the asterisk files and restarts asterisk.

    Probably some random exception to the rule, but this is how FreePBX is designed. It never writes directly to the Asterisk configs.

    As a provider, why would you be using FreePBX anyway? If I was going to be providing SIP service with Asterisk, I would be doing it straight from Asterisk, or my own tools wrote to configure Asterisk.



  • @JaredBusch we aren't. It's a long story. We have about 8 years invested in FreeSwitch, OpenSips and Kamailio. A lot of custom development.

    A couple years ago I had looked to leave our setup and we deployed Broadsoft. The grass wasnt greener on the other side so we doubled down on our platform.

    Will back channel you sometime about the FreePBX use. Its caught my attention because they seem to be pulling way ahead of all the other legacy vendors who are dropping out of the market.

    We are more focused right now on SMS/MMS integration and cellular.


  • Service Provider

    For the curious, here is an example of inserting a pair of new IVR's.

    insert into ivr_details (name,description,alertinfo,announcement,directdial,invalid_loops,invalid_retry_recording,invalid_destination,timeout_enabled,invalid_recording,retvm,timeout_time,timeout_recording,timeout_retry_recording,timeout_destination,timeout_loops,timeout_append_announce,invalid_append_announce,timeout_ivr_ret,invalid_ivr_ret,rvolume) values ('Jeff City','General IVR for Jeff City','',1,'ext-local','3','default','app-blackhole,hangup,1',NULL,'default','',10,'default','default','app-blackhole,hangup,1','3',0,0,0,0,'0'),('Jeff City - Night','IVR for Jeff City after hours','',2,'ext-local','3','default','app-blackhole,hangup,1',NULL,'default','',10,'default','default','app-blackhole,hangup,1','3',0,0,0,0,'0');
    
    

    insert into ivr_details (name,description,alertinfo,announcement,directdial,invalid_loops,invalid_retry_recording,invalid_destination,timeout_enabled,invalid_recording,retvm,timeout_time,timeout_recording,timeout_retry_recording,timeout_destination,timeout_loops,timeout_append_announce,invalid_append_announce,timeout_ivr_ret,invalid_ivr_ret,rvolume) values ('Jeff City','General IVR for Jeff City','',1,'ext-local','3','default','app-blackhole,hangup,1',NULL,'default','',10,'default','default','app-blackhole,hangup,1','3',0,0,0,0,'0'),('Jeff City - Night','IVR for Jeff City after hours','',2,'ext-local','3','default','app-blackhole,hangup,1',NULL,'default','',10,'default','default','app-blackhole,hangup,1','3',0,0,0,0,'0');



Looks like your connection to MangoLassi was lost, please wait while we try to reconnect.