How to configure Direct RTP Calling

I´m trying to configure this scenario.

SIP Phone <----SIP------> Asterisk <-----G711 RTP---------> Industrial device.

When the Sip phone call to Industrial device Asterisk should:

  1. Run a command
  2. Begin to send RTP Packets from the SIP phone to Industrial device.
  3. Receive RTP packets from Industrial device and send to SIP phone.
  4. Run a command after hang up

How can i Configure Industrial device with Asterisk extensions?
It is posible to configure with FreePBX?

Thanks in advance.

I hope your picture better describes what you are trying to do than your statement of requirements.

It helps to understand that you almost never (and by almost never I mean there are almost always ways to avoid having to) call directly from one end device to another when using Asterisk.

So, in practice, you will pick up a phone and dial the extension of the ID. This will initiate a call from the phone to Asterisk, which will then connect your ID to Asterisk and bridge the two devices. This is the “standard” way of doing this, and is a well-understood set of process management steps.

The nature of the “RTP packets” (which are just audio tones, typically) will determine what kind of additional processing is required within the link. Note that these are part of your SIP call - you aren’t SIP on one side and RTP on the other - both connections have SIP and RTP. For most applications, the call should proceed normally and the RTP processing through Asterisk should be fine. As long as the RTP flows in both directions, the call will be maintained, so the “end event” that kicks of your mysterious “command” will have a hook to hang on.

This is all easily doable - you can do it through any number of “GUI only” methods, including mind-stretchers like recording the call and using the “post recording command” option to run your command or using a custom context specifically for the ID that runs a command for you once the call teardown is complete.

Asterisk is a Back-to-Back User Agent (B2BUA). This means that the endpoints connected to Asterisk know only of Asterisk. They have no idea if the other endpoint lives there or is “remote”.

Asterisk is always in the call/media path, even with directmedia or direct_media set to “yes”. Asterisk will remove itself from the RTP path, proxying it, but will interject itself right back into the path when needed (ie, IVRs, Voicemail, Playbacks, DTMF, etc).

This scenario is like any other scenario. The phone and the industrial devices are peers/endpoints on Asterisk. The phone will send a call to Asterisk and Asterisk will say “Oh this should go here” and send it to the other device and bridge the two channels together.

It doesn’t matter if one side is SIP or IAX or going out DAHDi. Asterisk will deal with it.

Just curious, what device are you connecting to?

The “Industrial Phone”, is a phone that not has SIP protocol, it has a proprietary protocol. To establish communication with the device i have to send a hexadecimal data to a ip, and after that the “industrial phone” begins to send and recive RTP packets to the IP I specified in the hexa command. To stop communications i have to send another hexa command to the phone IP.
My first option is develop a kind of SIP proxy to communicate to this devices, but maybe it is posible to configure asterisk, to avoid SIP negotation, and simply send a comand and begin to send RTP packets.
Thanks in advance.