PJSIP Channel - Direct Media "issues" when receiving 2 IPs on A Leg

Dear Community,

I’ve been working with Direct Media the last couple of days, and i noticed a behavior that “breaks” my VoIP infrastructure,

Currently, A Leg propagates 2 IPs for RTP Media,
And asterisk, with direct media enabled on A and B side, doesn’t actually send any of the A Leg IP addresses to the B Leg SDP information.

Meaning that Direct media isn’t working, and Asterisk is using RTP resources
I’ve read a bit of SDP RFC and it seems that there is no restriction in having multiple IP addresses between

o= IP A
c= IP B, IP C, IP D

If someone could give any advice it will be greatly appreciated
Warm Regards

hello Diego,
my request is off topic. please team me, which command or software do you use to get this type of graphical trace?


There is no way that that is compliant with RFC 4566. Multiple addresses are normally only used for multicast, and have to be either a group address or on multiple lines, in a media section.

Multiple addresses or “c=” lines MAY be specified on a per-media
basis only if they provide multicast addresses for different layers
in a hierarchical or layered encoding scheme. They MUST NOT be
specified for a session-level “c=” field

Asterisk only supports direct media for audio streams. It may well only do so for a single stream.

The only way you could have 2 IPs on the A leg, is if there is more than one media stream, in which case there will be an m= line between the c= lines.

Aterisk only uses direct media, if, amongst other things, it is not recording, not spying, and no feature codes are enabled.

thank you

Dear David,

Thanks for your reply, maybe i didn’t check RFC 4566,
Based on the shared screenshot, the Only IP that should be allowed for Direct Media is the one mentioned in the
parameter of the SDP session right?

Warm Regards

The o= lines is not used for routing. Only the c= lines.

Maybe that is the nature of your original misunderstanding; there is only one media address in your original packet capture, that ending in 238.197. The one ending in 104.58 is the address of the entity originating the SDP, not a media address.

There are lots of reasons why Asterisk will refuse to use direct media, including: call recording, and the need to see RFC 2833/4733, or inband, DTMF digits, for feature code activation.

Dear David,

Thanks for your reply,
I’m trying to understand why my Asterisk is not sending the A Leg RTP IP addresses to my B Leg SDP packets,
The shared screenshot has a single IP in the c= parameters
Do you know how can i debug this?

Warm Regards

Dear David,

Such basic “issue”…
ALeg Native Codec was different from BLeg side,
Debug information is really verbose

Thanks a lot!
Warm Regards