[FS-9894] mod_callcenter: timeout to call an agent hardcoded to 60sec Created: 28/Dec/16  Updated: 05/Sep/18

Status: Waiting for reporter
Project: FreeSWITCH
Component/s: mod_callcenter
Affects Version/s: None
Fix Version/s: 1.8, 1.6.19

Type: Bug Priority: Minor
Reporter: Antonio Assignee: Italo Rossi
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File 20170613_freeswitch.log     Text File 20180904_freeswitch.log.txt     File freeswitch.2017-07-13.vanillaconfig.log     Text File freeswitch.29-12-2016.log     Text File freeswitch.30-12-2016.log     Text File freeswitch.log     XML File freeswitch.xml    
CPU Architecture:
Distribution Version:
Debian 8 jessie
FreeSWITCH GIT Revision: 50714ec5e4eb14976695ff29bc6528e0b9a16862
GIT Master Revision hash:: 50714ec5e4eb14976695ff29bc6528e0b9a16862

when calling an agent the maximum time is hardcoded to be 60seconds.

Try to set call_timeout, leg_timeout to more than 60sec but the call always ends after 60seconds.

is not normal, but I've a client where he wants an agent to ring for 120seconds before jumping to another agent.

Comment by Italo Rossi [ 29/Dec/16 ]
This shouldn't be needed. Tried with leg_timeout=120 and it worked. Do not use call_timeout. This should be a limitation with your devices.
Comment by Antonio [ 29/Dec/16 ]
is not limitation on the device, soon i put the pr patch it worked as expected.

in the log you can see i use both, leg_timeout and call_timeout as export before calling the callcenter and also in the agent contact and it didn't work.
from the log line:
2016-12-28 13:12:26.291133 [DEBUG] switch_ivr_originate.c:2958 sofia/a/200@ Setting leg timeout to 120

here it sets the timeout to 120seconds, but the call gets terminated by the 60seconds timeout hardcoded callcenter when calling the switch_ivr_originate function.

2016-12-28 13:13:26.011184 [NOTICE] switch_ivr_originate.c:3606 Hangup sofia/a/200@ [CS_CONSUME_MEDIA] [NO_ANSWER]

how do you make it work?

Comment by Antonio [ 29/Dec/16 ]
Tested with latest git just in case... and same result.

Attached my configuration and log when calling the callcenter.

The call setup:
201 --> 123 (callcenter) --> 200 (agent)
Comment by Brian West [ 30/Dec/16 ]
You need to attach full logs on the latest git release with sip trace included.

Comment by Antonio [ 30/Dec/16 ]
File attached
Comment by Italo Rossi [ 16/Jan/17 ]
Can you post your agent contact and your dialplan please?
Comment by Antonio [ 16/Jan/17 ]
full configuration attached as freeswitch.xml.

in the contact i've set: contact="[leg_timeout=120]sofia/a/sip:200@"
Comment by Antonio [ 27/Apr/17 ]
ping... for some reason the issue is on state: Waiting for reporter, and i provide the log and configuration to reproduce the issue...
Comment by Antonio [ 13/Jun/17 ]
the problem still happens in current master, just update the pull request that solves this issue.
Comment by Italo Rossi [ 13/Jun/17 ]
This works perfectly on my box and with examples on confluente.
Please test with a clean setup without any other customizations. I just tried here and there's no need to change the code.

    <agent name="1000@default" type="callback" contact="[leg_timeout=120]user/1000@${domain_name}" status="Available" max-no-answer="0" wrap-up-time="5" reject-delay-time="1" busy-delay-time="1" />
Comment by Antonio [ 13/Jun/17 ]
Hi Italo,

You must have something different in you box!! i just compile master and used the freeswitch.xml attached in the jira, and no other customizations and it fails!!

Part of the log where you can see the behaviour:

2017-06-13 15:50:16.889617 [DEBUG] sofia.c:7247 Channel sofia/a/202@default.com entering state [ready][200]
2017-06-13 15:50:16.949641 [DEBUG] mod_callcenter.c:1147 Updated Agent cc-cc_agent-200 set state = Receiving

[60seconds after...]

2017-06-13 15:51:16.029690 [DEBUG] mod_callcenter.c:1998 Agent cc-cc_agent-200 Origination Canceled : NO_ANSWER
2017-06-13 15:51:16.029690 [DEBUG] mod_callcenter.c:1147 Updated Agent cc-cc_agent-200 set state = Waiting

<agent name="cc-cc_agent-200" type="callback" contact="[leg_timeout=120]sofia/a/sip:200@" status="Available" wrap-up-time="15" reject-delay-time="10" busy-delay-time="15" />

I lock a sip level if it could be some cancel from the device but no.. is all mod_callcenter. If i put the change from the PR it works perfect!!

The call is very simple, from the user 202 i call the number 123, that ends in the callcenter...

Comment by Antonio [ 13/Jun/17 ]
Hi Italo,

Got it!!

the issue is in the agent contact is the sofia_contact string:

when using contact="[leg_timeout=120]user/1000@${domain_name}" --> WORK
when using contact="[leg_timeout=120]sofia/" --> FAIL
when using contact="[leg_timeout=120]${sofia_contact(1000@}" --> FAIL (attach the call log)

something is done when calling user that is not done when calling the contact directly.


Comment by Italo Rossi [ 13/Jun/17 ]
That's why I asked you to try vanilla config first. It would be much easier to prove to you that this does work.

So we MAY have a issue with leg_timeout and calling a sip uri using a profile instead of using user/ endpoint.


originate [leg_timeout=120]user/1000@${domain_name} -> leg_timeout works
originate [leg_timeout=120]sofia/ -> leg_timeout is ignored

 [~brian][~mikej] Ideas? Summary:
Comment by Mike Jerris [ 19/Jun/17 ]
i don't think thats actually the issue.. can you tell me what is output from the sofia_contact function from fs_cli when run just like its run above?
Comment by Antonio [ 20/Jun/17 ]

freeswitch@debian-dev> sofia_contact 1000@

Comment by Mike Jerris [ 20/Jun/17 ]
Italo, are you doing anything inserting [] or {} into this string? Thats my best guess of what might be happening here is that those are getting confused somehow
Comment by Italo Rossi [ 23/Jun/17 ]
Comment by Italo Rossi [ 23/Jun/17 ]
Nothing crazy, what we have on database as contact we just expand it with member_session and issue originate.
Comment by Antonio [ 05/Sep/18 ]
Hi italo,
this is still present in current master (FreeSWITCH (Version 1.9.0 git 5dd4451 2018-08-31 19:05:39Z 64bit) is ready)

Test it with vanilla config with changes in:
- autoload_configs/callcenter.conf.xml
<agent name="1000@default" type="callback" contact="[leg_timeout=120]${sofia_contact(1000@${domain})}" status="Available" max-no-answer="3" wrap-up-time="10" reject-delay-time="10" busy-delay-time="60" />

- dialplan/default.xml
<extension name="cc" continue="false">
        <condition field="destination_number" expression="123">
                <action application="callcenter" data="support@default"/>

Attach the call log.

the PR solves the issue, increasing the switch_ivr_originate timeout to a bigger value, it will hangup the call on timeout with the lowest value found, i my case the leg_timeout from the contact agent.
Generated at Mon Jan 21 13:08:27 CST 2019 using JIRA 7.3.3#73014-sha1:d5be8da522213be2ca9ad7b043c51da6e4cc9754.