[asterisk-users] PhpAgi call generation

Nitesh Divecha nitesh at vipernetworks.com
Tue Jul 31 09:08:11 CDT 2007


Hello All,

Can anyone help me with this... This is what my program does: -

1) At certain time the system generates a ".call" and make a call to User A.

2) When User A picks up the phone call, system will play a menu select 
option.
       a) Press 1 to call your supervisor.
       b) Press 2 to call your manager.
       c) Press 3 to leave a voice message.

3) When the User A press 1 to call his supervisor... The system has to 
put the User A on hold and place a call to the supervisor.

4) Once the supervisor picks up the call, User A has to be in session 
with his supervisor.

Now I have already got part 1 and 2 done... but I am stuck with part 3 
and 4.

This is how I generate my call to the supervisor: -
===================================
if($asm->connect())
{
    $call = $asm->send_request('Originate',
    array('Channel'=>"SIP/xo-out/$supervisor_num",
                'Context'=>'default',
                'Priority'=>1,
                'Callerid'=>$cid));
    $asm->disconnect();
}

One the *CLI I do see the call, but its failing: -

AGI Rx << STREAM FILE 
/var/spool/asterisk//tmp//text2wav_e08db16aede0af38ebb90a1c69ee19e3 "" 0
AGI Tx >> 200 result=0 endpos=26224
  == Parsing '/etc/asterisk/manager.conf': Found
  == Manager 'phpagi' logged on from 127.0.0.1
       > Channel SIP/xo-out-08f8ae10 was answered.
  == Starting SIP/xo-out-08f8ae10 at default,,1 failed so falling back 
to exten 's'
  == Manager 'phpagi' logged off from 127.0.0.1
AGI Rx << STREAM FILE goodbye "" 0

Can anyone put some light what I am missing here... Why the call is 
dropped on both end...?

Cheers,
Nitesh





More information about the asterisk-users mailing list