However the trunks configuration still exists in file sip_additional.conf and when I do a ‘sip show peers’ from asterisk cli, the trunks are there and sending registration requests.
Is this normal behaviour? Have I neglected something in the configuration?
Hi Utelit.
Philip Joseph picked up my ticket and responded to say that the current implementation only disables trunks with a registration string, e.g. CHAN_SIP. He’s closed my ticket and instead opened one against the core module, as FREEPBX-24185
From what I understand, your problem is about having copied but disabled.
My problem is that I don’t want ANY trunk to get transferred to WARM SPARE. I am not sure how Backup & Restore works in the background in such case but what I would expect is:
Disable Trunks = Copy the trunks but have them disabled
Exclude Trunks = Don’t copy trunks AT ALL, not only at FreePBX level (which works perfectly), but also on asterisk level (aka from the configuration file).
In reality I am not sure how “exclude” is handled.
So I want to exclude because all the Trunks on Main Site are on-premise stuff (Vega devices, ISP modems etc) that don’t exist on DR Site.
You are correct. These are different things and I don’t think there is a spot in the current backup facility to exclude trunks because they are so integral to everything else.
Hi @utelit - You’re correct and I apologise I hadn’t read closely enough before posting. Hope you get a satisfactory solution… it does sound like a strange behaviour but given the complexity of asterisk + FreePBX I suspect there will always be some anomalies.
Could a post-restore hook remove the config you don’t want from sip-additional.conf on the target machine (if the devs decide not to change the current behaviour)?
Mike
Yes, agreed! Currently I am leaning towards post-restore script indeed.
I just need to find a way to isolate a whole stanza of the configuration file from command line, so I can delete it from configuration on post-restore. But that’s another topic and irrelevant to the thread.
Actually I started going down the route of creating a post restore script to disable the trunks and documentation for it is sparse so maybe somebody here can assist.
First, I am assuming that the script needs to be stored on the system that runs the backup, correct?
Is there a preferred directory to store these scripts?
Who needs to be the owner of the script for it to be executed properly? asterisk or root?
Unless there is any surprise, it sounds like it should be in the same system that initiates the Restore Job, so yeah on the system that runs the backup. Correct me if I’m wrong.
I haven’t created before, but I would assume that a “proper” directory would be either one that gets its permissions updated when you issue the command “fwconsole chown”, or a directory in asterisk user home folder.
I believe this is a separate issue to discuss and it should be on another thread where I’ll be glad to help in any way I can. Also to answer, I would first look if there is any relevant post in this forum. After a quick search for example I found https://community.freepbx.org/t/backup-restore-hooks-not-working/70486/4.
So that anyone that accesses this thread 6 months from now, finds information that is relevant to the title and maybe pitch in.
So in order to conclude, from what I understand there is no direct solution at the moment. In order to exclude trunks it needs to happen on both FreePBX level and asterisk level. Right now it only happens on FreePBX level.
Most possible solution seems to be a post-restore script.