I’m trying to write a custom dialplan, the aim is to do the following:
- Staff Member calls into the asterisk server
-Enters a code
-asterisk calls PHP page (eg, example.php?code=CODEENTERED)
-php page returns a telephone number
-asterisk dials the number and connects the calls
-on hangup from either party the duration of the call is passed to a variable
-asterisk calls php page with the duration and the code as a variable.
First question, is this possible? Second Question, am I on the right track? I have not included any of the PHP calls yet, but just trying to detect the hangup, but I get an exited on non zero error.
exten => 0066,1,Answer()
exten => 0066,n,Read(UNREF,EnterRef,8) // 8 digit code entered
exten => 0066,n,Dial(******) //SipGate trunk
exten => h,1,Log(DEBUG,SOMONE HUNG UP) // detect hangup from either party
exten => h,n,Hangup() //is this needed?
Thanks in Advance!