Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

During a call any DTMF hangs up the call #188

Closed
psiderov opened this Issue · 27 comments

4 participants

@psiderov

Hi,

I have the following issue: During a call if I hit any dtmf the call is hung up immediately.

In the adhearsion.log: http://pastebin.com/nxhV9vVr
In Asterisk: http://pastebin.com/jMbs6gkY

Software used:
Adhearsion 2.0.1
Asterisk-10.0.5
punchblock-1.2.0
ruby-1.9.3-p194
rails-3.2.6

I have found a workaround by setting eventfilter in asterisk manager conf - eventfilter = !Event: Bridge*. But I need to know what is the root cause for this issue.

Also when I use execute "dial"... instead of dial there is no such issue.

Hope it is clear. Here goes another question maybe related to this: is there a way to add dial arguments in adhearsion 2. In the previous versions it was possible by :options as argument to dial (example: dial number, :for => timeout, :options => dialoptions, :caller_id => cid_num).

app_swift is not used.

Here goes part of the call controller code:

route_devices.each do |device|
    dial_devs << "SIP/#{device.number} "
end
last_dial_st = dial dial_devs, :for => peers[1].dial_timeout, :from => @cid_num

extensions.conf:

exten => _X.,1,AGI(agi:async)

asterisk debug information (please check if this is enough - core set debug 10, core set verbose 10. if not I will do it according to the posted instructions): http://pastebin.com/jdgmfy69

Regards,
Pavel Siderov

@benlangfeld
Owner

Please make sure you can still reproduce this with Adhearsion 1.2.1 and Punchblock 1.4.1.

@psiderov

I don't have a spare server to install Adhearsion 1.2.1. But I don't have this issue with 1.0.0.

@benlangfeld
Owner

Apologies, typo due to multi-tasking. I meant Adhearsion 2.1.1. You can just update your existing application. I'm not going to be able to justify spending time debugging an issue that may not be present in the latest release in the 2.x.x series.

@psiderov

Ben, I will try to update to 2.1.1 on test server later today.

Meanwhile I found that setting eventfilter = !Event: Bridge* causes issues. After hangup the script stops its execution and the following output can be found in adhearsion.log: http://pastebin.com/3mrS2J16 . This reflects to database connections. Every call opens a connection and it stays open after hangup.

Regards,
Pavel

@benlangfeld
Owner
@psiderov

As mentioned in the first message this was the only workaround I found for this issue.

Regards,
Pavel

@benlangfeld
Owner
@baldrailers

In addition to this. I'm using Adhearsion 2.1.2 with Asterisk 1.8, DTMF while on call still hang-up the call.

@psiderov

So the issue is present in 2.1.2 too.

@benlangfeld
Owner

I can't reproduce this. Can you provide the following?

1) The simplest call controller you can reproduce this with.
2) Details of how the endpoints involved connect to Asterisk.
3) Exact instructions to reproduce (who presses what keys at what point in the call).

@baldrailers

@psiderov let me take that back, i'm not having issues with DTMF in 2.1.2 anymore.

@psiderov

Hi,

1) last_dial_st = dial dial_devs, :for => dial_timeout, :from => @cid_num
where:
dial_devs is one or more numbers
dial_timeout = 30
@cid_num = some number
2) Endpoints
incoming call comes from another asterisk connected to phone network via pri
outgoing call goes to the same asterisk (mentioned above)
3) After the call is answered. It doesn't matter who presses what key. Tested with all numbers (0-9)

@baldrailers how you fixed it?

Regards,
Pavel

@benlangfeld
Owner

So, lets strip this down. Can you try each of the following things and check you can still reproduce?

  • Remove :from option to #dial
  • Remove :for option to #dial
  • Swap dial_devs for a single target rather than an array of targets

The simplest invocation is something like dial 'SIP/foo'. If you can still reproduce the issue with that, please provide full logs from your app, from the moment you start it to after you encounter the issue, and ensure that these are at TRACE level. Please also provide sip.conf.

I cannot find any evidence that Adhearsion is at fault in your reports so far. Your asterisk log indicates that an Unlink event is fired from Asterisk, which indicates to Adhearsion that the call is over. I don't see why this might be the case from those logs, but I suspect it is something at fault between your two asterisk boxes.

@psiderov

Ok, I will test according to the instructions.

About the Unlink fired from Asterisk: This is a normal behavior when dtmf is sent during bridge. After the unlink/link adhearsion hangs up the call.

@benlangfeld
Owner

Firing Unlink on DTMF is not a normal behaviour, and is a bug. Unlink indicates the end of a Bridge. How that is relevant to DTMF, I cannot fathom. I cannot reproduce Asterisk sending an Unlink on DTMF.

@benlangfeld
Owner

Ok, it turns out you were actually right. Asterisk is completely broken: https://issues.asterisk.org/jira/browse/ASTERISK-18639

Tongue in cheek asterisk-bashing solution: use a real soft-switch like FreeSWITCH.

I honestly have no idea right now how it is possible to smooth over this utter nonsense. Suggestions welcome.

@benlangfeld
Owner

For now, I guess follow Terry's suggestion: "If Asterisk is not set to interpret dtmf features (for example by not having any dial options like t,T,w,W, etc.) then you will not see these events." I figure this means you have to disable dtmf features in features.conf. Perhaps @bklang can offer further suggestions here.

@psiderov

test call 1:
last_dial_st = dial 'SIP/00359888783873@192.168.1.65', :for => 30000, :from => '359888783777' http://pastebin.com/jGDHmbdj

test call 2:
last_dial_st = dial 'SIP/00359888783873@192.168.1.65', :for => 30000
http://pastebin.com/hah1QJGX

test call 3:
last_dial_st = dial 'SIP/00359888783873@192.168.1.65', :from => '359888783777'
http://pastebin.com/2qtvWmm6

test call 4:
last_dial_st = dial 'SIP/00359888783873@192.168.1.65'
http://pastebin.com/7tu15LvA

The issue was reproduced in all tests. Several seconds after the call is answered I hit any number and the call gets disconnected. I have some logic before the dial command but at last exactly what I have pasted is dialed. Here goes the sip.conf: http://pastebin.com/cxnUM58s

@psiderov

@benlangfeld please check my features.conf http://pastebin.com/M7NHEmHK

@psiderov

@benlangfeld So the issue is present on every Adhearsion 2.x + Asterisk installation, right?

@benlangfeld
Owner
@psiderov

Ok, so I fixed the issue by setting the dtmf mode to inband. I get warning messages:

[Sep 25 11:00:13] DEBUG[7229]: res_rtp_asterisk.c:1498 create_dtmf_frame: Sending dtmf: 53 (5), at 192.168.1.65:19034
[Sep 25 11:00:13] DEBUG[7229]: chan_sip.c:7580 sip_rtp_read: Ignoring DTMF (5) RTP frame because dtmfmode is not RFC2833

but the call is not disconnected. Some kind of a workaround.

Regards,
Pavel

@baldrailers

@psiderov setting dtmf=rfc2833 works as well. But still depending on your VoIP provider if your using one, but rfc2833 is standard.

@benlangfeld
Owner

I don't know what we can do about this other than keep on at the Asterisk guys about how their logic is broken. I wonder if this is going to be fixed in Asterisk 12 with the changes to masquerades and such. I'm going to ping them again.

@benlangfeld
Owner

If anyone would like to assist in chasing this, you may do so here: https://issues.asterisk.org/jira/browse/ASTERISK-18639#comment-201518

In this scenario, Asterisk is drunk at the wheel, and I'm afraid Adhearsion can do nothing to rectify the situation. You may wish to check out FreeSWITCH if this is an issue for you.

@polysics
Owner

For the moment, I will have to +1 FreeSWITCH usage. Let's hope it gets looked at.

@benlangfeld
Owner

This is fixed in Asterisk 12, which Punchblock will more fully support shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.