Direct RTP flow between endpoints with no NAT

Dear All,

Environment: Asterisk 11.4

I have been trying to achieve direct RTP flow between A party and B party, with no NAT.

I have been testing with:

  • SIP endpoints (Zoiper softphone 2.41)
  • H323 endpoint behind H323 trunk (ooh323)

I have been playing around with different combinations of the following parameters:

directmedia=yes/nonat
directrtpsetup=yes

But I am getting the same results:

  1. If a call is placed between 2 SIP endpoints registered with Asterisk, both A party and B party send RTP flow to the public IP of the other party (which stems, I think, by the fact that SDP info contains "c= IN IP4 "). My desired result is to get the RTP flow to go to the private IP of the endpoint.

  2. If a call is placed from the H323 trunk, the RTP goes to Asterisk server (“c= IN IP4 <asterisk’s ip>”), my desired result is for RTP to go directly to H323 client.

Do you have any ideas / suggestions ?

Thanks

KR
Gabriele Odone

Adding relevant configuration

============sip.conf============
[root@nancy asterisk]# cat sip.conf
;
; SIP Configuration for Asterisk
;

[general]
context=default
allowguest=no
;allowguest=yes
allowoverlap=no
bindport=5060
;udpbindaddr=0.0.0.0
udpbindaddr=10.100.202.88
tcpenable=no
tcpbindaddr=0.0.0.0
tlsenable=no
tlsbindaddr=0.0.0.0
tcpauthtimeout = 30
tcpauthlimit = 100
transport=udp
srvlookup=no
pedantic=yes

disallow=all
allow=ulaw
allow=ilbc

directmedia=yes
;directmedia=nonat
;directrtpsetup=yes

;
;— template for Mayah Endpoints
;
mayah-phone
type=friend
host=dynamic
qualify=yes
context=default
disallow=all
allow=ulaw

;
;— Mayah Endpoints
;
123450
; username=123450
defaultuser=123450
secret=Ab123456
123451
; username=123451
defaultuser=123451
secret=Ab123456
123452
defaultuser=123452
secret=Ab123456

==========extensions.conf===========
; extensions.conf - the Asterisk dial plan

[general]
static=yes
writeprotect=no
autofallthrough=yes
clearglobalvars=no

[globals]
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)
MAYAH0 => SIP/123450
MAYAH1 => SIP/123451
MAYAH2 => SIP/123452

[default]
;exten => 123450,1,Dial(SIP/123450)

exten => 123450,1,Dial(${MAYAH0})
exten => 123450,n,Hangup

exten => 123451,1,Dial(${MAYAH1})
exten => 123451,n,Hangup

exten => 123452,n,Dial(${MAYAH2})
exten => 123452,n,Hangup
[toTrunk]
exten => 661000,1,Dial(OOH323/10.71.0.55/${EXTEN})
;exten => 661000,1,Dial(OOH323/${EXTEN}@10.71.0.55)
exten => 661000,1,Hangup

exten => _XXX.,1,Dial(OOH323/10.71.0.55/${EXTEN})
exten => _XXX.,n,Dial(OOH323/${EXTEN}@10.71.0.55)
exten => _XXX.,n,Hangup