Yate Community Forum
General Category => Yate users hangout place => Topic started by: xyswitchz on April 11, 2018, 06:59:09 PM
-
In regexroute on call.answered how to originate a separate new call ?
I tried but it does nothing
[call.answered]
^.*$=echo answered
^.*$=dispatch chan.masquerade;message=call.execute;callto=wave/play//usr/local/yate/audio.sln;direct=sip/sip:bruce@9.8.7.6;line=localsip
-
For chan.masquerade you need to indicate channel id to handle it in 'id' parameter.
If you need to re-execute the call it is useless to put the 'direct' parameter.
When the required call leg will masquerade the call.execute the target module (wavefile) will detect the request is from an existing call leg and will ignore the 'direct' parameter.
If you want to make a completely new call, unrelated to handled message you must enqueue/dispatch a call.execute message (not a chan.masquerade) with parameters listed in the post:
^.*$=dispatch call.execute;callto=wave/play//usr/local/yate/audio.sln;direct=sip/sip:bruce@9.8.7.6;line=localsip
-
thanks marian.
One more question How would execute a new call and place into directly in a conference room.
something like?
^.*$=dispatch call.execute;callto=conf/studio;direct=sip/sip:bruce@9.8.7.6;line=localsip
-
conference module does not support making outbound calls.
You need to connect the outbound call leg to conference after started.
You may use some call event to do it (e.g. answer).
You may also use an external script to do it.
Here is an example of javascript function to do it:
function makeCallConf(callto)
{
var m = new Message("call.execute");
m.callto = "dumb/";
m.direct = callto;
// TODO: Fill other params
if (m.dispatch()) {
// Connect outbound call leg to conference
var masq = new Message("chan.masquerade");
masq.message = "call.execute";
masq.id = m.peerid;
masq.callto = "conf/studio";
masq.enqueue();
}
}