Intercept calls before being placed

Hi,

I’ve only been working with Asterisk and FreePBX for a couple of weeks now. I’m working on a module which needs to intercept calls and possible redirect them. In looking at the dial plan, the best place for me to do this is in ext-local. Unfortunately I can’t just insert my code in there. I need to replace references to ext-local with references to my own context which depending on the result of my application may route the call to ext-local. The only way I can see to make this work is to modify the code for some of the other FreePBX modules to use my context instead of ext-local. For obvious reasons I don’t want to do this, but I see this has already been done by the findmefollow extension. So, my question is how do I insert myself into the call flow for example when usin the IVR module or any other module that calls ext-local?

Thanks
Rob

Have you seen:

—snip—
The extensions class provides a “splice()” method that allows a module to insert dialplan priorities into that created by another module.
—snip—

http://freepbx.org/trac/wiki/ModuleHooks

Ryan

On 7/26/06, iotarob <[email protected] ([email protected])> wrote:[quote] Hi,

I’ve only been working with Asterisk and FreePBX for a couple of weeks now. I’m working on a module which needs to intercept calls and possible redirect them. In looking at the dial plan, the best place for me to do this is in ext-local. Unfortunately I can’t just insert my code in there. I need to replace references to ext-local with references to my own context which depending on the result of my application may route the call to ext-local. The only way I can see to make this work is to modify the code for some of the other FreePBX modules to use my context instead of ext-local. For obvious reasons I don’t want to do this, but I see this has already been done by the findmefollow extension. So, my question is how do I insert myself into the call flow for example when usin the IVR module or any other module that calls ext-local?

Thanks
Rob

-------------------- m2f --------------------

Sent using Mail2Forum (http://www.mail2forum.com).

Read this topic online here:
http://www.freepbx.org/forums/viewtopic.php?p=1003#1003

-------------------- m2f --------------------


Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net’s Techsay panel and you’ll get the chance to share your
opinions on IT & business topics through brief surveys – and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV


Amportal-devel mailing list
[email protected] ([email protected])
https://lists.sourceforge.net/lists/listinfo/amportal-devel
[/quote]

Post generated using Mail2Forum (http://www.mail2forum.com)

Hey,

Sorry for the slow reply. Yes, I’m aware of the splice function. However, it does not allow you to splice in include statements.

Also, the IVR module, does not use the module hook framework to permit injection of custom form elements.

I did find a solution that will work for now. I just mess around with the $ext internal variables. It allows my module to work without changing the source. It’s not a kosher thing to do, but until the framework matures it will have to do.

Now, about the HTML modification on the IVR page. Dunno how to deal with that one yet.

Rob.