Dial DAHDI, CALL/CONVERSATION DURATION LIMITED TO ONE MINUTE

I am using phpagi and have the below command

$res = $agi->exec(“DIAL DAHDI/g0/$number2,20,mM|A(/home/ast6/$callerid/out1)”);

I applied the command to end the conversation in one minute as below, but CALL DO NOT CUT at 1 minute.

$res = $agi->exec(“DIAL DAHDI/g0/$number2,13,L[60000:00000:00000],mM|A(/home/ast6/$callerid/out1)”);

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.

Please help me.

Regards
Senjam

Two things.

  1. 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

  2. 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.

This is the correct syntax for the L option

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

https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Dial

Thank you for the reply.

My Asterisk version is Asterisk 11.7.0

I modified as per your advice as below:

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.

Your help will be of great help

Thanks
Senjam

Use the variables available,

[inbound]
exten=>200,1,set(LIMIT_WARNING_FILE=beep)
same=>n,Set(LIMIT_PLAYAUDIO_CALLER=yes)
same=>n,Set(LIMIT_PLAYAUDIO_CALLEE=yes)
same=>n,Set(LIMIT_TIMEOUT_FILE=demo-thanks)
same=>n,Dial(Local/200@mymusic,L(60000:30000:10000))

[mymusic]
exten=>200,1,Answer()
same=>n,MusicOnHold(default)

Note the above dialplan is just an example related to the variables, it is not an step by step guide of what you have requested

Thank you ambiorixg129h for your such a nice support.
It is done.

Thanks,
Senjam

1 Like