Please let me know a command, where, I can call, announce to the receiver some information and connect the call and let the CONVERSATION DURATION LIMITED TO 1 min (One Minute) and then call ends there after one minute conversation.
Your dial command are messed up with [] and | and commas. Dial options use parenthesis not brackets, and if you are using versions >1.4 you use commas and not pipes
You can safely dial from the dial plan and not from the AGI, if you are using variables retrieved during the AGI execution just send it to the dialplan and avoid the script running until the call ends.
Dial(SIP/${EXTEN},L(60000:30000:10000)) and as @navaismo said, all this can be done directly from the Asterisk’ s dialplan, there is no needs to use any PHP agi
Case1:
$res = $agi->exec(“DIAL DAHDI/g0/$number2,12,mM|A(/home/ast6/$callerid/out1),L(30000:00000:00000)”);
Result: Play audio on callee side and Call DO NOT get cut at 30Secs
Case2:
$res = $agi->exec(“DIAL DAHDI/g0/$number2,12,mM,A(/home/ast6/$callerid/out1),L(30000:00000:00000)”);
Result: No audio playback on callee side and Call DO NOT get cut at 30Secs
Case3:
$res = $agi->exec(“DIAL DAHDI/g0/$number2,12,L(30000:00000:00000),mM|A(/home/ast6/$callerid/out1)”);
Result: No audio playback on callee side and Call GET CUT at 30Secs
I want both this, playback at callee side and call getting cut at 30 secs.
Can u please let me know how to write/ reconfigure this line.
Also, I am trying to explore from Dialplan, but as of now I need help in php AGI.