[Home]

Summary:ASTERISK-20367: One-way audio with media_address
Reporter:Richard Kenner (kenner)Labels:
Date Opened:2012-09-06 11:03:14Date Closed:2012-11-27 17:23:07.000-0600
Priority:MajorRegression?No
Status:Closed/CompleteComponents:Channels/chan_sip/General
Versions:10.7.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:
Description:I'm migrating from Asterisk 1.6.2 to 10.7.0.  In 1.6.2, I made a small patch to allow specifying an address for RTP media.  That worked.  In 10.7.0, this appears to be built in with "media_address", but it doesn't work for me.

My Asterisk server has multiple addresses, all global address on two different /24's with different routing policies via BGP.  I'm connecting to a phone that's over NAT.  I have "nat=yes" in the "general" section of sip.conf.  Everything works fine with the default.

But if I specify media_address to be the Asterisk server's address on the other /24, I get one-way audio.  I can see with "sip debug" that the proper address is being given in the SDP data.  Audio from the phone is fine. Audio *to* the phone starts out with maybe 1-2 seconds of very garbled audio, then goes quiet.

Running traceroute shows that data comes from the phone *to* Asterisk on the desired /24, but goes out with a source address from the other /24 (the default address).  I'm not sure if this is the problem or not, but in any event, I think the source address for RTP should be the one in "media_address" and want it that way for my purposes anyway.  Is there a way to configure this to happen?  If not, where should I look to make a patch?  And is this likely the reason for the one-way audio or is something else the likely cause?
Comments:By: Rusty Newton (rnewton) 2012-09-14 09:38:46.899-0500

{quote}
Running traceroute shows that data comes from the phone to Asterisk on the desired /24, but goes out with a source address from the other /24 (the default address)
{quote}
Do you mean that the SDP the phone sends contains a media address from the other /24 ?

If I understand the media_address setting, it will only affect the media address for SDP outbound from Asterisk. It sounds like you want to affect the media address being sent *to* Asterisk by a phone. I may be failing to understand what you wrote.

Can you provide a sanitized sip.conf, plus a packet capture (a tcpdump pcap if possible) of the SIP and RTP traffic for all legs of the calls. We'd like to look at a bit closer to make sure it's expected behavior.


By: Richard Kenner (kenner) 2012-09-14 16:07:07.828-0500

Let me try to clarify.  I'll call our primary network the "205 network" from the first octet.  The network that I want to use for RTP is the "207 network".  The interface's primary address is the 205 network.  All SIP data goes on that network.  With media_address set, the SDP entry contains the 207 network.  RTP packets from the phone come back on the 207 network and there's no problem with them.  Packets *to* the phone go out from the 205 network.  I'm not saying this is "wrong", but just that it's a possible explanation for the fact that, with the exception of the first second or so, the phone (an Aastra 6757i, which works fine without media_address) doesn't get them.

The relevant portions of sip.conf (all each phone has is fullname and md5secret) is:

[general]
nat=yes
qualify=yes
allowguest=no
alwaysauthreject=yes
realm=asterisk.gnat.com
sendrpid=yes
trustrpid=yes
videosupport=yes
usereqphone=yes
callcounter=yes
directmedia=no
qualifyfreq=240
defaultexpiry=600
;media_address=207.xx.xx.xx

[phones](!)
type=friend
host=dynamic
context=SIP_Phones
cc_agent_policy=generic
cc_monitor_policy=generic
disallow=all
allow=gsm
allow=ulaw
allow=g729

I can attach a packet trace, but is it still needed given the above?

By: Rusty Newton (rnewton) 2012-10-01 17:56:49.382-0500

Richard, thanks for the clarification. From talking with developers here at Digium it's apparent that the described behavior for media_address is expected, but it doesn't mean that it is optimal. There is not a way currently within Asterisk to change bind address for RTP or the address that we send RTP from.

We would speculate that the phone is expecting to receive RTP only from the address it is also sending to for that session.

To change the behavior would technically be a feature request, unless there is a spec that we are not following somewhere or another reason to call it a bug.

By: Richard Kenner (kenner) 2012-10-02 16:52:51.983-0500

As I said, I'm not sure if the return path issue is or isn't the problem.  It's a pretty common phone: an Aastra 6757i.  I believe that it's a NAT issue.  I'm seeing it with my router, which is a normal consumer-level router, but other people in the company also reported this when I made the change and they, presumably, are using a different consumer-level router.  So it's not sensitive to the exact choice of router.  But I do think it's a NAT issue.  Unfortunately, I'm not as familiar as I'd like to be with the whole SIP/NAT interaction stuff.

By: Rusty Newton (rnewton) 2012-10-31 20:52:00.508-0500

For several years working support on Asterisk systems, 99% of one-way audio issues I saw were NAT and firewall related.

As far as we can tell from your description, the media_address option is working as expected.

I'd recommend discussing the issue on the asterisk-users mailing list and pastebin-ing some packet traces for others to look at. Hopefully someone can look it over and help with the audio path back to your phone.

By: Rusty Newton (rnewton) 2012-11-27 17:23:07.718-0600

Closing this, because as far as we can tell this is not a bug. Feel free to contact a developer in #asterisk-bugs on irc.freenode.net if you find further information that would lead you to believe this is a bug, then the issue may be re-opened.