Merged revisions 307879 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r307879 | rmudgett | 2011-02-15 10:13:55 -0600 (Tue, 15 Feb 2011) | 37 lines
  
  No response sent for SIP CC subscribe/resubscribe request.
  
  Asterisk does not send a response if we try to subscribe for call
  completion after we have received a 180 Ringing.  You can only subscribe
  for call completion when the call has been cleared.
  
  When we receive the 180 Ringing, for this call, its call-completion state
  is 'CC_AVAILABLE'.  If we then send a subscribe message to Asterisk, it
  trys to change the call-completion state to 'CC_CALLER_REQUESTED'.
  Because this is an invalid state change, it just ignores the message.  The
  only state Asterisk will accept our subscribe message is in the
  'CC_CALLER_OFFERED' state.
  
  Asterisk will go into the 'CC_CALLER_OFFERED' when the SIP client clears
  the call by sending a CANCEL.
  
  Asterisk should always send a response.  Even if its a negative one.
  
  
  The fix is to allow for the CCSS core to notify a CC agent that a failure
  has occurred when CC is requested.  The "ack" callback is replaced with a
  "respond" callback.  The "respond" callback has a parameter indicating
  either a successful response or a specific type of failure that may need
  to be communicated to the requester.
  
  (closes issue #18336)
  Reported by: GeorgeKonopacki
  Tested by: mmichelson, rmudgett
  
  JIRA SWP-2633
  
  (closes issue #18337)
  Reported by: GeorgeKonopacki
  Tested by: mmichelson
  
  JIRA SWP-2634
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@307883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2011-02-15 16:18:43 +00:00
parent e38fa2d3cd
commit b2ef13cb60
6 changed files with 117 additions and 32 deletions

View File

@@ -858,6 +858,15 @@ struct ast_cc_agent {
char device_name[1];
};
enum ast_cc_agent_response_reason {
/*! CC request accepted */
AST_CC_AGENT_RESPONSE_SUCCESS,
/*! CC request not allowed at this time. Invalid state transition. */
AST_CC_AGENT_RESPONSE_FAILURE_INVALID,
/*! Too many CC requests in the system. */
AST_CC_AGENT_RESPONSE_FAILURE_TOO_MANY,
};
struct ast_cc_agent_callbacks {
/*!
* \brief Type of agent the callbacks belong to.
@@ -920,19 +929,23 @@ struct ast_cc_agent_callbacks {
*/
int (*stop_offer_timer)(struct ast_cc_agent *agent);
/*!
* \brief Acknowledge CC request.
* \brief Respond to a CC request.
*
* \param agent CC core agent control.
* \param reason CC request response status.
*
* \details
* When the core receives knowledge that a called
* party has accepted a CC request, it will call
* this callback.
* this callback. The core may also call this
* if there is some error when attempting to process
* the incoming CC request.
*
* The duty of this is to accept a CC request from
* the caller by acknowledging receipt of that request.
* The duty of this is to issue a propper response to a
* CC request from the caller by acknowledging receipt
* of that request or rejecting it.
*/
void (*ack)(struct ast_cc_agent *agent);
void (*respond)(struct ast_cc_agent *agent, enum ast_cc_agent_response_reason reason);
/*!
* \brief Request the status of the agent's device.
*