[asterisk-users] Handling 3 different call ending causes

Alex Balashov abalashov at evaristesys.com
Mon Mar 17 02:31:43 CDT 2008


Tobias Ahlander wrote:
> Hello List,
> 
> I'm using a dialstring like the one below. I want to have three 
> different things happening depending on exit cause.
> 
> Dial(SIP/${phonenumber},20,gL(20000[:5000][:5000]))
> 
> These 3 things could happen:
> 1, Caller hangs up
> 2, Callee hangs up
> 3, The 20 seconds is up and call is terminated from Asterisk.
> 
> Is there a way to separate these 3?

You can handle the 'h' extension in the dial plan, which will supply the 
${CHANNEL} that was hung up, and possibly some additional dial plan 
variables as well:

http://www.voip-info.org/wiki/index.php?page=Asterisk+h+extension

Using these, you can piece together who hung up on whom, etc.

#2 is handled by fallthrough in the dial plan that causes the 
instructions to continue executing to the next priority for that 
extension, whereas if the call completes (Dial() is successfully 
connected), this does not happen.

-- 
Alex Balashov
Evariste Systems
Web    : http://www.evaristesys.com/
Tel    : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (706) 338-8599



More information about the asterisk-users mailing list