[ previous ] [ next ] [ threads ]
 To :  martin martin <acevedoma@h...>, yate@v...
 From :  Maciek Kaminski <maciejka@t...>
 Subject :  Re: [yate] About ... Call.Execute
 Date :  Thu, 01 Sep 2005 11:48:43 +0200
martin martin napisał(a):

> Hello, I would like to implement a script with the external module. 
> The script should receive a call.execute and generate another call to 
> destintation( like a proxy) but if destintation isn´t available the 
> script should call another number like an ivr mail box(the ivr says 
> the number is not available .....) , how can I build this in php ? I 
> need some basic sample code....
> I made a script, When a call.execute is arraived (ex: h323 phone calls 
> a number and there is a route to the script "router.php" in 
> regexroute.conf for this number) I generate another call.execute 
> message within the script to the destination and the destination rings 
> and then the communication is established with the called phone but 
> the caller is disconnected, How can I bind these two calls? the 
> incomming and the outcomming call... Is it possible?

In extmodule, incomming calls get connected to extmodule internal 
pseudochanell. When You do call.execute from extmodule script to another 
channel, this internal pseudo channel gets connected to another channel 
and incomming channel gets disconnected automaticly.

I think that You should do a channelless, high priority extmodule script 
in the following manner:
1. on incomming call.execute rewrite its callto parameter with another 
phone number, remember, the callid
2. wait for call.disconnected with that callid or call.answered, if call 
is disconnected do call.execute to ivr with chan.masquerade.

I think that this should work.