Confused, so many SIP conf files in new FreePBX/Trixbox

cityguru
Posts: 233
Member Since:
2006-06-02

So I have the new Trixbox with the new FreePBX and now I have almost 4 or 5 SIP conf files. I am so confused, I need to enter some information manually such as

external ip address command
internal ip address / subnet command
context

Now I see in SIP additional or something similar there is a from-sip-external command, I need this to be from-trunk, however anything I put in here gets overwritten

So where do I put from-trunk where it wont be overwritten?
Second question is if lets say sip.conf is not being overwritten (which i do not know if it is or isnt yet) then if I put in from-trunk into there then is there a problem having context=from-trunk in one file and then context=from-sip-external in another file (since this will always be generated by the system), so does this create a conflict?

And really the most important question is where do I place the external and internal ip information for when I am behind a router as well as this context=from-trunk? which filename

FYI, to whoever created this new structure it specifies not to enter manual commands in sip.conf as well as sip_additional.conf but then states this should be entered in the web configuration interface, I have not seen anywhere in the Freepbx or Trixbox web interfaces to specify any of this

Thanks in advance



SkykingOH
Posts: 9678
Member Since:
2007-12-17
sip_nat.conf is not

sip_nat.conf is not overwritten and is included in sip.conf

The files ending in custom IE: extensions_custom.conf can be modified.

That should get you on your way.

Scott

--

Scott

aka "Skyking"



eoo
Posts: 448
Member Since:
2006-10-30
there is a problem which I

there is a problem which I opened a freePBX ticket for a few weeks ago that you cannot control thinks like the address and bind port without it being overwritten the next time you "click the redbar". [http://www.freepbx.org/trac/ticket/2747] there are parameters that are currently being set in sip_additional.conf which belong elsewhere. there are workarounds, such as manually editing sip.conf and then marking it read only or manually editing the template files that freePBX uses to generate sip.conf each time. neither are particularly good but sometime, you have to do something or you are just plain stuck.



philippel
Posts: 700
Member Since:
2006-05-31
sip_nat.conf remains in

sip_nat.conf remains in there for compatibility sakes. Otherwise the includes follow the logical order of the sip.conf structure. You should not have to do any of the un-natural acts that eoo mentions. The sip configuration parameter assignment takes on the value of the last setting so you can override values in the sip_additional.conf file. (It's the opposite to how extensions.conf files are parsed). For special settings that can take on multiple values, such as codecs (allow=), you can 'reset' them all with directives like 'disallow=all' followed by your new set of values.
If there are some corner case issues that have been effected because of the fluid nature that Asterisk can sometimes take from version to version, then by all means open up a new ticket on our tracker for us to look at. In the case of the above mentioned ticket, I have tested bindaddr and allow/disallow for codecs on 1.2 and 1.4 and they appear to operate as always. You can always double check with 'sip show settings' at the CLI to see what values have been taken.
We go over these sort of details in the Open Telephony Training Seminar - Next Seminar, May 20-23 in Las Vegas along with much other advanced material in case you are interested in getting a much deeper understanding of this space.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Apr 27-29, Huntsville, AL



JRayfield
Posts: 38
Member Since:
2008-04-20
I, too, am having problems

I, too, am having problems with this.

I need to enter:

nat=yes
externip=external ip address
localnet=local ip/netmask

I have done this, manually, in the sip_general_additional.conf file, which works fine....until I create another new extension, at which time, this file (sip_general_additional.conf) is overwritten with the original 'default' information and my additions are lost.

Where else can I put the necessary information, where it won't be overwritten?

Oh, and sip_nat.conf is not anywhere to be found.

John



SkykingOH
Posts: 9678
Member Since:
2007-12-17
Phillipe, Thanks for the

Phillipe,

Thanks for the clarification. I never looked at the include order in sip.conf, until now.

I see the sip_nat.conf is second.

From a "best practices" perspective should I be using sip_additional.conf? That would seem to let me peacefully coexist with FreePBX.

With this in mind who has control of sip_custom_post.conf?

Scott

--

Scott

aka "Skyking"



philippel
Posts: 700
Member Since:
2006-05-31
if it has _additonal in the

if it has _additonal in the name, don't touch it. If it has _custom in the name, you can edit it. The _post version is a very special case file and is unlikely you would ever need it. It is there for people who want to add values to auto-generated extension contexts as there exists a notation for sip.conf that lets you append to an already existing sip section definition.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Apr 27-29, Huntsville, AL



JRayfield
Posts: 38
Member Since:
2008-04-20
I think I fixed my

I think I fixed my problem...

I created a sip_nat.conf file and uploaded it to the etc/asterisk folder.

Does this sound like a good 'fix'?

John



cityguru
Posts: 233
Member Since:
2006-06-02
Thanks for everyones

Thanks for everyones response, it would seem the way to go is with the custom file

However there is still the remaining question of context

We already have context defined in sip_additional.conf however what about putting context=from-trunk in this custom file, can we have context defined in two places? If so does one take precedence over the other or can we define two context=xxxx fields?

The point is again that even if we find a file which wont overwrite itself, sip_additional.conf will always have context=from-sip-external and thats problematic for some that need from-trunk specified instead.



philippel
Posts: 700
Member Since:
2006-05-31
the context directive is

the context directive is simply a default value. Every extension and trunk should have it defined to override the default. The only left that will use that value is an anonymous sip call from a system who is not known to FreePBX/Asterisk. If you want to change this to something else, change it in the sip_general_custom.conf file as you do other general settings. However - keep in mind that leaving it set to 'from-sip-external' will continue to allow you to direct whether you allow anonymous sip calls from the General Settings tab. If you allow them, the call gets sent on to from-pstn anyhow.

--

Philippe Lindheimer, FreePBX® Project Leader
http://freepbx.org - #freepbx on irc.freenode.net
http://freepbx.org/forums - The FreePBX® Forum
OTTS Training - Apr 27-29, Huntsville, AL



SkykingOH
Posts: 9678
Member Since:
2007-12-17
Quote: f it has _additonal
Quote:
f it has _additonal in the name, don't touch it.

Sorry Phillipe, that was a typo, I did mean _custom.

citiguru wrote:
We already have context defined in sip_additional.conf however what about putting context=from-trunk in this custom file, can we have context defined in two places? If so does one take precedence over the other or can we define two context=xxxx fields?

The first set of brackets is the new context from a sip.conf perspective.

The include refers to the context in the extensions.conf world

You can do all sorts of interesting things, if you look at each context in extensions_additional.conf (don't edit it) you will see the first line of every context is an include. This include is unreferenced, you can use it in the custom file to extend that context.

Example:

To extend the functionality of the CID lookup script we can look at the FreePBX code:

[cidlookup]
include => cidlookup-custom
exten => cidlookup_return,1,LookupCIDName
exten => cidlookup_return,n,Return()

So if we add the following to extensions_custom.conf

[cid-lookup]
exten => s,n,Playback(My-Message)

This would playback My-Message and then return to the original context.

Does this make sense?

Scott

--

Scott

aka "Skyking"



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.