Regarding RTP relay (e.g. media proxy), and transcoding --

This topic has come up many times before in various forms, but I still have not found any obvious solution that's highly scalable and cheap (well sure, I can dream).  We have lots of customers behind various firewalls using various codecs.  Customers call each other (both parties behind firewall) and to/from carriers.

Certainly this is a common use-case.  What do you do?  What are best known practices?  Commercial media gateway, or open-source solutions?

We use both OpenSER and a custom B2BUA written against the NIST Java stack.  We need a way to transcode when needed.  Obviosly mediaproxy module is great, but doesn't transcode.

Ideally, what I'm looking for:

* at the point where our system determines that transcoding or rtp relay is needed, a media gateway is chosen based on network proximity (e.g.: 1/2 our customers are in the U.S., 1/2 in Brazil; should pick a media gateway accordingly to minimize network path).

* our system then signals the media gateway (mgcp?) to setup the channels, and modifies the SDPs in the SIP path accordingly.

* even more ideally: the media gateway signals our system with inband or rfc2833 dtmf events, plus rtcp reports when available.

I think Asterisk could be hacked to do this.

Does anyone know of a commercial product that's not too expensive?  Thoughts? Advice?

thanks,
--
Ryan Mitchell <rjm@tcl.net>
Telecom Logic, LLC
http://www.tcl.net