Best way to add missing GUI configuration options to PJSIP endpoint

configuration
pjsip
Tags: #<Tag:0x00007fafc3392428> #<Tag:0x00007fafc3392270>

(Luis Mallozzi) #1

Hello,

I need to add a config option to some endpoints created into pjsip.endpoint.conf, more specifically rtp_timeout_hold and rtp_timeout options, because I am having issues with extensions recording long intervals of MOH and it’s eating a lot of disk space.

I’ve solved this issue by adding $endpoint[] = “rtp_timeout_hold=120”; $endpoint[] = “rtp_timeout=60”; to line 975 in the PJSip.class.php located at /var/www/html/admin/modules/core/functions.inc/drivers/.

This brings other problems like module signing and no control over which extension this should be enabled. I also don’t know how asterisk will behave if this option is set with endpoints participating in a native_rtp scenario. Since I need to record all calls, this should not pose a problem.

So, what’s the best way to add an option to the GUI of the PJSIP extensions that will be used to generate the pjsip.endpoint.conf accordingly?

Other related question: Is it possible to modify modules in FreePBX and have them signed to that machine? I know that I can disable the warning, but I wonder if I could sign it for my use, I would be warned if someone else changed the code without my knowledge.

Your help will be very much appreciated, Thanks guys.


#2

To get the features into the GUI you can either submit them yourself to the FreePBX team or open a feature request on the issue tracker.

To solve the problem you have right now, it’s better to use the pjsip.endpoint_custom_post.conf to add your options on to the config that FreePBX produces.

If you set up a PJSIP extension 1000, which creates an endpoint named [1000], you can put in your pjsip.endpoint_custom_post.conf:

[1000](+)
rtp_timeout_hold=120
rtp_timeout=60

I believe this is better than locally modifying the PHP, which would get overwritten later by FreePBX updates.


(Luis Mallozzi) #3

Billsimon, thank you very much, I have an idea that should make easier to manage: I could create a custom module that populate pjsip.endpoint_custom_post.conf with the structure you mentioned. Better yet if I could create a module that would add the option to the advanced tab of a pjsip extension (like extension routes module do). Do you know if it’s possible to do it?

Thanks


(Avayax) #4

There is a module like that already.
It’s called config edit.


(Avayax) #5

@billsimon, one thing to watch out for when making custom entries like that is to remember to remove the entry when you delete the extension.
Otherwise if your setting is overwriting a Freepbx default then all the extensions for which you have an entry in the custom config file, that are below the one for which the extension was deleted but the custom entry left, will take the Freepbx default again and lose their custom one.

Not sure if this applies to specific settings only, but I ran into this couple of times with media_address.