Any way to disable module signature checking for an individual module?

Not quite. An extension would be Goto(from-internal,1234,1), and you could do the same thing with a ring group - the ‘from-internal’ context is where phones send their requests to.

This gets slightly more complex if you’re using Class of Service of Extension Routes, but that’s the idea. Actually, ring groups have their own context ‘ext-group’, so you could bypass the from internal context if you DID have CoS or ER, and Goto(ext-group,600,1) … but I’m probably over-complicating things :sunglasses:

So lets say you wanted to run an AGI before every call that every extension dials.

You set their context to be ‘custom-extdial’ or something, and then in extensions_custom.conf add this:

[custom-extdial]
exten => _X.,1,NoOp(Entered extdial with ${EXTEN})
exten => _X.,n,AGI(/your/agi/script.agi)
exten => _X.,n,Goto(from-internal, ${EXTEN}, 1)

That’s just it, I want to go to the correct entry point for a destination, so everything works as it should. Also, this is used for calls coming from the outside, so I would hope that sending a call to from-internal at that point would not be any kind of security risk. Right now the destination of the inbound route is the Dialplan Injection, so I just wonder if by that point the system has done all the security checking it needs to do, in order to make sure an incoming caller can’t hop onto an outgoing trunk and make calls. Assuming that I don’t do something really stupid that gives them such access, that is.

For now I’ll wait until you get back and we can talk more about this. Thank you very much for your help.

Then I’d set the incoming context to something different - ‘from-pstn-prehack’ or something. Do your stuff in that context, and then send it to from-pstn. Then you don’t need to even care about destinations, you just do it through the GUI.

I do stuff like this all the time… For example, a common thing is that I want people to be able to push ‘redial’ to call back an external number that called them. But the caller ID needs to have an extra zero added to it, so they go out the right route.

So in the Dadhi incoming trunk, rather than ‘from-pstn’ I set the context to ‘change-callerid’ and do this:

[change-callerid] exten => _.,1,Set(CALLERID(num)=0${CALLERID(num)}) exten => _.,n,Goto(from-pstn,${EXTEN},1)

Then I don’t need to -ever- care about module changes, as that will always work forever. And it’ll upgrade painlessly for the foreseeable future.

I wanted to wait until you were back from your holiday to continue this, but in this case the added dialplan has to be run after the Inbound Route dialplan has run. So the Dialplan Injection is the destination of an Inbound Route, and then the destination of the Dialplan Injection is an extension or ring group or whatever. To be more specific, it has to run after any caller ID lookups have taken place.

As I said before, “If there were a page were you could pick a destination from the standard destination dropdown and it would show you the equivalent destination written out, that would be a huge help.” I’m wanting to send the call to the correct place, as it would go when the Destination Picker is used, as opposed to some generic place that may or may not work as expected. I have done what you suggest in other situations, where intercepting the call immediately after it comes in on the trunk is appropriate, but in this particular case that won’t work.

Anyone who has tried to marry custom code with FreePBX call handling has struggled with how to re-enter the GUI at a specific destination after the custom code has run.

The best method to exit GUI call flow is to use the “Custom Destination” module to send the call to the user defined context in extensions_custom.conf. The best way I have found to re-enter the GUI flow is to create a Misc Application/Misc Destination pair and use the feature code created by this in the final line of the custom code block like this:

exten => s,n,Goto(from-internal,<feature_code>,1)

This adds a few steps to the process, but gives maximum flexibility and prevents reliance on using internally defined FreePBX contexts which may change at some future point.

So this morning while I was reading the cereal box, I thought to myself, what if the Custom Destination module was changed to use the Asterisk Gosub command instead of the Goto command, and also allowed the user to select a FreePBX destination once the code block returned back? The user would have the ability to add a Return line to their block of code (if they wished) and the best part is that I’m pretty sure it would have no affect on present users of the Custom Destination module, since a Gosub without a corresponding Return should behave the same as the present Goto behavior.

1 Like

lgaetz, I wonder if you could perhaps take a moment and explain to Rob why any American would have to be crazy to sign that licensing agreement. I don’t know if you and he communicate outside the forum, but he just doesn’t seem to understand that what you have to agree to in order to get a licensing key creates a tremendous amount of legal exposure for any United States resident, and I cannot imagine anyone that actually reads the terms of that thing agreeing to it. Andrew had said that you didn’t want to sign for the modules in POSSA and after I read what you’d be agreeing to I don’t blame you a bit, but I don’t think Rob fully appreciates how screwed up the American legal system is.

