Menu

BYEs, 200s and Terminated Dialog.

SipUnit
Hojo
2014-03-17
2014-03-18
  • Hojo

    Hojo - 2014-03-17

    Hi,

    I am currently testing a B2B SIP servlet and having some issue with SipUnit closing down the dialog. Following an example in another post I created a BYE by hand and waited for the response:

    ...
    LOGGER.info("TEST: {}", sipCallB.getDialog().getState());

    final Request bye = sipCallB.getDialog().createRequest(Request.BYE);
    
    final SipTransaction trans = sipPhoneB.sendRequestWithTransaction(bye, false, sipCallB.getDialog());
    assertNotNull(trans);
    
    LOGGER.info("TEST: {}", sipPhoneB.format());
    
    assertNotNull(sipPhoneB.format(), trans); // request sending was ok
    final EventObject respEvent = sipPhoneB.waitResponse(trans, TIMEOUT);
    LOGGER.info("TEST: {}", sipCallB.getDialog().getState());
    
    LOGGER.info("TEST: {}", sipPhoneB.format());
    
    assertNotNull(sipPhoneB.format(), respEvent);
    
    assertTrue(respEvent instanceof ResponseEvent);
    final Response resp = ((ResponseEvent) respEvent).getResponse();
    assertEquals(Response.OK, resp.getStatusCode());
    

    ...

    Which works and my application gets the BYE request. The problem is when the servlet responds with a 200 OK it complains because the dialog is terminated, which I can see from the output:

    INFO - SipB2BCallSteps - SipB2BCallSteps.java 168 TEST: Confirmed Dialog
    INFO - SipB2BCallSteps - SipB2BCallSteps.java 186 TEST: Not yet determined
    INFO - SipB2BCallSteps - SipB2BCallSteps.java 190 TEST: Terminated Dialog
    ...

    Should SipUnit be closing the dialog in this scenario? If so how can I otherwise test for the response.

    Cheers

    H

     

    Last edit: Hojo 2014-03-17
  • Hojo

    Hojo - 2014-03-17

    I just found this function:
    sipCallB.getDialog().terminateOnBye(false);

    Seems to have changed the outcome of the dialog closure. Need to test further tomorrow.

    H

     

Log in to post a comment.