Something I would love to see in Asterisk

I would love to see a new type of codec negotiation in asterisk for SDP based media negotioation(well, for SIP)

UA1 ----------------- channel A --------------------- Channel B ----------------UA2

U1 sends INVITE to CHANNEL A (no bridged channel)
CHANNEL A saves SDP (if directmedia=no rewrite contact IP and ports in SDP)
outgoing channel will be created
channel B takes SDP from CHANNEL A to build outgoing SDP to UA2 (if directmedia=no rewrite contact IP and ports in SDP)
UA2 sends 200 OK to CHANNEL B
CHANNEL B saves SDP (if directmedia=no rewrite contact IP and ports in SDP)
CHANNEL A uses SDP from CHANNEL B to create his 200 OK for UA1 (if directmedia=no rewrite contact IP and ports in SDP)

(Every Channel has to make sure that it rewrites SDP if directmedia=no.
the RTP ans RTCP could be forwarded per iptables for better performance.)

If neither of both channels saves SDP’s (i.e. if it isn’t a SIP Channel or this behaviour is deactivated per configuration) then asterisk should process as usual.

-All codecs would be supported.
-Asterisk will not transcode if both channels uses this option
-This isn’t restricted to SIP. In theory every SDP based protocol can use this.

Would something like this be possible ? What do you think ? Does anybody need this ?

ciao t0n1

Asterisk is designed to decouple the two user agent roles so that you can mix technology. Any violation of this makes the code complex, although it already does break this design principle for directmeida.

I understand that point. But i don’t think this is something complex.
And i really don’t like how one off the advantages of SIP is being eliminated. You could say it would be worth violating this principle for better adopting SIP.
I don’t need to say how important SIP is for asterisk.

This is different from directrtpsetup in chan_sip. directrtpsetup is way to complex (and still useless)