I’m not necessarily suggesting you have that discussion here in the forum, but he just seems not to get why that thing is so bad for Americans, and perhaps you could enlighten him.

Have you ever reviewed a SSL Cert ToS. Module signing is just like SSL Certs for your website and they have all the exact same language. Its what our attorneys based our agreements off of as it was the closest thing to what we are doing.

I don’t own a company and am not associated with one. Corporations (especially large ones) can afford to take chances that individuals cannot, due to legal exposure. If a corporation gets sued, they have attorneys that know how to fight such a suit, and they usually have the resources to pay if they lose. And even if the lawsuit forces the company into bankruptcy, chances are none of the executives are going to lose their homes or their life’s savings, because that’s what having a corporation is all about - no personal exposure.

But an individual user of FreePBX should not be asked to sign such a document and put himself or herself at risk just because he or she wants to use a third party module that has been around for quite some time. I have never obtained a SSL Cert because I have never needed to, and I certainly would not agree to those ToS, especially if I had to hand over my personal information to the company or organization or whatever so they could easily find me if they wanted to sue me. It might be a lot different if I had a corporation and lawyers, but I don’t.

The fact is that nobody in the open source community, except Schmooze/Sangoma, treats contributors like this. Corporations have a way to shelter their legal exposure. Short of bankruptcy, individuals do not. Whether it’s evil or not is quite beside the point. Suppose Digium required indemnification for anyone that contributed to the Asterisk project. Suppose Digium barred competitive products (like Sangoma boards) from using the Asterisk platform in the same way that Schmooze/Sangoma bars commercial modules from using FreePBX. Look in the mirror, boys. You may not see the choir boys you paint yourselves to be.

I’m gonna pipe in here being the guilty party who wrote the original Custom Destinations module. First, a minor history lesson …

Many moons ago there was simply the ability to type in a custom destination as freeform text, no need for a custom destination module or anything of the sort. As FreePBX evolved, we added the destination integrity capability. What this means is, the ability to detect that a module was sending a call to a destination which no longer exists. (e.g. you point to an IVR from your inbound route, and then go delete the IVR). When we added this, it posed a problem because we had no way of knowing if a freeform destination existed or not. As such, I decided to add the Custom Destination module which gave you the ability to ‘register’ a destination that you would normally put into extensions_custom.conf. This is still not invulnerable since, you can go delete it from that file and we won’t know, but it did two things. It gave you some control of putting that destination into FreePBX and then using it as a select box option throughout your call flow.

Adding this module solved two problems. It allowed you to identify these destinations so you didn’t get false triggers about ‘orphan’ destinations, and it allowed you to access these destinations as select box choices. It didn’t solve the problem you are struggling with, which is, how do you get BACK into the module call flow from your custom dialplan without having to know the cryptic format of each destination. Even if you do know that format, what happens if things change … you end up with very fragile code.

It seems to me there is a simple solution to this. In addition to having a Custom Destination, why not add the feature of having a custom Subroutine? The best way to think about this is if you imagine a module like the Language Module. This is a super simple module that you can point to, have it set the channel’s language (in a freeform textbox) and then point to the subsequent destination after it’s done. So effectively, you would give it the name of a subroutine, we would call that subroutine which you would place in extensions_custom.conf, and then in your dialplan, you simply call ‘Return()’ and it comes back to our module and goes on to the subsequent destination that you have chosen just like any other module.

This seems to be the natural solution. It could be either implemented as yet another menu item of "Custom Subroutines’ or alternatively, we could enhance Custom Destinations with a radio button indicating whether this is a Destination or a Subroutine, and if the latter, we would simply present the common destination select boxes that you could choose from, otherwise they would be hidden.

It would seem like that would address your issue of how to get back and in general, provide a much more integrated way of adding custom dialplan. This would largely give you what you are getting from Dialplan Injection with a few differences:

  • You will have to use some editor to write your dialplan in extensions_custom.conf as a subroutine vs. doing it in textarea in the module. Some probably consider this a negative, personally, I really appreciate using syntax highlighting in the editor of choice when writing dialplan as it helps catch typos and other errors.
  • You get the benefit of proper Destination Registry integrity checking if we did this, since I am pretty sure that Dialplan Injection was written before the days that we had this and was never modified to add this in. (Don’t hold me to this, I haven’t gone and checked the module in a few years, but that is what I recall.)

