[Freeswitch-users] Lua not playing wav files

Peter Olsson peter.olsson at visionutveckling.se
Wed Aug 17 14:26:19 MSD 2011


The problem is that lua script is called before media is up, so you will need to get rid of that inline=true - I don't know how to do that though, since it's a dynamically generated dialplan.

/Peter


Från: freeswitch-users-bounces at lists.freeswitch.org [mailto:freeswitch-users-bounces at lists.freeswitch.org] För Yuriy Nasida
Skickat: den 17 augusti 2011 11:54
Till: freeswitch-users at lists.freeswitch.org
Ämne: Re: [Freeswitch-users] Lua not playing wav files

I was try it. There is no differents.


The issue  consists in that I get dialplan automatically through xml_curl + php (by intralanman).
I see it by means xml_curl_debug_on:

<action application="lua" data="$1" inline="true"/>

How can I disable "inline="true"" ?

In the mysql table created under the README from intralanman I see  field "type".  I can put "action" or "anti-action" only. How can I control "inline" parameter?

Many thanks to anyone who can help.
________________________________
Date: Wed, 17 Aug 2011 09:12:44 +0000
From: chrisbware at interfree.it
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Lua not playing wav files


try:



session:streamFile(message)

instead of

session:execute("playback", message)



-----Messaggio originale-----
Da: Yuriy Nasida <nasida at live.ru>
Inviato il: 16 Ago 2011 - 10:46
A: <freeswitch-users at lists.freeswitch.org>


Hi Freeswitch-users,

My simple lua script:

freeswitch.consoleLog("err","start hello.lua\n")
session:answer();
message = "ivr/ivr-enter_destination_telephone_number.wav"
session:execute("playback", message)
session:hangup();

Script looks fine I think, but FS doesn't play audio. If I use corresponding XML dialplan all work fine.


logs when I use lua:

2011-08-16 13:18:00.336003 [DEBUG] switch_core_state_machine.c:371 (sofia/external/79213777785 at 65.98.107.130:5080) State EXECUTE going to sleep
2011-08-16 13:18:00.336003 [DEBUG] switch_core_state_machine.c:364 (sofia/external/79213777785 at 65.98.107.130:5080) State ROUTING
2011-08-16 13:18:00.336003 [DEBUG] mod_sofia.c:147 sofia/external/79213777785 at 65.98.107.130:5080 SOFIA ROUTING
2011-08-16 13:18:00.336003 [DEBUG] switch_core_state_machine.c:77 sofia/external/79213777785 at 65.98.107.130:5080 Standard ROUTING
2011-08-16 13:18:00.336003 [INFO] mod_dialplan_xml.c:331 Processing unknown <79213777785>->inbound_type_uri in context public
2011-08-16 13:18:00.345157 [ERR] switch_cpp.cpp:1197 start hello.lua
2011-08-16 13:18:00.345157 [DEBUG] sofia_glue.c:4650 Audio Codec Compare [PCMA:8:8000:20:64000]/[PCMU:0:8000:20:64000]
2011-08-16 13:18:00.345157 [DEBUG] sofia_glue.c:4650 Audio Codec Compare [PCMU:0:8000:20:64000]/[PCMU:0:8000:20:64000]
2011-08-16 13:18:00.345157 [DEBUG] sofia_glue.c:2773 Set Codec sofia/external/79213777785 at 65.98.107.130:5080 PCMU/8000 20 ms 160 samples 64000 bits
2011-08-16 13:18:00.346166 [DEBUG] sofia_glue.c:4764 Set 2833 dtmf send/recv payload to 101
2011-08-16 13:18:00.346166 [DEBUG] sofia_glue.c:3014 AUDIO RTP [sofia/external/79213777785 at 65.98.107.130:5080] 65.98.107.130 port 26266 -> 212.232.72.134 port 49276 codec: 0 ms: 20
2011-08-16 13:18:00.346166 [DEBUG] switch_rtp.c:1623 Starting timer [soft] 160 bytes per 20ms
2011-08-16 13:18:00.347205 [DEBUG] sofia_glue.c:3276 Set 2833 dtmf send payload to 101
2011-08-16 13:18:00.347205 [DEBUG] sofia_glue.c:3281 Set 2833 dtmf receive payload to 101
2011-08-16 13:18:00.347205 [DEBUG] mod_sofia.c:681 Local SDP sofia/external/79213777785 at 65.98.107.130:5080:
v=0
o=FreeSWITCH 1313488814 1313488815 IN IP4 65.98.107.130
s=FreeSWITCH
c=IN IP4 65.98.107.130
t=0 0
m=audio 26266 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

2011-08-16 13:18:00.348214 [DEBUG] sofia.c:4761 Channel sofia/external/79213777785 at 65.98.107.130:5080 entering state [completed][200]
2011-08-16 13:18:00.348214 [DEBUG] switch_core_session.c:1939 Application playback Requires media! pre_answering channel sofia/external/79213777785 at 65.98.107.130:5080
2011-08-16 13:18:00.348214 [DEBUG] switch_cpp.cpp:618 CoreSession::hangup
2011-08-16 13:18:00.348214 [DEBUG] switch_cpp.cpp:988 sofia/external/79213777785 at 65.98.107.130:5080 destroy/unlink session from object
2011-08-16 13:18:00.348214 [DEBUG] switch_core_state_machine.c:364 (sofia/external/79213777785 at 65.98.107.130:5080) State ROUTING going to sleep"



========================================

