Yate server > Yate IVR

How to make calls from IVR to external phone number (PHP)

<< < (2/2)

jonathanv@rokk3rlabs.com:
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**

jonathanv@rokk3rlabs.com:
I change
yate.conf  --> modload=no. and the IVR not work  ???

Ioana Stanciu:
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

Monica Tepelus:
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.

Navigation

[0] Message Index

[*] Previous page

Go to full version