is from-internal-custom the wrong place? [SOLVED - sort of]

garrison
Posts: 9
Member Since:
2007-09-17

Shouldn't the following print FOO somewhere in /var/log/asterisk/full?

# extensions_custom.conf
[from-internal-custom]
exten => s,1,Noop(FOO)

I've tried [from-trunk-custom] and a bunch of others but I don't seem to be able to get FOO in anything other than Custom Applications I've registered in FreePBX.

What am I missing?



SkykingOH
Posts: 9541
Member Since:
2007-12-17
Check the console first,

Check the console first, turn debug up to 6 with 'set verbose 6' once you are sure you are hitting your extension you added then check the logging configuration. The problem is you don't want debug messages written to the disk they will grow huge.

If your intent is to write something to a file have a look at the system() command. You could simply append a line to the end of a file. All variables are available as an argument to this command.

--

Scott

aka "Skyking"



garrison
Posts: 9
Member Since:
2007-09-17
re: Check the console first,

I get exactly the same output on the console with `core set verbose 8` as in /var/log/asterisk/full. I frequently use Noop for debugging. Log files don't grow huge if you rotate them.

My intent is not to write to a file but to execute custom code on every incoming call, I'm using Noop so I don't have to worry that an error in my code is causing my current headache.

The bottom line is that the code in my top post isn't run, ergo something is broken or I'm ignorant of some critical piece of information. I've already been bit by the Custom-Application change in 2.6 so I'm inclined to assume ignorance.

While I'm on the topic is there a reference for major changes in 2.6?



SkykingOH
Posts: 9541
Member Since:
2007-12-17
This is the second thread

This is the second thread today that indicates from-internet-custom is broke in 2.6

This is very odd and worth investigating. There should be nothing in trix that breaks this core FreePBX functionality.

--

Scott

aka "Skyking"



garrison
Posts: 9
Member Since:
2007-09-17
closer...

I've sorted a few things out, posting here in case some fool like me stumbles across it ;)

FreePBX changes are at http://freepbx.org/trac/browser/freepbx/tags/2.4.0/CHANGES

Custom code for all inbound calls can go in [from-pstn-custom]

While [from-trunk] == [from-pstn] there is no [from-trunk-custom] which seems kind of odd if one reads the comments in extensions.conf

There are, however, contexts for [from-trunk-iax2-FOO-custom] and [from-trunk-sip-BAR-custom] where FOO is an IAX2 trunk and BAR is a sip trunk.

I still can't get [from-internal-custom] to do anything, nor does it seem to be called by anything interesting.



cvander
Posts: 637
Member Since:
2006-06-26
I ran into this problem

I ran into this problem while creating a unified directory and voicemail solution for my company. Here's the real bugaboo... FreePBX (or PBXSetting or Asterisk) only evaluates the -custom portions included after it has executed the entirety of the rest of the context, so if the call is terminated prior to the end of the context, the custom stuff is never evaluated... There's a couple of ways around it, I typically do a cut-and-paste from the standard context to the custom context and then do something either in FreePBX or just straight to the file to cause it to not do anything in the context except fall through to the -custom. You definitely have to be careful, but it can be done...

-Chris



garrison
Posts: 9
Member Since:
2007-09-17
p143 in the starfish book

After reading your post I've found it in the book:

"Asterisk will first try to match the dialed extension in the current context. If unsuccessful, it will then try the first included context (including any contexts included in that context), and then continue to the other included contexts in the order in which they were included."



cvander
Posts: 637
Member Since:
2006-06-26
Glad I could be of

Glad I could be of assistance.

-Chris



Comment viewing options

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