Session is pending when shutdown freeswitch

Hi,
I’m using the module callcenter in the dialplan for a callqueue application. When a caller dial the callqueue number and when the “callcenter” application is reached, the callcenter application ring a agent. At this point agent can answer or not he can also hangup the call. After this, when I shutdown freeswitch the following trace appears in the console:
2023-12-15 15:13:41.255462 99.30% [CRIT] sofia.c:3531 Waiting for 1 session(s)
And freeswitch is waiting a few seconds before exit.
When no agent is associated to the callqueue and the caller hangup there is no problem.But when the call is offering to an agent this probleme occurs.
Is there someone who has encountered this issue?

freeswitch release: FreeSWITCH Version 1.10.7-release-19-883d2cb662~64bit
OS: debian bullseye
Extract of the dialplan:

<extension name="CCQ_999011000001_84000">
<condition expression="CCQ_999011000001_84000" field="destination_number">
	<action application="log" data="dialpan coming from cc-gw"/>
	<action application="set" data="cc_dest_domain=${sip_to_host}"/>
	<action application="set" data="sip_h_X-CALLER-INFO="${caller_id_name}" <sip:${caller_id_number}@${sip_to_host}>"/>
	<action application="set" data="sip_h_X-RB-CMD=ignore_cf,ignore_er"/>
	<action application="set" data="sip_h_X-CALLER-CALL-ID=${sip_call_id}"/>
	<action application="set" data="originate_timeout=10"/>
	<action application="set" data="sip_from_display=CallQueue 1 pour EPE for test"/>
	<action application="set" data="hold_music={profile=swift}http_cache://http://10.10.13.52:8135/api/rainbow/rvcpprovisioning/v1.0/cloudpbxs/62067d8273d8fe6c64363052/greetings/650c4439f9b8c8b38600b6c2"/>
	<action application="set" data="recording_prompt="/>
	<action application="set" data="cc_export_vars=hold_music,sip_h_X-RB-CMD,cc_dest_domain,sip_h_X-CALLER-INFO,sip_h_X-CALLER-CALL-ID,originate_timeout,sip_from_display"/>
	<action application="answer"/>
	<action application="lua" data="recording.lua"/>
	<action application="callcenter" data="CCQ_999011000001_84000"/>
	<action application="set" data="cc_overflow_no_agent_timeout_destination=*56*84000"/>
	<action application="set" data="cc_overflow_no_agent_timeout_gateway=999011000001"/>
	<action application="set" data="cc_overflow_timeout_destination=*56*84000"/>
	<action application="set" data="cc_overflow_timeout_gateway=999011000001"/>
	<action application="set" data="cc_overflow_from=${destination_number}"/>
	<action application="set" data="cc_overflow_X-CALLER-INFO="${caller_id_name}" <sip:${caller_id_number}@${sip_to_host};overflow>"/>
	<action application="lua" data="overflow.lua"/>
</condition>
</extension>

What happens if you hupall before shutdown?

I think this is what freeswitch do in sofia.c:
sanity = 4;
while (profile->inuse) {
switch_core_session_hupall_matching_var(“sofia_profile_name”, profile->name, SWITCH_CAUSE_MANAGER_REQUEST);
switch_yield(5000000);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, “Waiting for %d session(s)\n”, profile->inuse);
if (!–sanity) {
break;
}
}

What is the output if you issue hupall before issuing shutdown? Do you get the same response? Please provide the output.

Hi,
I tried a hupall before shuting down:
freeswitch@fs2> hupall
+OK hangup all channels with cause MANAGER_REQUEST

but I have always the same error:
2024-01-09 17:00:35.365650 99.10% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:36.365653 99.07% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:37.365662 99.10% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:38.365656 99.07% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:39.365648 99.07% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:40.365651 99.00% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:41.365661 99.03% [CRIT] sofia.c:3475 Waiting for 1 session(s)
2024-01-09 17:00:42.365658 99.00% [CRIT] sofia.c:3475 Waiting for 1 session(s)

Hi,

I have simplified my dialplan as following:

