Best way to add missing GUI configuration options to PJSIP endpoint

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.

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.

2 Likes

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

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

2 Likes

@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.

1 Like

Is there any options to add something to all endpoints? Like:

[*](+)
rip_timeout_hold=120
rtp_timeout=60

or to all 2000-2099 endpoints?

[20**](+)
rip_timeout_hold=120
rtp_timeout=60

Tired to edit php freepbx files everytime :grimacing:

I don’t think this is a valid section…

This is likely a typo, it should be: rtp_timeout_hold

Either way. Why not do it in the GUI? Settings → Asterisk SIP Settings

image

[root@freepbx asterisk]# grep rtp_time * -m2
pjsip.endpoint.conf:rtp_timeout=30
pjsip.endpoint.conf:rtp_timeout_hold=300

Changing to:
image

[root@freepbx asterisk]# grep rtp_time * -m2
pjsip.endpoint.conf:rtp_timeout=60
pjsip.endpoint.conf:rtp_timeout_hold=120

I’ve just copied and pasted first question content in example above)
But what if I want to add some values which is not exist in FreePBX? For example:

[20**](+)
sdp_owner=root

You would have to add custom config to the pjsip.endpoint_custom_post.conf file for each endpoint.

Can you show where and how to add

remove_existing=yes

Nope…

I made an alternative suggestion about how to solve the problem you are facing in your other thread.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.