Skip to content
Snippets Groups Projects
  • Richard Mudgett's avatar
    7b41f52c
    chan_agent: Prevent multiple channels from logging in as the same agent. · 7b41f52c
    Richard Mudgett authored
    Multiple channels logging in as the same agent can result in dead channels
    waiting for a condition signal that will never come because another
    channel thread stole it.  A symptom is chan_sip repeatedly generating
    warning messages about rescheduling autodestruction of dialogs with an
    agent channel owner.
    
    * Made only login_exec() (the app AgentLogin) clear the agent_pvt->chan
    pointer to prevent multiple channels from logging in as the same agent.
    agent_read(), agent_call(), and agent_set_base_channel() no longer
    disconnect the agent channel from the agent_pvt.  This also eliminates the
    need to keep checking for agent_pvt->chan being NULL.
    
    * Made agent_hangup() not wake up the AgentLogin agent thread until it is
    done.
    
    * Made agent_request() not able to get the agent until he has logged in
    and any wrapup time has expired.
    
    * Made agent_request() use ast_hangup() instead of agent_hangup() to
    correctly dispose of a channel.
    
    * Removed agent_set_base_channel().  Nobody calls it and it is a bad thing
    in general.
    
    * Made only agent_devicestate() determine the current device state of an
    agent.  Note: Agent group device states have never been supported.
    
    Review: https://reviewboard.asterisk.org/r/2260/
    ........
    
    Merged revisions 380364 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@380384 65c4cc65-6c06-0410-ace0-fbb531ad65f3
    7b41f52c
    History
    chan_agent: Prevent multiple channels from logging in as the same agent.
    Richard Mudgett authored
    Multiple channels logging in as the same agent can result in dead channels
    waiting for a condition signal that will never come because another
    channel thread stole it.  A symptom is chan_sip repeatedly generating
    warning messages about rescheduling autodestruction of dialogs with an
    agent channel owner.
    
    * Made only login_exec() (the app AgentLogin) clear the agent_pvt->chan
    pointer to prevent multiple channels from logging in as the same agent.
    agent_read(), agent_call(), and agent_set_base_channel() no longer
    disconnect the agent channel from the agent_pvt.  This also eliminates the
    need to keep checking for agent_pvt->chan being NULL.
    
    * Made agent_hangup() not wake up the AgentLogin agent thread until it is
    done.
    
    * Made agent_request() not able to get the agent until he has logged in
    and any wrapup time has expired.
    
    * Made agent_request() use ast_hangup() instead of agent_hangup() to
    correctly dispose of a channel.
    
    * Removed agent_set_base_channel().  Nobody calls it and it is a bad thing
    in general.
    
    * Made only agent_devicestate() determine the current device state of an
    agent.  Note: Agent group device states have never been supported.
    
    Review: https://reviewboard.asterisk.org/r/2260/
    ........
    
    Merged revisions 380364 from http://svn.asterisk.org/svn/asterisk/branches/1.8
    
    
    git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@380384 65c4cc65-6c06-0410-ace0-fbb531ad65f3