On 2/26/08, Helmut Wolf <HelmutWolf1 at gmx.de> wrote: > Hi Benny, > > I've got a problem with stateful_proxy: A Cancel request sometimes causes a software abortion because assertion failed: > ../src/pjsip/sip_util.c:556: pjsip_endpt_create_cancel: Assertion `req_tdata->msg->type == PJSIP_REQUEST_MSG && > req_tdata->msg->line.req.method.id == PJSIP_INVITE_METHOD' failed. > > The call flow for this example was: > > UA pjsip stateful_proxy SIP Server > -- -------------------- ---------- > > Invite -> > Invite -> > <- trying > <- trying > <- 407 > ACK -> > <- 407 > CANCEL -> > <- 200 Ok > > --> Assertion failed > > The assertion failed because in stateful_proxy.c: proxy_on_rx_request: pjsip_endpt_create_cancel: uas_data->uac_tsx->last_tx the ACK > message is saved, not the INVITE message. > I think there's a bug in the code, that we shouldn't create CANCEL if the UAC INVITE transaction has been completed. I've updated the code in stateful_proxy.c:272 to this: if (uas_data->uac_tsx && uas_data->uac_tsx->status_code < 200) { .. create and send CANCEL cheers, -benny