@@ -40,37 +40,17 @@ import (
4040)
4141
4242// An interface mirroring sipgo.Client to be able to mock it in tests.
43+ // Note: *sipgo.Client implements this interface directly, so no wrapper is needed.
4344type SIPClient interface {
44- TransactionRequest (req * sip.Request ) (sip.ClientTransaction , error )
45- WriteRequest (req * sip.Request ) error
45+ TransactionRequest (req * sip.Request , options ... sipgo. ClientRequestOption ) (sip.ClientTransaction , error )
46+ WriteRequest (req * sip.Request , options ... sipgo. ClientRequestOption ) error
4647 Close () error
4748}
4849
49- // Passthrough implementation of SIPClient with a sipgo.Client.
50- type sipgoClientWrapper struct {
51- client * sipgo.Client
52- }
53-
54- func (w * sipgoClientWrapper ) TransactionRequest (req * sip.Request ) (sip.ClientTransaction , error ) {
55- return w .client .TransactionRequest (req )
56- }
57-
58- func (w * sipgoClientWrapper ) WriteRequest (req * sip.Request ) error {
59- return w .client .WriteRequest (req )
60- }
61-
62- func (w * sipgoClientWrapper ) Close () error {
63- return w .client .Close ()
64- }
65-
6650type GetSipClientFunc func (ua * sipgo.UserAgent , options ... sipgo.ClientOption ) (SIPClient , error )
6751
6852func DefaultGetSipClientFunc (ua * sipgo.UserAgent , options ... sipgo.ClientOption ) (SIPClient , error ) {
69- client , err := sipgo .NewClient (ua , options ... )
70- if err != nil {
71- return nil , err
72- }
73- return & sipgoClientWrapper {client : client }, nil
53+ return sipgo .NewClient (ua , options ... )
7454}
7555
7656type Client struct {
0 commit comments