Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions sip/transaction_layer.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,14 @@ func (txl *TransactionLayer) handleRequest(req *Request) error {

tx, exists := txl.getServerTx(key)
if exists {
// If ok this should terminate this transaction
if err := tx.Receive(req); err != nil {
return fmt.Errorf("failed to receive req: %w", err)
}

// Reuse connection and send 200 for CANCEL
if err := tx.conn.WriteMsg(NewResponseFromRequest(req, StatusOK, "OK", nil)); err != nil {
return fmt.Errorf("Failed to respond 200 for CANCEL: %w", err)
}
// If ok this should terminate this transaction
if err := tx.Receive(req); err != nil {
return fmt.Errorf("failed to receive req: %w", err)
}
return nil
}
// Now proceed as normal transaction, and let developer decide what todo with this CANCEL
Expand Down
3 changes: 2 additions & 1 deletion sip/transaction_server_tx_fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ func (tx *ServerTx) inviteStateProcceeding(s fsmInput) fsmInput {
case server_input_request:
tx.fsmState, spinfn = tx.inviteStateProcceeding, tx.actRespond
case server_input_cancel:
tx.fsmState, spinfn = tx.inviteStateProcceeding, tx.actCancel
// tx.fsmState, spinfn = tx.inviteStateProcceeding, tx.actCancel
tx.fsmState, spinfn = tx.stateProceeding, tx.actCancel
case server_input_user_1xx:
tx.fsmState, spinfn = tx.inviteStateProcceeding, tx.actRespond
case server_input_user_2xx:
Expand Down