RE: [PHP] Re: asterisk with php
| From: | hadi | Date: | Wed, 22 Jul 2015 20:21:40 +0000 |
| Subject: | RE: [PHP] Re: asterisk with php | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-325015@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Ashley Sheridan [mailto:ash@ashleysheridan.co.uk]
> Sent: Wednesday, July 22, 2015 10:50 PM
> To: hadi
> Cc: webmaster@jimginer.net; php-general@lists.php.net
> Subject: Re: [PHP] Re: asterisk with php
>
> On Wed, 2015-07-22 at 22:47 +0300, hadi wrote:
> >
> > > -----Original Message-----
> > > From: Jim Giner [mailto:jim.giner@albanyhandball.com]
> > > Sent: Wednesday, July 22, 2015 10:20 PM
> > > To: php-general@lists.php.net
> > > Subject: [PHP] Re: asterisk with php
> > >
> > > You could have pointed out the line that is giving you the problem.
> > >
> > > Also - your use of global is poor. It only happens if a certain
> > > condition happens, otherwise it won't be defined in that function
> > > that may be where the problem is. More importantly, you don't need
> > > a 'global' in the
> > main-line
> > > code. You need it in the function (at the
> > > beginning) to let the function know that you want to reference the
> > > $pin
> > var
> > > in use in the main-line code.
> >
> >
> > Hi Jim,
> >
> > The error happen in "$agi->exec_dial("SIP/$pin");"
> >
> >
>
> Hadi, you're still missing the line number and the code surrounding that that
> would give any of us a clue as to what the problem is.
>
> Please, please, please, try to give some of this sort of information when
> you're posting here asking for help :)
Hi Ash,
How are you hope your fine.
The error come to me via email, phpagi send the error via email. Unfortunately I deleted this
emails.
I will try to grap the hole massage and post it. meanwhile what happen this...
The error massage am getting this "Notice: Undefined variable: pin"
Here is my problem
I have function, am not able to pass variable to it..
When I do "var_dump($pin)" at the beginning of the function it show the variable correct.
But when I do "var_dump($pin)" after "$agi=new AGI();" it show nothing.
I think "$agi=new AGI();" it wipe out my "$pin" variable....
Here is my function
dialout($pin);
function dialout($pin)
{
$agi=new AGI();
$agi->exec_dial("SIP/$pin");
$Answeredtime = $agi->get_variable ("ANSWEREDTIME");
$agi->hangup ();
}