<extension name="CCQ_999011000001_84000">
<condition expression="CCQ_999011000001_84000" field="destination_number">
<action application="log" data="dialpan coming from cc-gw"/>
<action application="set" data="cc_dest_domain=${sip_to_host}"/>
<action application="set" data="sip_h_X-CALLER-INFO="${caller_id_name}" <sip:${caller_id_number}@${sip_to_host}>"/>
<action application="set" data="sip_h_X-RB-CMD=ignore_cf,ignore_er"/>
<action application="set" data="sip_h_X-CALLER-CALL-ID=${sip_call_id}"/>
<action application="set" data="originate_timeout=10"/>
<action application="set" data="sip_from_display=CallQueue 1 /EPE"/>
<action application="set" data="hold_music={profile=swift}http_cache://http://10.10.13.52:8135/api/rainbow/rvcpprovisioning/v1.0/cloudpbxs/5de6a632c21aa17bab337347/greetings/music_on_hold"/>
<action application="set" data="recording_prompt={profile=swift}http_cache://http://10.10.13.52:8135/api/rainbow/rvcpprovisioning/v1.0/cloudpbxs/5de6a632c21aa17bab337347/greetings/recording_prompt"/>
<action application="set" data="cc_export_vars=hold_music,sip_h_X-RB-CMD,cc_dest_domain,sip_h_X-CALLER-INFO,sip_h_X-CALLER-CALL-ID,originate_timeout,sip_from_display"/>
<action application="callcenter" data="CCQ_999011000001_84000"/>
<action application="hangup"/>
</condition>

The callcenter callqueue module look like this:

<queue name="CCQ_999011000001_84000">
<param name="strategy" value="top-down"/>
<param name="moh-sound" value="{profile=swift}http_cache://http://10.10.13.52:8135/api/rainbow/rvcpprovisioning/v1.0/cloudpbxs/5de6a632c21aa17bab337347/greetings/waiting_music?callQueueId=63e3b2c88f09ed550326e70d"/>
<param name="time-base-score" value="system"/>
<param name="tier-rules-apply" value="false"/>
<param name="tier-rule-wait-second" value="300"/>
<param name="tier-rule-wait-multiply-level" value="false"/>
<param name="tier-rule-no-agent-no-wait" value="false"/>
<param name="discard-abandoned-after" value="60"/>
<param name="abandoned-resume-allowed" value="false"/>
<param name="max-wait-time" value="15"/>
<param name="max-wait-time-with-no-agent" value="15"/>
<param name="max-wait-time-with-no-agent-time-reached" value="5"/>
<param name="ring-progressively-delay" value="10"/>
</queue>

When no agent is associated to the queue I have no issue.

But when I associated an agent to the callqueue, when a member call the queue fresswitch try to reach an agent, then if the agent answer or not, after the caller hangup , it seems that his session is locked, and his logs end at the following line:
5fb32500-387a-419b-800d-10d773943cfb 2024-01-11 14:19:31.222344 99.23% [DEBUG] switch_core_session.c:1753 Session 298 (sofia/external/99901200110123814635050281@5.demo-rainbow-voice.eu1.sip.openrainbow.com) Locked, Waiting on external entities

Then when I execute show calls I can see that the call is still present:
5fb32500-387a-419b-800d-10d773943cfb,inbound,2024-01-11 14:19:19,1704979159,sofia/external/99901200110123814635050281@5.demo-rainbow-voice.eu1.sip.openrainbow.com,CS_EXECUTE,3 EPE,86003,10.10.13.196,CCQ_999011000001_84000,ACTIVE,fs2,

It seems that the session member is locked after the callcenter module try to reach agents.

If non agent is associtaed to the callqeue I have not his issue.

For information, I have another freeswitch instance withe the same configuration where this issue does not occurs. This freeswitch release is 1.10.7 from the 24 Oct 2021. Of two other freeswitch instancd I have the issue and both release have the 1.10.10 sofia module of the 13 August 2023. Do you know if there is a regression?
Regards,
Eric

I have found what was wrong, in fact I have a javascript that create a session objetc from an existing one:
s = new Session(uuid);

and I have forgot to call s.destroy() in order to unlock the session.
So the topic is resolved.
Regards,
Eric

1 Like

