This will append the setting to the peer config. So in the end you will end up with the following basically being part of the peer settings. Generally Asterisk takes the first one it reads into memory and ignores the latter.
So you will need to override the peer or the actual dialplan context. The latter is properly the easiest. You would edit extensions_freepbx_override.conf and put your sms-incoming-nm context there but with just [sms-incoming]
Doing that will make Asterisk load your version of [sms-incoming] first and use that instead of the FreePBX configured [sms-incoming].
You take the context that you referred to originally, sms-incoming-nm and you paste that in extensions_freepbx_override.conf and then you change the name from sms-incoming-nm to sms-incoming and save.
extensions_freepbx_override.conf is loaded first allowing Asterisk to load what it finds there in memory first and thus ignores the [sms-incoming] context that is loaded in extensions_additional.conf.
@StephanK - you’ve just been visited by the “flexibility fairy”.
The suggestion Lorne made will do what you originally asked, in that it updates your system to add the option in a way that the regular FreePBX Updates will not destroy.
Tom’s suggestion allows you to “preload” the SMS Handling Context by preloading the [incoming-sms] context with your code in the extensions_freepbx_override.conf file.
The advantage of the first is that the rest of the system exists without modifying anything except the one like in the sip_custom_post.conf file and your custom context in extensions_custom.conf. The advantage of the second is that you are now calling “incoming-sms” like the regular system, but you’ve created a new context “payload” by adding it to extensions_freepbx_override.conf.
One last important note - you can’t edit the extensions_additional.conf file. Your changes will be overwritten by the system’s “Apply Config” operation.
Neither solution is wrong - it all depends on how your concept of the system works.
This is the burden of flexibility. Note that you need to pick one or the other. if you use the extensions_freepbx_custom.conf option to “overload” the [incoming-sms] context, all of your changes are in one place and in a file that you won’t have to mess with. The downside is that you need to remember (or document in the NoOp() line) that you’ve added your own code. The other method doesn’t overload anything, but you have two changes to track and make sure stay in play.
The issue here is the setting already exists on the trunk. So it’s adding the same setting a second time to the config. It may or may not use the first listed setting over the last setting. As most other things do in Asterisk as the first to load.
So this is more than just adding an additional setting, it’s overriding the current one that needs to happen. Also keep in mind, which SIPStation moves to PJSIP trunks something like this will break it and cause it not to load. PJSIP will not load an object (endpoint, aor, etc) with misconfigured settings and duplicate settings would do that.
Then you aren’t using FreePBX. That’s one of the files that FreePBX over-writes EVERY time the Apply Config button is pressed. All of your system-specific changes should go in extensions_custom.conf.
OK, I’m not sure why we are still not getting this.
In order to override [incoming-sms] the updated context needs to be in extensions_override_freepbx.conf putting it in extensions_custom.conf will make it load after the extensions_additional.conf is loaded.
^^^ That is the order of the dialplan files. What is read into memory first WINS so if you put [incoming-sms] in extensions_custom.conf nothing will look at it because FreePBX’s [incoming-sms] is loaded first and wins. So this needs to be in the first conf that is loaded, extensions_override_freepbx.conf. This is the same file apps like FOP2 and others use to override the dialplan that is generated by FreePBX for their functions to work.
So changing the SIPStation trunks to point at a custom context gets overwritten when the SIPStation module applies it changes so adding it there isn’t going to work. Appending the setting with the [trunkname](+) is just going to add a second setting at the end so again, no guarantees it will be even used.