Summary:ASTERISK-17108: call files: Calls get stalled during stream_file, asterisk "hangs up" without hanging up
Reporter:Håkon Nessjøen (haakon)Labels:
Date Opened:2010-12-15 02:27:19.000-0600Date Closed:2011-06-07 14:00:58
Versions:Frequency of
Description:I created a outgoing call with an agi that were to do the following:

1. Play informative message
2. Record message (nothing gets recorded)
3. Play menu for handling message (asterisk bails out here after a few ms)

If I use this AGI when calling _in_ to asterisk there is no problems.
But if I use a call file and put it in /var/spool/asterisk/outgoing, the following happends:

The message is not really recorded to the file, and when exiting "record message" with #, it starts to play the menu message, but after just 100ms or so, it suddenly stops transmitting audio.
The next peculiar thing that happens is that asterisk tries to hang up the call when the file is done playing, but the call stays up.

I have tried this with the following scenarios:
1. call file channel: Local// which calls via DAHDI
2. call file channel: DAHDI
3. call file channel: SIP to telco
4. Rewrite entire agi in a much simpler form
5. Change audio files played with other working ones.
6. Call file Application: agi
7. call file Context which runs agi
8. call file channel, SIP to another server with the script as incoming agi.
9. Tried to move everything to another server

All the mentioned tests have been done, and the result is always the same.
I have tried this with 1.6.1.x and, and also 1.8.x.

I can't figure out how this even happens over SIP to the external machine. But it seems like asterisk doesn't like to record on an outgoing call leg. Somehow, it is different to asterisk if its an incoming call, or of it is an outgoing call via AGI.


record_file does not create the file, even though it returns with 200 result=1.
The record format is "wav"
Comments:By: Håkon Nessjøen (haakon) 2010-12-15 03:08:56.000-0600

Even this simple extension script does the exact same thing:
The audio stops after about 100ms after Read() executes. Then when the audio should be done playing, it hangs up internally, but the call is still alive on my phone. Seems like asterisk loses control over the call while playing back.

exten => _X.,1,Answer()
exten => _X.,n(record_it),Playback(callrecord/welcome-record)
exten => _X.,n,Set(Filename=/tmp/${RAND()})
exten => _X.,n,Record(${Filename}.wav)

exten => _X.,n(read_menu),Read(menuanswer,callrecord/give-menu,1)

By: Håkon Nessjøen (haakon) 2010-12-15 04:05:48.000-0600

The message is recorded to the file. I was saying in the text that it doesn't, but that was wrong. Still, asterisk loses control of the call somehow. It does not successfully send audio or the hangup request to the channel in question.

By: Håkon Nessjøen (haakon) 2010-12-15 04:40:44.000-0600

Seems like stopping the recording with "#" is part of the problem.
I tried an agi with using "1" to stop the call instead, and it worked almost every time...

By: David Woolley (davidw) 2010-12-15 10:12:28.000-0600

What timing source are you using?

By: Håkon Nessjøen (haakon) 2010-12-15 10:31:11.000-0600

As far as I know; DAHDI, (sangoma card)

But I tried this:

*CLI> timing test
Attempting to test a timer with 50 ticks per second.
Using the 'timerfd' timing module for this test.
It has been 1000 milliseconds, and we got 50 timer ticks

Does this suggest that I am not using DAHDI as timing source?

By: Leif Madsen (lmadsen) 2010-12-16 10:53:16.000-0600

You are using the res_timing_timerfd module. Try using noload in modules.conf (or disable it in menuselect) and force res_timing_dahdi to be used.

By: Håkon Nessjøen (haakon) 2010-12-16 13:01:03.000-0600

Thanks it fixed the random-hangup problems I had when I started using "1" instead of "#" to save the message.

So the following problem persists:
1. Play file
2. Record audio
3. Stop recording with #
4. Play audio menu <-- Audio stops after about 100ms or something like that.

As I said, if I use for example the digit "1" to stop recording, it works fine.

By: Russell Bryant (russell) 2010-12-17 10:18:55.000-0600

Can you provide an example call file, as well as a log of the Asterisk console of a test call?

By: Leif Madsen (lmadsen) 2011-02-08 13:36:04.000-0600

Suspended. Requested information not provided.