[asterisk-users] catch the use of h option in dial

Max Börebäck max at boreback.com
Fri Oct 3 14:06:28 CDT 2008



I like to  determine that the called user pressed ** to disconnect the call (h option for Dial CMD ), and not just hang up the phone. 

Is there a way to get that information? 

The context file where the call file connects the call person is included (it is simplified ). 
First thing in the context is calling up the destination, the destination ends up in a IVR to accept or decline the call. (The same can be done with privacy option as I under stand.) 

When the call is connected I like the destination via h option to be able to press ** to disconnect and I like to catch this to log that the destination did this and not just hang up the phone when the conversation finished. 

Is there a way to do that? 

[incoming] 
exten => s,1,Wait(1) 
exten => s,n,Answer() 
exten => s,n,Dial(Local/${ DSTPHONE }@from-internal|60| trgM ( dst -ivr^${ CALLER_NAME })) 
exten => s,n, Noop (After Dial) 
; Destination hangup 
exten => s,n, Goto (result-${ PC_STATUS }|10) 
;No we get here when destination hangup, both normal hangup and by pressing ** 
; We get here if the dst accepted the call and then pressed ** to abuse 
exten => result-1,10,Playback(custom/ callrejected ) 
exten => result-1,n,Hangup() 
exten => h,1, Noop (PC - Hangup) 
; HERE I LIKE TO LOG if destination pressed ** or just hangup 
exten => h,n,system(/ pc /bin/ log_call ${ DIALEDTIME }:::${ ANSWEREDTIME }:::${ PC_STATUS }:::${ HANGUPCAUSE }:::${ DIALSTATUS } ) 

Regards Max 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20081003/dc5ed765/attachment.htm 


More information about the asterisk-users mailing list