Directrtpsetup - Asterisk sends "invite" instead of "bye"

Hello,

I am using Asterisk 1.6.2.7 and am experiencing the exact same issue as this user. Note that this user reported the issue in 2006 with an Asterisk 1.2 machine, so the attached patch may not be suitable for my system.

issues.asterisk.org/jira/browse … y-tabpanel

I have directrtpsetup=yes in sip.conf. Works great, asterisk doesn’t do any media. But the biggest issue is that when a caller hangs up, instead of me seeing a “BYE”, I instead see a “INVITE”. This causes the call to run in the background without my authorization, and continue to charge me for the leg of the call.

Would anyone know what I can do here? Or maybe it is safe to apply this patch to my version of asterisk?

Thanks
Below is an example
Note that the “reinvite” does not occur on 100% of phone calls. I am not too sure what the factors are to get it to work and to fail, but here is an example of a failed hangup. Also note that the Hangup command in extensions.conf successfully executes, and I never have this issue with directmedia set to ‘no’.

pastebin.com/ctbMmAEX

Notice at the very end, it should be sending a BYE instead of a INVITE:

<--- SIP read from UDP:65.14.12.9:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 184.106.2.2:5060;branch=z9hG4bK4fed5876;rport
From: "2124092233" <sip:2124092233@184.106.2.2>;tag=as34bbca20
To: <sip:7187542233@65.14.12.9>;tag=3BCA998-2442
Date: Sat, 11 Feb 2012 01:45:00 GMT
Call-ID: 04479a15082a42ea765d0d39388d7fbc@184.106.2.2
CSeq: 105 INVITE
Allow-Events: telephone-event
Server: Cisco-SIPGateway/IOS-12.x
Content-Length: 0

Anyone? :smiley:

I thought that directrtpsetup was disabled some time ago because it was buggy.

On the calling side, a re-invite is certainly possible before a BYE, because the bridge code doesn’t know whether the dialplan will continue. On the other hand, I thought your case was for the called side.

If it is enabled in current versions, it is a rarely used feature. On the other hand I find it very difficult to believe that it doesn’t eventually send a BYE. I would want core show channels and sip show channels to confirm that the channel had been closed and to see whether the sip_pvt structure was still present (it will be kept for some time to allow responses.

I think I would also want SIP history on end of call to be enabled.

If there is a real bug, this is the wrong place to report it.

I think your cisco gateway is misconfigured. See the 2 packets coming from port 50394.
You should probably flip the NAT settings for Cisco on Asterisk and/or on Cisco itself.

Problem is, the Cisco is my customer. Can’t really make adjustments unless I can do it from asterisk side. Plus my main carrier uses Cisco as well and I experience a similar issue. Carrier will definitely not make any changes on my behalf. I will see what I can do though. If anyone has any suggestions please let me know. I will be posting full logs as per david55’s request in the next day or two.