Yate Community Forum
Yate server => Yate IVR => Topic started by: jonathanv@rokk3rlabs.com on March 03, 2015, 04:33:34 PM
-
We found the following information related to how make call from IVR to external phone number:
- http://yate.null.ro/archive/?action=show_msg&actionargs%5B%5D=53&actionargs%5B%5D=53
- http://yate.null.ro/archive/?action=show_msg&actionargs%5B%5D=58&actionargs%5B%5D=14
We already made the changes mentioned in the links, but they are not working and they are not showing any logs information.
We create the following function to call.
function MakeCall($route) {
global $saved_ev;
$called = $saved_ev->GetValue("sip_from");
$partycallid = $saved_ev->GetValue("id");
$m = new Yate("chan.masquerade");
$m->params = $saved_ev->params;
$m->params["message"] = "call.execute";
$m->params["callto"] = "5717455171";
$m->params["id"] = $partycallid;
$m->Dispatch();
}
Can you help us with any ideas to resolve this, thanks in advance
-
Hi,
Callto is the resource to call not the phone number.
Ex: callto = sip/sip:404040@ip.port not just 404040. If you don't have this info in the script then you must send a call.route message and set in callto the retval of that message if it was handled.
To have logs: use "sniffer on" from telnet console.
-
Hi Monica, We try this option but not works .. other idea ? sorry but We need this functionality urgently, Thanks Monica....
-
Hi,
Please paste the relevant code a sniffer log.
-
This is how to enable message sniffer in yate
http://docs.yate.ro/wiki/Debugging_and,_or_Investigation_of_messages
-
Script:
function MakeCall() {
global $saved_ev;
global $partycallid;
$called = $saved_ev->GetValue("sip_uri");
$this->log->set(" partycallid -------> : " . $partycallid . "\n");
$m = new Yate("chan.masquerade");
$m->params = $saved_ev->params;
$m->params["message"] = "call.execute";
$route = "line/+5717455171";
$m->params["callto"] = $called; //"sip:5717455171@104.130.240.10"; //sip:5717455171@104.130.240.10
$m->params["id"] = $partycallid;
$m->params["line"] = "sapo";
$this->log->set(" params -------> : " . var_export($m, true) . "\n");
$m->Dispatch();
}
Log:
IVR::InitIVR()
login::OnEnter('')
login::OnEvent(incoming 'call.execute')
login::OnMessage('call.execute')
login::SetState('Welcome')
login::OnExecute()
login: Found table operation 'answered'
login::OnEvent(installed 'chan.dtmf')
login::OnEvent(setlocal 'id')
login::OnSetting('id','ivr/39518406654f8771a663351.72944684',true)
login::OnEvent(installed 'chan.dtmf')
login::OnEvent(installed 'chan.notify')
20150305153405.432564 <sip:WARN> SIP line 'sapo' logon failure 401: Unauthorized
20150305153906.394980 <sip:WARN> SIP line 'sapo' logon failure 401: Unauthorized
accfile.conf:
[sapo]
enabled=yes
protocol=sip
username=+57174551**
description=CLIENT SIP
;interval=600
formats=ulaw
authname=+57174551**
password=
number=+57174551**
-- I'm not sure this configuration ---
domain=voip.sapo.pt
registrar=voip.sapo.pt:5070
outbound=proxy.voip.sapo.pt
-----
localaddress=auto
regexroute.conf:
^\+571.*$=sip/sip:;line=sapo;caller=+57174551**
-
I change
yate.conf --> modload=no. and the IVR not work ???
-
Hi,
modload controls loading of modules. When you set it to no, no modules willl be loaded by the YATE engine unles it is specified in the [modules] section. So unless you specified extmodule.yate=yes in the modules section, your script will not load.
If you want a sniffer log, you either have to set 'msgsniff' setting to yes in yate.conf or you can activate it throug telnet through command "sniffer on".
Check these pages:
http://docs.yate.ro/wiki/Debugging_and,_or_Investigation_of_messages
http://docs.yate.ro/wiki/Debugging_in_Yate
http://docs.yate.ro/wiki/Rmanager
-
Hi,
Do you want to use the line registered in accfile?
If so see below:
function MakeCall() {
global $saved_ev;
global $partycallid;
$this->log->set(" partycallid -------> : " . $partycallid . "\n");
$m = new Yate("chan.masquerade");
$m->params = $saved_ev->params;
$m->params["message"] = "call.execute";
$route = "line/+5717455171";
$m->params["callto"] = $route;
$m->params["id"] = $partycallid;
$m->params["line"] = "sapo";
$this->log->set(" params -------> : " . var_export($m, true) . "\n");
$m->Dispatch();
}
Also, from your log it seems that line "sapo" is not registered. So make sure it's first registered before sending calls to it.