简体   繁体   中英

Hang up the call after x seconds after the called party has answered the call using ARI in Asterisk

We've been using Asterisk's Dial plans for quite some time and now we've decided to switch to ARI . I'm wondering is there a way to hang up the call after x seconds after the called party has answered the call using originate or any other method from /channels resource in ARI . Note that I can do this using dial plan with L(x:y:z) or S(duration) functions but unfortunately can not find a way to use this feature in Stasis mode. here is a part of my dial plan in extensions.conf

exten => 8952XXXX,1,NoOp(${CALLERID(num)})
same => n,Set(ENDPOINT=${SIP_HEADER(X-Endpoint)})
same => n,Stasis(myapp,incoming,${EXTEN},unknown,unknown,none)
same => n,Hangup()
[context1]
exten => 8952XXXX,1,NoOp(${CALLERID(num)})
same => n,Set(__ENDPOINT=${SIP_HEADER(X-Endpoint)})
same => n,Dial(Local/${EXTEN}@context2/n,,L(x:y:z))
same => n,Hangup()
[context2]
exten => 8952XXXX,1,NoOp(${CALLERID(num)})
same => n,Stasis(myapp,incoming,${EXTEN},unknown,unknown,none)
same => n,Hangup()

Other option is use TIMEOUT(absolute)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM