Addition to dialplan.agi

I think the dialparties.agi is responsible for connecting the inbound call to the xtn that answered it. It also logs the event and shows debug info in the console.

I would like it to do one more thing.

I would like it to use netcat or similar to send the inbound phone number to a predetermined ip address.

So a call comes in to a ring group and all phones ring.
One phone answers the call
Asterisk knows the caller number and the xtn number that answered it
Asterisk connects the trunk to the extention
addition Asterisk netcat’s the caller number to an IP address

That’s all. Is this something I can do? I guess changes here would be overwritten during an upgrade, but that’s ok.

It feels like it should just be one single line of code, I just dont know where to start, tips and comments greatly appreciated.

the concept’s about right, but the the logic can get a bit complicated depending on the ring strategy. Also - dialparties doesn’t ultimately make the call, it still returns ti macro-dial for the final call to be made. So - another approach, which may also help from being overwritten, is to redefine the macro-dial context and write you won agi script that takes the extensions to be dialed and does what you want first, then dials them.