@Override
 protected void doErrorResponse(SipServletResponse resp) throws ServletException, IOException {
   // If someone rejects it remove the call from the table
   CallStatusContainer calls =
       (CallStatusContainer) getServletContext().getAttribute("activeCalls");
   calls.removeCall(resp.getFrom().getURI().toString(), resp.getTo().getURI().toString());
   calls.removeCall(resp.getTo().getURI().toString(), resp.getFrom().getURI().toString());
 }
Ejemplo n.º 2
0
  /** Update the dialog with the response. Could be needed if there has been multiple dialogs. */
  public void updateDialog(SipServletResponse response) {
    SipSession session = response.getSession();
    if (session.equals(_session)) return;

    if (!session.getCallId().equals(_session.getCallId()))
      throw new IllegalArgumentException(
          "Session " + session + " is not a derived session from " + _session);

    String localTag = response.getFrom().getParameter("tag");
    if (!localTag.equals(_session.getLocalParty().getParameter("tag"))
        && !localTag.equals(_session.getRemoteParty().getParameter("tag")))
      throw new IllegalArgumentException(
          "Session " + session + " is not a derived session from " + _session);

    _session = session;
  }