Cannot get directrtp work on Asterisk 11.7

Hi,

I am running Asterisk 11.7 and trying to setup direct media between the end points (Analog phones).
I tried directmedia = yes but it doesn’t seem to work. Please help

sudo cat /etc/asterisk/sip.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;
; This file is part of FreePBX.
;
; FreePBX is free software: you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation, either version 2 of the License, or
; (at your option) any later version.
;
; FreePBX is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with FreePBX. If not, see http://www.gnu.org/licenses/.
;
; Copyright © 2004 Coalescent Systems Inc (Canada)
; Copyright © 2006 Why Pay More 4 Less Pty Ltd (Australia)
; Copyright © 2007 Astrogen LLC (USA)

[general]
directmedia=yes

; These files will all be included in the [general] context
;
#include sip_general_additional.conf

;sip_general_custom.conf is the proper file location for placing any sip general
;options that you might need set. For example: enable and force the sip jitterbuffer.
;If these settings are desired they should be set the sip_general_custom.conf file.
;
; jbenable=yes
; jbforce=yes
;
;It is also the proper place to add the lines needed for sip nat’ing when going
;through a firewall. For nat’ing you’d need to add the following lines:
; nat=yes , externip= , localhost= , and optionally fromdomain= .
;
#include sip_general_custom.conf

;sip_nat.conf is here for legacy support reasons and for those that upgrade
;from previous versions. If you have this file with lines in it please make
;sure they are not duplicated in sip_general_custom.conf, if so remove them
;from sip_nat.conf as sip_general_custom.conf will have precedence.
#include sip_nat.conf

;sip_registrations_custom.conf is for any customizations you might need to do to
;the automatically generated registrations that FreePBX makes.
;
#include sip_registrations_custom.conf
#include sip_registrations.conf

; These files should all be expected to come after the [general] context
;
#include sip_custom.conf
#include sip_additional.conf

;sip_custom_post.conf If you have extra parameters that are needed for a
;extension to work to for example, those go here. So you have extension
;1000 defined in your system you start by creating a line 1000 in this
;file. Then on the next line add the extra parameter that is needed.
;When the sip.conf is loaded it will append your additions to the end of
;that extension.

sudo cat /etc/asterisk/sip_custom.conf

subscribe to Message Waiting

sip explicit mwi subscription: 1

local_secure
directmedia=yes

sudo cat /etc/asterisk/sip_general_additional.conf
;--------------------------------------------------------------------------------;
; Do NOT edit this file as it is auto-generated by FreePBX. All modifications to ;
; this file must be done via the web gui. There are alternative files to make ;
; custom modifications, details at: freepbx.org/configuration_files ;
;--------------------------------------------------------------------------------;
;

vmexten=5000
accept_outofcall_messages=yes
auth_message_requests=no
outofcall_message_context=dpma_message_context
disallow=all
allow=ulaw
allow=alaw
context=from-sip-external
callerid=Unknown
notifyringing=yes
notifyhold=yes
tos_sip=cs3
tos_audio=ef
tos_video=af41
alwaysauthreject=yes
useragent=FPBX-2.11.0(11.7.0)
directmedia=yes

sudo cat /etc/asterisk/sip_general_custom.conf
bindaddr=::
directmedia=yes
allowsubscribe=yes

SIP INVITE

Accept: application/reginfo+xml, application/rlmi+xml, application/sdp, application/simple-message-summary, application/watcherinfo+xml, application/xml, message/sipfrag, multipart/mixed
Via: SIP/2.0/UDP [2001:420:3045:2027::11:9c]:5060;branch=z9hG4bKe280af1962fe0330a;rport
Route: sip:asterisk3.chs.cisco.com;lr
Max-Forwards: 70
From: sip:5559029@asterisk3.chs.cisco.com;tag=14164786b6
To: sip:5559032@asterisk3.chs.cisco.com;user=phone
Call-ID: 5c6d0935c0b034ee
CSeq: 1290563711 INVITE
Accept-Encoding: identity
Accept-Language: en
Allow: ACK, BYE, CANCEL, INVITE, NOTIFY, OPTIONS, PRACK, REFER, SUBSCRIBE, UPDATE
Allow-Events: refer, vq-rtcpxr
Contact: sip:5559029@[2001:420:3045:2027::11:9c]:5060;transport=udp
Min-SE: 90
P-Preferred-Identity: sip:5559029@asterisk3.chs.cisco.com
Session-Expires: 1800
Supported: 100rel, answermode, early-session, eventlist, gruu, histinfo, path, replaces, tdialog, timer
User-Agent: dpc3939-P20-18-v303r204317-140806a-CMCST-TEST
Content-Disposition: session
Content-Type: application/sdp
Content-Length: 319

v=0
o=- 0 282574773616913 IN IP6 2001:420:3045:2027::11:9c
s=-
c=IN IP6 2001:420:3045:2027::11:9c
t=0 0
a=rtcp-xr:voip-metrics
m=audio 5006 RTP/AVP 0
c=IN IP6 2001:420:3045:2027::11:9c
b=AS:88
b=TIAS:64000
a=sendrecv
a=silenceSupp:off - - - -
a=rtpmap:0 PCMU/8000
a=maxptime:20
a=ptime:20
a=maxprate:50

Please try it without using FreePBX. The FreePBX dialplan almost certainly includes options that are incompatible with direct media. Even if it can be configured to permit direct media, that knowledge is in the FreePBX community, not the Asterisk community.

In any case, Asterisk will only request direct media as a re-invite unless you use directrtpsetup. The last time I checked, that feature was not officially supported. As such, showing just the initial INVITE proves nothing.

Thanks David, will do as suggested