How do I slip custom lines into files?

sigmaz

Member
Joined
Dec 17, 2010
Messages
100
Reaction score
1
Hey gang here is a simple one for sure, But I just don't know the answer yet.

I have an extension on a remote server linked via IAX, Everything works properly no troubles there.

I want to send pages to this remote station as well as all of the other local stations.. Of course paging group 999 is used to blast pages locally and is defined in the [ext-page] context.

I created [ext-page-custom] in extensions_custom.conf and populated the following.
exten => 998,1,Answer
exten => 998,n,Macro(user-callerid,)
exten => 998,n,Set(_AMPUSER=${AMPUSER})
exten => 998,n,Set(_SIPURI=)
exten => 998,n,Set(_ALERTINFO=Alert-Info: Ring Answer)
exten => 998,n,Set(_CALLINFO=Call-Info: <uri>\;answer-after=0)
exten => 998,n,Set(_SIPURI=intercom=true)
exten => 998,n,Set(_DOPTIONS=A(beep))
exten => 998,n,Set(_DTIME=5)
exten => 998,n,Set(_ANSWERMACRO=)
exten => 998,n,Set(__FORWARD_CONTEXT=block-cf)
exten => 998,n,Page(IAX2/toJB-IAXpeer/731/a)

Now of course we all can plainly see that 998 will page the remote station 731, it says it right there..
But the only way I can get it to work with the 999 group pages is to manually add LOCAL/998@ext-paging-custom to the exten => 999,n,Page( line under the [ext-page] context..
This all works perfectly but we all also know that the file is rewritten on each change so then i need to re manually enter the info.

What is the best way to insert this only once.

This fix you provide will may help me with a custom queue issue I have.
Thanks!
jon
 
For each FreePBX config file, there is text file with the "custom" added to its name. You can place custom code in there and it won't be written over by FreePBX and will be used by the asterisk dial_plan.
 
I understand that and I'm sorry I posted so much up there..

I created my custom context in the extensions_custom.conf

its not really a question of how to create custom contexts, its more of how do I insert modifications into the existing ones?

for example
Code:
exten => 999,1,Answer
exten => 999,n,Macro(user-callerid,)
exten => 999,n,Set(_AMPUSER=${AMPUSER})
exten => 999,n,Set(_SIPURI=)
exten => 999,n,Set(_ALERTINFO=Alert-Info: Ring Answer)
exten => 999,n,Set(_CALLINFO=Call-Info: <uri>\;answer-after=0)
exten => 999,n,Set(_SIPURI=intercom=true)
exten => 999,n,Set(_DOPTIONS=A(beep))
exten => 999,n,Set(_DTIME=5)
exten => 999,n,Set(_ANSWERMACRO=)
exten => 999,n,Set(__FORWARD_CONTEXT=block-cf)
exten => 999,n,Page(LOCAL/PAGE701@ext-paging&LOCAL/PAGE702@ext-paging&...)
That is a portion of the default paging group [ext-paging] listed in the extensions_additional.conf

Although the context is set to include [ext-paging-custom] (located in extensions_custom.conf) how do I include the context in the paging activity?
I'm currently aciving this by adding &LOCAL/998@ext-paging-custom to the last extension to page on the page line.
Code:
exten => 999,n,Page(LOCAL/PAGE701@ext-paging&LOCAL/PAGE702@ext-paging&LOCAL/998@ext-paging-custom)
I figure I cant just do a exten => 999,2,Page(LOCAL/998@ext-paging- custom) in the [ext-paging-custom] context because that'll mess up the original context.... I'm confused

Do you see what I mean by slipping in custom lines in existing contexts?
I can either just keep manually changing it, or I need to figure out how to loop out into the custom context and then back.. Ugg...

Would the easy answer be to delete the paging group data from the contents of the [ext-paging] context, essentially just delete the paging groups from the gui and just do it all in the custom context?

thanks for looking at my post..
 
I guess it's not that easy...
The best solution is probably to create a custom page group and include all the extensions there..
OR.. I can create my custom page group to include the 999 group that way the 999 group can be changed on the fly no matter whats going on in the new one.

I'll simply remap my intercom buttons to the new page group and use the gui to create the regular simple groups.
 
Actually it is that easy --

Remember that the first declaration of a context is the live declaration, and if you want to include code you can..

So if you look at extensions_additional.conf you will see that most of the contexts begin with an include so you can add code at the top of any of them just be very careful of the Goto constructs that you don't build a loop.

But if you want to replace a context entirely you need to place it in extensions_override_freepbx.conf which is included before extensions_additional.conf in the base extensions.conf file as extensions_custom.conf is actually included after extensions_additional.conf.

Just remember that context definitions are FIFO..

-------------------------------
 

Members online

Forum statistics

Threads
26,688
Messages
174,412
Members
20,259
Latest member
Fadeek86
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Back
Top