Where to access "Default" options

freepbx-15
freepbx
development
Tags: #<Tag:0x00007f4f59421be8> #<Tag:0x00007f4f59421a30> #<Tag:0x00007f4f59421710>

(Sholinaty) #1

trying to tackle an annoyance i’ve had with PJSIP.

I see many of the default options are set via
getDefaultDeviceSettings($id, $displayname, &$flag)

and on many of the settings, it uses $this->freepbx->Config->get('DEVICE_CALLGROUP'),

I haven’t been able to find any reference (yet) as to where Contig->get searches, or how to find those variables.
Heck, I cant even find that variable via grep on my server.

tldr: I want to pull max_contacts into a configurable variable, instead of forcing it to 1 by default.

Anyone able to provide a breadcrumb as to where variables like the above would be stored / made editable?


(Simon Telephonics) #2

Advanced Settings - Device Settings


(Sholinaty) #3

that doesnt work for adding a new variable that doesn’t exist yet.

surely this is in a config file or database somewhere, which is Read by the code I am referring to.


(Simon Telephonics) #4

Sorry, really have no idea what you are asking. I understood you wanted to know where the device defaults were set. The advanced settings page sets the value in the database (asterisk.freepbx_settings).


(Sholinaty) #5

Entirely fair.

I am trying to create a NEW default value (changeable) to replace something that is currently hard-coded to be 1.

When you create a new pjsip extension, max_contacts will be set to 1.

That’s an extra step for every extension to change this, when a system default value (for new extensions) would streamline that.


(Simon Telephonics) #6

My opinion would be to set the default there in the section I mentioned. (new key in the freepbx_settings table, changeable in the Advanced Settings screen)

Then in the extensions part of the core module, use the default setting from the table rather than the hard coded value that is currently there.

Caveat: I am not a FreePBX core developer. I do not know whether this way of doing defaults is the current best practice. Evidently this is how it was done in the past.


(Sholinaty) #7

That is a great breadcrumb. I will investigate that later this week. Thank you for the ideas !


(TheJames) #8

(system) closed #9

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