How to find who has disconnected call

Any help >>>>???
Test case :
Assume . A is Src and B is dst

  1. User A and User B are on Call
  2. User B has disconnected call .
  3. User A has disconnected call.

CDR() has userfield can be read and write .
CDR() dst src dchannel channel lastapp lastcontaxt .
which variable and how to use them .

Dear Digium engineers or asterisk Developer/Professional please help me on this below.

like cisco support :

In the TCD (Termination Call Detail) table which you can find in the HDS database, you can find a column called “CallDisposition”. This column contains codes that refer to how the call was ended (i.e. Call Disposition code of 52 refers to “Called Party Disconnected”).

Reference: CTI Server Reference Guide … isvr80.pdf

Also, you can find many posts on this forum relating to “Call Disposition” (i.e.

  1. If the customer disconnects the call, the Call disposition of the call(all 3 legs) will be 13.

  2. If the agent disconnects the call, the second call leg disposition is 52 and other 2 is 13[/b]
    Dose asterisk has some set of functionality or feature . ???/
    Please reply as soon as possible .


See viewtopic.php?f=13&t=83916

You can also get it from the order of the hangup events in channel event logging, which you should probably be using as it sounds like you have non-trivial logging requirements.

This should have been asked on Asterisk Support.

I normally use something like below to find out who disconnected the call

exten => _X.,1,Set(DisconnectedBy=CALLER)
; g - Proceed with dialplan execution at the next priority in the current extension if the destination channel hangs up.
same => n,Dial(${YOUR_DIAL_TECHNOLOGY}/${NUMBER},g)
same => n,Set(DisconnectedBy=CALLEE)
same => n,Hangup

exten => h,1,NoOp(DisconnectedBy ${DisconnectedBy})
same => n,Set(CDR(userfield)=${DisconnectedBy})

–Satish Barot

Many Many Thanks your suggestion works .