Channel held open that Asterisk couldn't destroy

Dear All,

I have an issue that asterisk channel remains open when call is disconnected. I’m working on cdr entires to mongodb by enabling a custom CDR. But my code is creating an issue that asterisk channels are always remains connected and never get closed. And below is the warning that is displayed in error logs:-

Error Message:
“WARNING[30882]: chan_sip.c:4271 __sip_autodestruct: Autodestruct on dialog ‘66faf1ca743da0eb0e70f21b0b4d202a@xxx.x.x.x:5060’ with owner SIP/xxxx-00000009 in place (Method: BYE). Rescheduling destruction for 10000 ms”.

Core Show Channels Output:
SIP/xxxx-00000009 from-internal 1 Up AppDial (Outgoing Line) xxxx 17:36:20 (None)
SIP/xxxx-00000008 macro-dial-one s 53 Up Dial SIP/1112,HhTtrIb(func-ap xxxx 17:36:20 (None)

Asterisk Version:
My asterisk version is "Asterisk 11.25.3 "

Thank you in advance.
With regards, Sophia.

That version is not supported. You have not provided your dialplan or complete logging.

Hi,

I’m using asterisk 11.25.3. I want cdr logging in mongodb. For that I’m using custom csv method. I am following the below link for cdr entries in mongodb:

With these steps, Mongodb entries are working fine and hangup and all flow is good. But in case , if script stops then this hangup issue occurs.

Issue occurs when I’m using this code. No call is getting disconnected and channel request hangup all command is also not working. All things are settled down only when I restart the asterisk .

And after restart same problem remains until I unload the csv module .

But , I want to resolve it without asterisk restart. And I don’t unload the csv module.

Core Show Channels output:

chan_sip.c:4271 __sip_autodestruct: Autodestruct on dialog ‘34c47f014968e6e62bad1c025926036c@xxx.xx.xx.x:5060’ with owner SIP/xxx1-00000001 in place (Method: BYE). Rescheduling destruction for 10000 ms
[2018-11-16 02:37:52] NOTICE[34418]: chan_sip.c:29270 check_rtp_timeout: Disconnecting call ‘SIP/xxx2-00000001’ for lack of RTP activity in 31 seconds

Error Log:

chan_sip.c:4271 __sip_autodestruct: Autodestruct on dialog ‘34c47f014968e6e62bad1c025926036c@xxx.xx.xx.x:5060’ with owner SIP/xxx2-00000001 in place (Method: BYE). Rescheduling destruction for 10000 ms

Out of habit, a personal best practice.
I always end every dailplan with HangUp(). Maybe this could help you.

[from-internal]
...
 same => n,NoOp(Do Something)
 same => n,HangUp()

[macro-dial-one]
...
 same => n,Dial(SIP/1112)
 same => n,HangUp()

Hangup is generally redundant, but harmless.

I would do channel show on the named channel and see what the system thinks it is doing.

This is going to be either a reference counting bug in Asterisk, or you are genuinely doing something long running on the channel during the BYE transaction, e.g. extended processing in an h extension.

Also this seems to be classified as a warning, not an error.

1 Like

Yes, It’s warning but the issue is that all calls are stuck in loop… core show channels showing multiple calls that are not actually running means asterisk command is showing disconnected calls in loop.

If they are in a loop, other than one in your dialplan, you will need to obtain back traces, and if possible, trace through the loop.

If you have a dialplan loop, the path through the loop will be obvious from the verbose logs.

Thank you so much David. The above problem is resolved through back tracking.