cloudwebrtc / go-sip-ua

Go SIP UA library for client/b2bua
Apache License 2.0
215 stars 84 forks source link

Example UA sends SIP BYE #94

Closed chumvan closed 1 year ago

chumvan commented 1 year ago

Hi, Could anyone share how to send a SIP BYE to a SIP Server using this package? From the example and ua in the pkg, I can only see the Invite and Register implemented. Thanks for your help.

oogali commented 1 year ago
    bye, err := sip.NewRequestBuilder().
        SetMethod("BYE").
        SetContact(contact).
        SetFrom(from).
        SetTo(to).
        SetCallID(callID).
        SetUserAgent(userAgent).
        SetBody("").
        Build()
    if err != nil {
        // ...
    }

    if err := s.Send(bye); err != nil {
        // ...
    }
chumvan commented 1 year ago

Thank you, @oogali. I guess we need to extend the ua package to add this new feature.