logs when I use XML dialplan:

2011-08-16 13:19:49.609765 [DEBUG] switch_core_state_machine.c:371 (sofia/external/79213777785 at 65.98.107.130:5080) State EXECUTE going to sleep
2011-08-16 13:19:49.609765 [DEBUG] switch_core_state_machine.c:364 (sofia/external/79213777785 at 65.98.107.130:5080) State ROUTING
2011-08-16 13:19:49.609765 [DEBUG] mod_sofia.c:147 sofia/external/79213777785 at 65.98.107.130:5080 SOFIA ROUTING
2011-08-16 13:19:49.609765 [DEBUG] switch_core_state_machine.c:77 sofia/external/79213777785 at 65.98.107.130:5080 Standard ROUTING
2011-08-16 13:19:49.609765 [INFO] mod_dialplan_xml.c:331 Processing unknown <79213777785>->inbound_type_uri in context public
2011-08-16 13:19:49.615894 [DEBUG] switch_core_state_machine.c:364 (sofia/external/79213777785 at 65.98.107.130:5080) State ROUTING going to sleep
2011-08-16 13:19:49.615894 [DEBUG] switch_core_state_machine.c:371 (sofia/external/79213777785 at 65.98.107.130:5080) State EXECUTE
2011-08-16 13:19:49.615894 [DEBUG] mod_sofia.c:240 sofia/external/79213777785 at 65.98.107.130:5080 SOFIA EXECUTE
2011-08-16 13:19:49.615894 [DEBUG] switch_core_state_machine.c:157 sofia/external/79213777785 at 65.98.107.130:5080 Standard EXECUTE
2011-08-16 13:19:49.615894 [DEBUG] sofia_glue.c:4650 Audio Codec Compare [PCMA:8:8000:20:64000]/[PCMU:0:8000:20:64000]
2011-08-16 13:19:49.615894 [DEBUG] sofia_glue.c:4650 Audio Codec Compare [PCMU:0:8000:20:64000]/[PCMU:0:8000:20:64000]
2011-08-16 13:19:49.616902 [DEBUG] sofia_glue.c:2773 Set Codec sofia/external/79213777785 at 65.98.107.130:5080 PCMU/8000 20 ms 160 samples 64000 bits
2011-08-16 13:19:49.616902 [DEBUG] sofia_glue.c:4764 Set 2833 dtmf send/recv payload to 101
2011-08-16 13:19:49.616902 [DEBUG] sofia_glue.c:3014 AUDIO RTP [sofia/external/79213777785 at 65.98.107.130:5080] 65.98.107.130 port 23946 -> 212.232.72.134 port 49278 codec: 0 ms: 20
2011-08-16 13:19:49.616902 [DEBUG] switch_rtp.c:1623 Starting timer [soft] 160 bytes per 20ms
2011-08-16 13:19:49.617998 [DEBUG] sofia_glue.c:3276 Set 2833 dtmf send payload to 101
2011-08-16 13:19:49.617998 [DEBUG] sofia_glue.c:3281 Set 2833 dtmf receive payload to 101
2011-08-16 13:19:49.617998 [DEBUG] mod_sofia.c:681 Local SDP sofia/external/79213777785 at 65.98.107.130:5080:
v=0
o=FreeSWITCH 1313491243 1313491244 IN IP4 65.98.107.130
s=FreeSWITCH
c=IN IP4 65.98.107.130
t=0 0
m=audio 23946 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -
a=ptime:20
a=sendrecv

2011-08-16 13:19:49.619008 [DEBUG] sofia.c:4761 Channel sofia/external/79213777785 at 65.98.107.130:5080 entering state [completed][200]
2011-08-16 13:19:49.631344 [DEBUG] switch_ivr_play_say.c:1278 Codec Activated L16 at 8000hz 1 channels 20ms
2011-08-16 13:19:49.740067 [DEBUG] sofia.c:4761 Channel sofia/external/79213777785 at 65.98.107.130:5080 entering state [ready][200]
2011-08-16 13:19:52.879234 [DEBUG] switch_ivr_play_say.c:1648 done playing file
2011-08-16 13:19:52.880333 [NOTICE] switch_core_state_machine.c:189 sofia/external/79213777785 at 65.98.107.130:5080 has executed the last dialplan instruction, hanging up.


I have compared logs and saw that case without lua have some strings unlike case with lua.

"2011-08-16 13:19:49.615894 [DEBUG] switch_core_state_machine.c:364 (sofia/external/79213777785 at 65.98.107.130:5080) State ROUTING going to sleep
2011-08-16 13:19:49.615894 [DEBUG] switch_core_state_machine.c:371 (sofia/external/79213777785 at 65.98.107.130:5080) State EXECUTE
2011-08-16 13:19:49.615894 [DEBUG] mod_sofia.c:240 sofia/external/79213777785 at 65.98.107.130:5080 SOFIA EXECUTE
2011-08-16 13:19:49.615894 [DEBUG] switch_core_state_machine.c:157 sofia/external/79213777785 at 65.98.107.130:5080 Standard EXECUTE"


Many thanks to anyone who can help.


-------------------------------------------------------------------------------
Valore legale alle tue mail
InterfreePEC - la tua Posta Elettronica Certificata
http://pec.interfree.it
-------------------------------------------------------------------------------

FreeSWITCH-users mailing list FreeSWITCH-users at lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
!DSPAM:4e4b918432761631268876!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20110817/d04b9e5f/attachment-0001.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list