emiago / sipgo

SIP library for writing fast SIP services in GO
BSD 2-Clause "Simplified" License
500 stars 61 forks source link

Unable to receive Cancel for Invite #122

Closed moksh-samespace closed 6 days ago

moksh-samespace commented 4 weeks ago
Screenshot 2024-08-15 at 2 44 24 AM

I’m unable to receive Cancel requests within the onCancel or onInvite handlers using the following code:

go func() { for { select { case m := <-tx.Cancels(): // handle cancel case m := <-tx.Acks(): // handle ack case <-tx.Done(): // handle completion } } }()

emiago commented 4 weeks ago

Transactions are scoped, you can not fork them. Same as http stdlib

moksh-samespace commented 4 weeks ago

how can I receive cancel for such incoming invite server transactions?

emiago commented 6 days ago

relates to #103

@moksh-samespace try latest code. Now cancel is automatically detected and canceled for you.

moksh-samespace commented 4 days ago

Thanks @emiago . Will have a look at it.