SearchSearch  Log in to check your private messagesLog in to check your private messages  recent posts Recent Posts
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
djmeerOffline



Joined: Feb 12, 2009
Posts: 1

Status: Offline
Posted: Feb 12, 2009 - 09:45 AM Reply with quote Back to top
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 Smile
View user's profile Send private message


View previous topic Printable version Log in to check your private messages View next topic

Post new topic   Reply to topic
Forum Rules and Guidelines | About VoIP User | Privacy Policy


All logos and trademarks in this site are property of their respective owner.
Comments and posts are property of the poster, all the rest (c) 2003-2008 VoIP User Limited.

VoIP User Limited is incorporated in England and Wales under Company Number 6694577.

No part of this site may be reproduced without our prior consent.