Hi Getting below issue
Freeswitch sending SIP/2.0 488 Not Acceptable Here
Via: SIP/2.0/WSS 0kpqr9eqgf8o.invalid;branch=z9hG4bK4154591;received=10.77.241.34;rport=58943
Max-Forwards: 70
From: sip:1010@jmngd1s1cmp01.sitcct.jio.com;tag=48nspmrr8t
To: sip:12987021726666@x.x.x.x;tag=9tpHyKFamt2ap
Call-ID: dd1dgrkbk1g37cba4t75
CSeq: 1 INVITE
User-Agent: Jio
Accept: application/sdp
Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
Supported: timer, path, replaces
Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
Reason: Q.850;cause=88;text=“INCOMPATIBLE_DESTINATION”
Content-Length: 0
Remote-Party-ID: “12987021726666” sip:12987021726666@x.x.x.x.;party=calling;privacy=off;screen=no For Invite INVITE sip:12987021729774@10.144.16.196 SIP/2.0
Via: SIP/2.0/WSS 0kpqr9eqgf8o.invalid;branch=z9hG4bK4154591
To: sip:12987021726666@x.x.x.x
From: sip:1010@jmngd1s1cmp01.sitcct.jio.com;tag=48nspmrr8t
CSeq: 1 INVITE
Call-ID: dd1dgrkbk1g37cba4t75
Max-Forwards: 70
Contact: sip:5ceth6nh@0kpqr9eqgf8o.invalid;transport=ws;ob
Allow: ACK,CANCEL,INVITE,MESSAGE,BYE,OPTIONS,INFO,NOTIFY,REFER
Supported: outbound
User-Agent: SIP.js/0.21.1
Content-Type: application/sdp
Content-Length: 1736

v=0
o=- 8465964380331798740 2 IN IP4 127.0.0.1
s=-
t=0 0
a=group:BUNDLE 0
a=extmap-allow-mixed
a=msid-semantic: WMS a495b80c-139a-4f0a-a736-bccdddd17f4b
m=audio 52245 UDP/TLS/RTP/SAVPF 111 63 9 0 8 13 110 126
c=IN IP4 10.77.241.34
a=rtcp:9 IN IP4 0.0.0.0
a=candidate:1852297919 1 udp 2122194687 10.77.241.34 52245 typ host generation 0 network-id 1
a=candidate:313672034 1 udp 2122262783 2402:8e00::3002:34d2:1f5f:cb5b:a31a 52246 typ host generation 0 network-id 2
a=candidate:279457831 1 tcp 1518214911 10.77.241.34 9 typ host tcptype active generation 0 network-id 1
a=candidate:1820173306 1 tcp 1518283007 2402:8e00::3002:34d2:1f5f:cb5b:a31a 9 typ host tcptype active generation 0 network-id 2
a=ice-ufrag:iy4g
a=ice-pwd:VbjmjygYAd54ZpFG40WiBvZk
a=ice-options:trickle
a=fingerprint:sha-256 03:E4:89:C9:3B:2D:0F:cc:A7:30:0E:0B:42:37:72:CA:DE:64:92:DB:7A:BC:0D:2E:2A:62:61:9F:FE:B2:54:6D
a=setup:actpass
a=mid:0
a=extmap:1 urn:ietf:params:rtp-hdrext:ssrc-audio-level
a=extmap:2 docs/native-code/rtp-hdrext/abs-send-time - src - Git at Google
a=extmap:3 http://www.ietf.org/id/draft-holmer-rmcat-transport-wide-cc-extensions-01
a=extmap:4 urn:ietf:params:rtp-hdrext:sdes:mid
a=sendrecv
a=msid:a495b80c-139a-4f0a-a736-bccdddd17f4b 98c882e6-ef06-497b-bd77-a0d00136dd8c
a=rtcp-mux
a=rtpmap:111 opus/48000/2
a=rtcp-fb:111 transport-cc
a=fmtp:111 minptime=10;useinbandfec=1
a=rtpmap:63 red/48000/2
a=fmtp:63 111/111
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:13 CN/8000
a=rtpmap:110 telephone-event/48000
a=rtpmap:126 telephone-event/8000
a=ssrc:3826604302 cname:z/VhkPyL3E6p2/Az
a=ssrc:3826604302 msid:a495b80c-139a-4f0a-a736-bccdddd17f4b 98c882e6-ef06-497b-bd77-a0d00136dd8c

Please start a new topic since this is a separate question.