Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Asterisk as a SIP transit trunk - not sending reinvites?

Status
Not open for further replies.

ADB100

Technical User
Mar 25, 2003
2,399
0
36
GB
I am attempting to use Asterisk (FreePBX) as a 'transit' trunk between a service provider and an internal Cisco Call Manager. The reason for this is Call Manager cannot be a SIP endpoint - i.e. it won't register and the SP accounts are just simple SIP accounts.
I have everything working and inbound and outbound calls work OK, however the RTP media streams are not direct once the call is established. I understand that two calls are made - one between the Call Manager and Asterisk and another between Asterisk and the SP. However I thought that once both were established and assuming they both use the same codec Asterisk would issue reinvites and get the two endpoints sending RTP directly to each other. This just isn't happening.

Locally both the Call Manager and the Asterisk boxes are behind NAT but my NAT router supports SIP inspection so I have disabled NAT on Asterisk (or at least I think I have?) and have set the global reinvite behaviour to 'Yes'.

If I capture the traffic I can see the two calls being setup OK and Asterisk using its IP address as the endpoint. I have verified they are both negotiating the same codec (G.711 ALaw) but once both legs are established Asterisk never attempts to send reinvites.

Is there something I am missing?
Andy
 
I pulled this from here:
In general Asterisk supports 3 methods of media handling:

1. bridging: media (audio, video) is received on one channel, handed over to Asterisk's core, forwarded to the bridged channel, and sent out again.

2. native-bridging (see also below): if both bridged channels use the same technology then (WRONG! This is confused with P2P, see below) media can be bridged directly in the channel driver, no need to feed the media into Asterisk's core. For example SIP-to-SIP calls or DAHDI-to-DAHDI calls.

3. bypass: here, the media flow bypasses Asterisk directly. AFAIK this works only with SIP as channel technology. This comes in 2 flavors:

3a) During call setup the media will be forwarded via Asterisk. Once the call is set-up, Asterisk will send reINVITEs to both clients using the clients original SDP contact information. For this you must set canreinvite=yes (1.4) or directmedia=yes (1.6) in sip.conf. Of course Asterisk will initiate the direct media only if the media is not needed in Asterisk, e.g. if you monitor a call, the media will always be routed via Asterisk.

3b) Media will bypass Asterisk from the beginning. Therefore you have to set directrtpsetup=yes. This is still experimental and causes weird reINVITEs (e.g. after call setup to lock down on a certain codec or after call termination to redirect media to Asterisk before hanging up).

Both bypass modes Note only work if either there are no NATs at all, or the clients are behind the same NAT and do not use STUN.
 
Hi, thanks for the reply. I found that when I was troubleshooting originally with this and think I have covered everything -- Asterisk is not NAT'ing anything, my router is SIP aware and does the NAT'ing for it; the SIP headers are modified so Asterisk should not be aware any NAT is going on. I am forcing G.711 uLaw on both trunks (I have tried forcing ALaw and get the same results). I have configured 'directmedia=yes' and 'directrtpsetup=yes' for both trunks and Asterisk always stays in the media path.
The version of FreePBX I am running has some bug in the log viewing so I need to try and sort this out to see if I can tell from the logs why it is doing this.

Andy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top