Yate Community Forum
Yate server => Other Yate server issues => Topic started by: attank on August 22, 2014, 12:29:56 PM
-
Hello,
I am trying to play file to conference when user joined but no success...
I do not know how to create utility leg and play file to it (I am getting usually "Conference call with no call endpoint"...)
Thanks in advance for any help.
/*
* conf.js
*/
function onMessage(msg)
{
if (msg.event == "joined")
{
playFile(msg, "/usr/local/yate/sounds/conference/8000/conf-alone.alaw");
}
}
function playFile(msg, file)
{
// how to play ???????????????...
}
Message.install(onMessage, "chan.notify", 50);
-
Hi,
You play a file with chan.attach
http://docs.yate.ro/wiki/Chan.attach
Depending on the scenario you might need to send it inside a chan.masquerade.
http://docs.yate.ro/wiki/Chan.masquerade
I'm not sure how your javascript works. You must first make sure the javascript script is started and sees the relevant messages for the conference.
-
Thanks for reply
/*
* conf.js
*/
function onMessage(msg)
{
if (msg.event == "joined")
{
Engine.output("=====================================================================" + msg.id);
playFile2(msg, "conf-alone.alaw");
}
}
//
// <WARN> Wave override 'conf-alone.alaw' attach request with no data channel!
//
function playFile1(msg, file)
{
var m = new Message("chan.attach");
m.room = "conf/" + msg.room;
m.override = "wave/play/" + file;
m.single = true;
m.dispatch();
}
//
// No error messages
//
function playFile2(msg, file)
{
var m = new Message("chan.masquerade");
m.message = "chan.attach";
m.room = "conf/" + msg.room;
m.override = "wave/play/" + file;
m.single = true;
m.id = msg.id;
m.dispatch();
}
Message.install(onMessage, "chan.notify", 50);
Javascript works as i see debug output. When i am trying "chan.attach" i am getting "<WARN> Wave override 'conf-alone.alaw' attach request with no data channel!"
when "chan.masquerade" - nothing happend.
-
Start sniffer and check the various messages and their parameters. See what is the appropriate message and parameter you need. If you can't tell post the log.