So … thoughts on this?

1 Like

Adding support for Gosub to the Custom Destination module is exactly what I was getting at in my post above, tho you did a much better job explaining it. I don’t see any downside to this and I’m not even sure it is necessary to distinguish between Gosub and Goto since they pretty much accept the same arguments.

@plindheimer and I have had a chat about this - It appears that this will solve @editor’s problems in a nice and flexible way. I think this’ll be a BETTER solution that what I proposed above… @editor it was your request - would that be suitable?

1 Like

I somehow missed your post and yes, that is exactly it. However, I wouldn’t use GoSub() in place of GoTo(). I agree that without a Return() used on existing installations it should generally act identical. However, I could imagine the potential for subtle differences, probably in very rare situations. Therefore, my inclination would be to default to GoSub() with a destination but have the option of GoTo() and migrate existing setups to GoTo() since that is what they are doing now.
@editor … do you have any thoughts on this. Would you see this “fully” replacing your need for Dialplan Injection or is there something else missing here?

That would work great for me. I don’t at all mind placing my bit of dialplan in extensions_custom.conf. As you noted, the problem with the current implementation of Custom Destinations is …

Which is exactly the problem I’ve been struggling with here. Your proposed solution would solve that problem, and then I would not need to use Dialplan Injection.

[quote=“xrobau, post:34, topic:28261”][quote=“lgaetz, post:33, topic:28261”]
Adding support for Gosub to the Custom Destination module is exactly what I was getting at in my post above, tho you did a much better job explaining it.
[/quote]
@p_lindheimer and I have had a chat about this - It appears that this will solve @editor’s problems in a nice and flexible way. I think this’ll be a BETTER solution that what I proposed above… @editor it was your request - would that be suitable?[/quote]
Yes, sounds like a great solution to me! And sorry for not replying immediately, I was away for a day and just got back online.

Since no one has posted to this thread in several days, I was just wondering if the talk about modifying the Custom Destination module is something that might actually happen sometime in the near future, or if this was all just a theoretical discussion? I’ve seen updates to several modules in the last few days, but nothing for Custom Destinations. I didn’t expect immediate action or anything, but would be interested to know if this is something that’s actively being worked on, or that will be worked on in the next few days/weeks/months.

Do I need to submit a feature request or anything, and if so, how do I word it?

I’m not trying to rush anyone, just don’t want this to get lost among all the other things going on if it’s something that might actually happen sooner or later. Thanks!

It’s currently 4am. I’m in the Novatel Hotel at Brisbane Airport. In a couple of hours I’ll be flying to Seoul, and then from Seoul I’ll be flying to Toronto.

I have a full charge of battery, half a pack of nicotine gum, it’s going to be dark on the plane, and I’m wearing glasses.

(That was a pretty badly mangles Blues Bros quote, by the way. Sorry about that)

Anyway, I have like 30 odd hours of flying and I’m hoping that, by the time I emerge in Toronto, I’ll have it complete :sunglasses:

3 Likes

Thanks, Rob. Hope you have comfortable flights! Enjoy your time in Toronto, I haven’t been there in many years (last time was pre-9/11 when US citizens didn’t need a passport to go there) but it used to be a pretty interesting city, especially along parts of Yonge Street. :smile:

http://git.freepbx.org/projects/FREEPBX/repos/customappsreg/commits?until=refs%2Fheads%2Frelease%2F12.0

Stuff actually happened on the flight, amazingly!

(Edit: And that was the short one. Longer one tomorrow)

Hi Rob, glad you got to your destination safely. Just a couple notes on the new module. I tried installing it but I already had a couple of existing custom destinations that effectively end the call, so I didn’t have to worry about re-entering the dialplan with them, and they did not appear in the new module. Reverting to the original module showed they were still in the database, but the revised module didn’t seem to recognize them for some reason. Other weird thing was that the destinations dropdown ONLY showed one destination, and it was (of all things) the Dialplan Injection that we are trying to replace. None of the other destinations appeared for some reason. Perhaps I installed it wrong; I just downloaded the zip file and then used “Upload Modules” to get it into FreePBX, but it appeared to install correctly so I’m not sure. In case you are wondering, I am running FreePBX 12.0.57.

Just thought you might want the feedback. Since it is the middle of the day here and I don’t want to mess with the system too much until later in the evening, I’ll just leave you with those two observations for now, so perhaps you can check those things the next time you have a chance to work on it. But do get out and enjoy Toronto while you have the chance!