Hi !
hope i find everyone in good health !
I am running asterisk 1.4 on my fedora core 6 system
and i intend to make a callback
The scenario :
I have to softphones on the same system (Xlite and EyeBeam)
Two sip peers 800 and 101
What I want To do :
is that,
I call on an extension [800] from my eyebeam phone
It waits and hangsup after the tone
then after the extension 800 automatically callbacks my 101 extension on the Xlite phone and asks for a card number or whatsoever..
m using php-agi to do so, but i dont know where i am going wrong ...
My config files are as,
| Code: |
[100]
type=friend
host=dynamic
dtmfmode=rfc2833
context=callback
username=100
[800]
type=friend
host=dynamic
dtmfmode=rfc2833
context=callback
username=800 |
EXTENSIONS.CONF
| Code: |
[callback]
exten => 800,1,Wait(1)
exten => 800/100,2,AGI(test.php)
exten => 800/100,3,HangUp
[callback-dialtone]
exten => s,1,Dial(SIP/@800:b)
exten => s,2,HangUp
|
and The Script
| Code: |
#!/usr/bin/php
<?php
ob_implicit_flush(true);
set_time_limit(0);
$err=fopen("php://stderr","w");
$in = fopen("php://stdin","r");
while (!feof($in)) {
$temp = str_replace("\n","",fgets($in,4096));
$s = split(":",$temp);
$agi[str_replace("agi_","",$s[0])] = trim($s[1]);
if (($temp == "") || ($temp == "\n")) {
break;
}
}
$cf = fopen("/var/spool/asterisk/outgoing/cb".$agi["callerid"],"w+");
fputs($cf,"Channel: SIP/".$agi["extension"].":".$agi["callerid"]."\n");
fputs($cf,"Context: callback-dialtone\n");
fputs($cf,"Extension: s\n");
fputs($cf,"SetVar: CALLERIDNUM=".$agi["extension"]."\n");
fputs($cf,"MaxRetries: 2\n");
fputs($cf,"RetryTime: 10\n");
fclose($cf);
fclose($in);
fclose($err);
?> |
Thanks
Quick replies will b highly appreciated
