Detecting which side hung up first

Hello

After a dial command, I simply need to know which side of the call hung up first. Can anybody suggest a way?

Best regards,
Fadishei

Unfortunately, there is no simple way to do this as we don’t have access
to the SIP messages. If you want to look deeper into it, you should
open the source code and take a look at where the Hangup cause
variable is set, and try to plug in your own, to discriminate
the two (caller and callee). Ref:

voip-info.org/wiki/view/Aste … angupcause

I’m not sure if it is possible to continue after the Dial application if the controlling party hangs up. If it is, can you look at the state of the controlling channel?

I think there are ways of getting the h extension run, even when the controlling channel hangs up.

Some context as to the reason for doing this would probably help a lot.

Or if it can be scripted, A DeadAgi will allow post processing…

[quote=“david55”]I’m not sure if it is possible to continue after the Dial application if the controlling party hangs up. If it is, can you look at the state of the controlling channel?
I think there are ways of getting the h extension run, even when the controlling channel hangs up.[/quote]

Yes, your hint is correct. Dial option ‘g’ can be used in my case. This option causes dialplan to continue after destination hangs up. I came to this solution which seems to work for me (I’m not sure yet):

exten => _1XX,1,Set(HANGUPSIDE=1) exten => _1XX,n,Dial(SIP/${EXTEN},,g) exten => _1XX,n,Set(HANGUPSIDE=2) exten => _1XX,n,NoOp(${HANGUPSIDE}) exten => h,1,NoOp(${HANGUPSIDE})

The reason I need such a thing is that in some customer support center, agents should reply quite courteously and are not allowed to hang up a call on any customer unless the customer themselves decides to finish the call. I want it to be recorded somewhere for the case that a customer complains that an agent hung up on them in the middle of the conversation. quite strange, huh?

Thanks,
Fadishei

[quote=“makafre”]Unfortunately, there is no simple way to do this as we don’t have access
to the SIP messages. If you want to look deeper into it, you should
open the source code and take a look at where the Hangup cause
variable is set, and try to plug in your own, to discriminate
the two (caller and callee). Ref:

voip-info.org/wiki/view/Aste … angupcause[/quote]

I came into a simple solution which is described in my reply to david55 but I’m not sure whether it always works. Can you please check the solution?

Thanks
Fadishei

If you are using queues, the queue log should distinguish between AGENTCOMPLETE and CALLERCOMPLETE.