[Freeswitch-users] Example of playing background music

Alex Lake alex at digitalmail.com
Thu Mar 20 16:41:52 MSK 2014


Is it possible in Lua to do something like....


playback_uuid = GetTheUuidFrom(session:execute("bgapi uuid_broadcast 
<a-leg uuid> nicemusic.wav"))

Then do some stuff on the b-leg

Then

session:execute("uuid_kill "..playback_uuid)

When I've tried it, I get....

2014-03-20 12:27:07.474905 [INFO] switch_cpp.cpp:1288 exec_async 
uuid_broadcast 4b0faa1a-6898-438a-8099-8c09eff7d1b0 
local_stream://moh...  (dmpx_r27s1_bleg.lua 
uuid:ddde917b-d9df-44b1-9b33-2b46d639f100 [?])
2014-03-20 12:27:07.474905 [DEBUG] switch_core_media_bug.c:532 Attaching 
BUG to sofia/internal/0001302 at 004-0095.sb12.dmclub.org
2014-03-20 12:27:07.474905 [DEBUG] switch_core_session.c:1151 Send 
signal sofia/internal/0001302 at 004-0095.sb12.dmclub.org [BREAK]
2014-03-20 12:27:07.474905 [INFO] switch_cpp.cpp:1288 ...exec_async 
returning +OK Job-UUID: 88727341-5d44-4631-a69a-368df85ebdf0
...
...
2014-03-20 12:27:11.244906 [INFO] switch_cpp.cpp:1288 dmExec uuid_kill 
88727341-5d44-4631-a69a-368df85ebdf0
2014-03-20 12:27:11.244906 [INFO] switch_cpp.cpp:1288 ...dmExec 
returning -ERR No such channel!


I can only presume I've got the wrong end of the stick on these 
asynchronous jobs!

(BTW, dmExec is a wrapper around api:executeString)



Join us at ClueCon 2013 Aug 6-8, 2013
More information about the FreeSWITCH-users mailing list