Inbound Facebook messages

The following sequence diagram describes a typical inbound Facebook chat message. The scenario can be resumed in the following steps (step numbers are annotated in the diagram):

  1. Facebook notifies social handler of a new chat message.
  2. MessageControl checks periodically for new messages on social handler.
  3. MessageControl obtains a new message from social handler.
  4. MessageControl requests ServerManager to create a session.
  5. MessageControl starts negotiation with CalllControl, through OneSIPConnector.
  6. CallControl send Call::Routing event to ServerManager.
  7. ServerManager creates a session and send Session::Create|Routing event to Router.
  8. Router request a ScriptEngine to run the initial script.
  9. The initial script request router to assign a service to the session based on the interaction DNIS.
  10. Router identifies the service that matches the DNIS and requests an assign service to ServerManager.
  11. An assign service callback is sent to the original caller (the initial script) indicating that the operation was successful.
  12. ScriptEngine then launches the configured service script.
  13. The service script enqueues the session for distribution.
  14. Router receives this request and searches for available agent to handle the session. A suitable agent is found and Router issues a Deliver request to ServerManager.
  15. ServerManager reserves the agent and creates an agent session.
  16. The deliver request is forwarded to CallControl.
  17. CallControl invites OneAgentWeb, through OneSIPConnector and sends a Call::Offering event to ServerManager.
  18. ServerManager evolves the agent state to busy and the agent session state to Connecting – events are sent to agent.
  19. OneAgentWeb accepts call, through OneSIPConnector.
  20. CallControl send a Call::Connected event to ServerManager.
  21. ServerManager evolves the agent session state to Working – event is sent to OneAgentWeb.
  22. CallControl send a Call::RouteEnd event to ServerManager.
  23. The deliver operation is completed successfully and a callback is sent to ServerManager and Router.
  24. The Session::Delivered|Working is sent to ScriptEngine.
  25. ScriptEngine runs the PostCall script if configured to do so.