[Home]

Summary:ASTERISK-16686: [patch] GET DATA problem with pipes
Reporter:Maciej Krajewski (jamicque)Labels:
Date Opened:2010-09-16 09:34:09Date Closed:2010-10-06 08:50:35
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Resources/res_agi
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) 20100926__issue18001.diff.txt
( 1) getdata.log
( 2) streamfile.log
Description:Hi, I'm using TTS sofware to generate audio files and play them in real-time via asterisk. To do this I'm creating pipes to which asterisk is listening and to which TTS is generating audio.

When I use AGI command STREAM FILE, everything is ok, generated audio is played to the caller.
However, if I use GET DATA command, I can not hear the audio file. I'm using GET DATA to gather entered DTMFs. This solution worked in older version of asterisk (1.4.21 I guess).

Beneath I paste logs from console (verbose and debug on 100) from both cases.

****** ADDITIONAL INFORMATION ******

STREAM FILE

 == Using SIP RTP TOS bits 136
 == Using SIP RTP CoS mark 4
 == Using SIP VRTP TOS bits 136
 == Using SIP VRTP CoS mark 4
 == Using UDPTL TOS bits 136
 == Using UDPTL CoS mark 4
   -- Executing [300@CALLEX:1] GotoIf("SIP/test002-00000001", "0?3") in new stack
   -- Executing [300@CALLEX:2] Set("SIP/test002-00000001", "__ORGDEST=300") in new stack
   -- Executing [300@CALLEX:3] AGI("SIP/test002-00000001", "agi://127.0.0.1/script.agi") in new stack
   -- AGI Script Executing Application: (Set) Options: (CHANNEL(language)=pl)
   -- AGI Script Executing Application: (Answer) Options: ()
   -- AGI Script Executing Application: (Wait) Options: (1)
[2010-09-16 16:08:49] WARNING[32397]: file.c:467 ast_filehelper: File /tmp/1284646128.1.31.sln detected to have zero size.
   -- Playing '/tmp/1284646128.1.31' (escape_digits=1234567890) (sample_offset 0)
   -- Remote UNIX connection disconnected
   -- Remote UNIX connection

GET DATA

 == Using SIP RTP TOS bits 136
 == Using SIP RTP CoS mark 4
 == Using SIP VRTP TOS bits 136
 == Using SIP VRTP CoS mark 4
 == Using UDPTL TOS bits 136
 == Using UDPTL CoS mark 4
   -- Executing [300@CALLEX:1] GotoIf("SIP/test002-00000002", "0?3") in new stack
   -- Executing [300@CALLEX:2] Set("SIP/test002-00000002", "__ORGDEST=300") in new stack
   -- Executing [300@CALLEX:3] AGI("SIP/test002-00000002", "agi://127.0.0.1/script.agi") in new stack
   -- AGI Script Executing Application: (Set) Options: (CHANNEL(language)=pl)
   -- AGI Script Executing Application: (Answer) Options: ()
   -- AGI Script Executing Application: (Wait) Options: (1)
