Get All dialed channels

Hi everyone ,

I am trying to get the HANGUPCAUSE of all dialed channels by Dial Application in Ringroup .

Is something I can do

Thank You

https://docs.asterisk.org/Configuration/Miscellaneous/Hangup-Cause/?h=hangup+cause

But , for some reason I cannot get HANGUPCAUSE when “Answered else where” is being sent with CANCEL message , if someone else answered the call.

On Tuesday 23 July 2024 at 18:13:20, AhmedShehata via Asterisk Community
wrote:

But , for some reason I cannot get HANGUPCAUSE when “Answered else where”
is being sent with CANCEL message , if someone else answered the call.

That, presumably, is because the call has not been hung up. You can’t hang up
a call you did not answer, and this call was answered elsewhere.

Antony.


3 logicians walk into a bar. The bartender asks “Do you all want a drink?”
The first logician says “I don’t know.”
The second logician says “I don’t know.”
The third logician says “Yes!”

                                               Please reply to the list;
                                                     please *don't* CC me.

I think you mean you can’t hangup a call which you neither received nor was answered. It’s common to use Hangup on an incoming, unanswered call, and either side can hang up one that has been answered.

However I didn’t really understand the OPs scenario for this case.

No , I don’t want to hangup the call , I want to catch the HangupCause for a specified channel .
Here is an example
there is incoming call Rings Ringgroup 600 , this ringgroup has two extensions 100,102
100 is ringing
102 is ringing too

100 Answered the called , and 102 recieved cancel message as SIP with reason “Answered ELSE WHERE”

What I need is to catch this reason if it’s possible .

No , I don’t want to hangup the call , I want to catch the HangupCause for a specified channel .
Here is an example
there is incoming call Rings Ringgroup 600 , this ringgroup has two extensions 100,102
100 is ringing
102 is ringing too

100 Answered the called , and 102 recieved cancel message as SIP with reason “Answered ELSE WHERE”

What I need is to catch this reason if it’s possible .

What’s a ring group? There is no such thing in Asterisk,. and, if you synthesized one, it would be composed of endpoints, not extensions. Are you using FreePBX?

I don’t think anything gets run on a cancelled outgoing channel, after the call ID is set, although you could try setting a hangup handler in the pre-dial subroutine.

Overall, it may be better to use CEL, or to combine CDRs on linked ID, after the call ends.

Yes , Extensions in Freepbx in Asterisk it’s called endpoints .
That was jclop suggested in his answer to setup hangup handler , but for some reason I cannot get the hangup cause of cancelled channel .

Ok , I will see CEL if it gives me more details .

The hangup handler needs to be set on the B side channel, so needs to be set from a pre-dial subroutine, as the B side channel doesn’t exist until that point.

So ,Do you mean to create another context to go to with B option , and from there add the hangup handler ?
Explain further please and Thank you

I got the solution , as david mentioned before you need to setup the hangup handler in the called channel and per Dial application docs
https://docs.asterisk.org/Asterisk_16_Documentation/API_Documentation/Dialplan_Applications/Dial/

you will use ‘b’ option to set hangup handler on these channels
https://docs.asterisk.org/Configuration/Miscellaneous/Hangup-Cause/?h=hangup+cause

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.