Skip to content

Handling Large SIP INVITE Packets in UDP #206

@pavanputhra

Description

@pavanputhra

Description

I am trying to send an INVITE request whose size is around 4000 bytes. However, I receive the following error:

{"level":"debug","caller":"transactionLayer","error":"size of packet larger than MTU","req":"INVITE sip:foo@example.com SIP/2.0","time":"2025-03-12T04:47:50Z","message":"Fail to write request on init"}

size of packet larger than MTU. transaction transport error

I am using the following code to forward the SIP request over UDP:

clTx, err := s.client.TransactionRequest(ctx, req, sipgo.ClientRequestAddVia, sipgo.ClientRequestAddRecordRoute)

Question

Is there a way in the sipgo library handle large SIP messages by automatically fragmenting them when using UDP? If not could this feature be implemented?

Note

I am aware that the SIP RFC recommends switching to TCP when a message exceeds the MTU. However, some proxies like Kamailio implement UDP fragmentation in such situations, which is useful when there is no reliable way to determine whether the User Agent supports TCP.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions