Getting incoming caller ID

I’m trying to get my * box to send caller ID info for all incoming calls (irrespective of which trunk the call comes in on) to my HTPC (which is running YAC to receive the info). I have the dialplan code which will accomplish this, but don’t quite know where in my dialplan to put it where FreePBX won’t nuke it when I make a change. The line I need to add is:

exten => s,1,System(/bin/echo -e -n “’@CALL${CALLERID(name)} ~${CALLERID(num)}’” | nc -w 1 htpc 10629)

This works wonderfully when I put it in extensions_additional.conf in the [macro-user-callerid] context, but FreePBX rewrites extensions_addtional.conf with every change made. Can I put the code somewhere else where FreePBX won’t nuke it?

See this page:

Pay special attention to the part AFTER the module install instructions. Maybe you can use the same workaround. You’d use your line for extension ****525 (or whatever) instead of the line shown in the example.

I will also call attention to the paragraph at the bottom:

“I do wish there were a better way to insert some custom code into the FreePBX generated dial plan, that would fire off a custom dialplan fragment just prior to ringing an extension. That would not only be useful for this application, but probably for several others where you might want to do something special just before an extension rings. I’m aware that you can modify the dialplan if you create a module; p_lindheimer (one of the developers) said, “…you can splice a line in to the dialplan. Take a look at pinset module, you will see how it splices a call to it’s own macro in the outbound route macros, or I think cidlookup does the same into ext-did. It would require writing a simple module to do what you want but that is not really all that hard.” Well, it might not be hard for some people, but it would be impossible for me (I have only a VERY limited knowledge of Perl, none at all of PHP, and don’t have a clue how a module is constructed - I know you can view module code easily but unless I’m told exactly what I’m looking at, it usually makes no sense at all to me). My point is, if you have the knowledge that I lack, there are much better ways to accomplish this, but until someone creates a module (or ANYTHING better than what I’ve described), the above is the only way I know how to do it, particularly with the client on a Mac computer.”

It would be SOOOO easy for the devs to give us a hook for custom code in the generated dialplan, and obviously there’s a need for it. Hope maybe they’ll consider it someday soon.