[2010-09-16 16:10:07] WARNING[851]: file.c:467 ast_filehelper: File /tmp/1284646205.2.18.sln detected to have zero size.
   -- AGI Script Executing Application: (Hangup) Options: ()
   -- <SIP/test002-00000002>AGI Script agi://127.0.0.1/script.agi completed, returning -1
   -- Executing [h@CALLEX:1] NoOp("SIP/test002-00000002", ""po AGI ===================="h" "300"") in new stack
   -- Executing [h@CALLEX:2] Hangup("SIP/test002-00000002", "") in new stack
 == Spawn extension (CALLEX, h, 2) exited non-zero on 'SIP/test002-00000002'
      > [INSERT INTO cdr (clid,src,dst,dcontext,channel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) VALUES ('"test002" <*>','*','300','CALLEX','SIP/test002-00000002','AGI','GET',8,8,'ANSWERED',3,'test002','1284646205.2')]
Comments:By: Paul Belanger (pabelanger) 2010-09-16 13:10:12

A full debug log (you only have verbose) and a sample .agi script would help us triage the issue.

---
We require a complete debug log to help triage the issue.

This document will provide instructions on how to collect debugging logs from an Asterisk machine for the purpose of helping bug marshals troubleshoot an issue:

http://svn.digium.com/svn/asterisk/trunk/doc/HOWTO_collect_debug_information.txt

By: Maciej Krajewski (jamicque) 2010-09-21 03:39:11

Hi,
I've uploaded the logs:
getdata-not working
streamfile- working

The agi is using asterisk-java and is using functions:
getData(java.lang.String file,long timeout,int maxDigits)
streamFile(java.lang.String file,java.lang.String escapeDigits)

By: Leif Madsen (lmadsen) 2010-09-21 13:28:24

Hmmm, says file is detected to have zero size. Have you verified that the file does indeed contain data? What happens if you use a file that has already been generated prior to the use of the script (i.e. a file from /var/lib/asterisk/sounds/en/)?

By: Maciej Krajewski (jamicque) 2010-09-21 17:30:20

it plays it nice (already generated file).
The point is that this file is generated realtime by TTS (that's why I use pipes).
And the strange thing is that using streamFile it works fine - beside the console warning the file is played by asterisk. However using getData disconnects the call without playing the file.

By: Maciej Krajewski (jamicque) 2010-09-22 13:53:52

And yes, the pipe contain data, but the thing with pipes is that the are filled with data only if something on the other end reads the pipe.
Stramfile seems to cope with it very well, getData not :( (I remind that in Asterisk 1.4.21 it worked fine).

By: Maciej Krajewski (jamicque) 2010-09-23 13:52:24

should I deliver any more info?

By: Maciej Krajewski (jamicque) 2010-09-25 20:07:39

I've downgraded my asterisk to 1.4.19.2 and on this version getdata works fine with pipes.



By: anuin (anuin) 2010-09-26 03:24:16

I did have a very similary issue when I upgraded from 1.4 to 1.6. It took me a few days to find out the problem, just thought I would scrap it here if it helps you.
I was testing the new server(asterisk 1.6) at home behind NAT, where as the old one with 1.4 was a hosted server. I got it resolved by setting 'externip', 'localnet' and 'nat = yes'.

Faisal

By: Maciej Krajewski (jamicque) 2010-09-26 04:56:47

Thank for reply. However it's not the case. I use nat=yes to all my peers and friends all the time and I define externip and localnet.
The problem I've described is not caused by network problems. As I heve already written if I use stramfile AGI command everything is ok. Using getdata there is no sound.
The described problem is only related to pipes. Normal audio files are played correctly.

By: Maciej Krajewski (jamicque) 2010-09-26 12:32:38

It works thanks.

By: Leif Madsen (lmadsen) 2010-10-04 11:57:35

Assigned and marked as Ready for Review as the reporter states the patch works for him.

By: Digium Subversion (svnbot) 2010-10-06 08:48:29

Repository: asterisk
Revision: 290575

U   branches/1.6.2/main/file.c

------------------------------------------------------------------------
r290575 | tilghman | 2010-10-06 08:48:28 -0500 (Wed, 06 Oct 2010) | 8 lines

Allow streaming audio from a pipe.

(closes issue ASTERISK-16686)
Reported by: jamicque
Patches:
      20100926__issue18001.diff.txt uploaded by tilghman (license 14)
Tested by: jamicque

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=290575

By: Digium Subversion (svnbot) 2010-10-06 08:49:20

Repository: asterisk
Revision: 290576

_U  branches/1.8/
U   branches/1.8/main/file.c

------------------------------------------------------------------------
r290576 | tilghman | 2010-10-06 08:49:20 -0500 (Wed, 06 Oct 2010) | 15 lines

Merged revisions 290575 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
 r290575 | tilghman | 2010-10-06 08:48:27 -0500 (Wed, 06 Oct 2010) | 8 lines
 
 Allow streaming audio from a pipe.
 
 (closes issue ASTERISK-16686)
  Reported by: jamicque
  Patches:
        20100926__issue18001.diff.txt uploaded by tilghman (license 14)
  Tested by: jamicque
........

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=290576

By: Digium Subversion (svnbot) 2010-10-06 08:50:34

Repository: asterisk
Revision: 290577

_U  trunk/
U   trunk/main/file.c

------------------------------------------------------------------------
r290577 | tilghman | 2010-10-06 08:50:34 -0500 (Wed, 06 Oct 2010) | 22 lines

Merged revisions 290576 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
 r290576 | tilghman | 2010-10-06 08:49:19 -0500 (Wed, 06 Oct 2010) | 15 lines
 
 Merged revisions 290575 via svnmerge from
 https://origsvn.digium.com/svn/asterisk/branches/1.6.2
 
 ........
   r290575 | tilghman | 2010-10-06 08:48:27 -0500 (Wed, 06 Oct 2010) | 8 lines
   
   Allow streaming audio from a pipe.
   
   (closes issue ASTERISK-16686)
    Reported by: jamicque
    Patches:
          20100926__issue18001.diff.txt uploaded by tilghman (license 14)
    Tested by: jamicque
 ........
................

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=290577