sipgo icon indicating copy to clipboard operation
sipgo copied to clipboard

example/proxysip: TestInviteCallUDP test case hangs

Open samuhvarta opened this issue 9 months ago • 2 comments

First of all, thank you for this great project and all the work you have put behind this!

I am trying to compile the example/sipproxy project and understand how this project can be used to run a simple SIP proxy. I notice that the tests in example/sipproxy hang in latest master and since v0.32.0.

Steps to reproduce

❯ cd example/proxysip
❯ go test ./... -v
=== RUN   TestInviteCallUDP
    main_test.go:244: Running proxy {127.0.0.1 5060 } {127.0.0.2 5060 } {127.0.0.3 5060 }
    main_test.go:140: CLIENT1: Send INVITE
    main_test.go:142: CLIENT1 INVITE: Got response
panic: test timed out after 10m0s
        running tests:
                TestInviteCallUDP (10m0s)

The tests were run using go 1.23.4 and 1.24.3 toolchains

samuhvarta avatar May 20 '25 16:05 samuhvarta

Hi @samuhvarta . Thanks for reporting. Yeah it is just not something always checked. Maybe example needs to rechecked. Building proxy should not be complex. All you need to have client sending transaction request and then keeping server and client transaction open, until they finish with Done() . Acks() also should be proxied in reverse.

emiago avatar May 22 '25 06:05 emiago

Thank you for the insight! I think the example project has all the code necessary for a fully functional proxy. The examples you provide with this repository has lot of value!

Regarding failing example test, it seemed like there was a deadlock in the fakes/UDPconnection that was causing the test to fail. This started only after v0.32.x versions. Need more time to investigate.

samuhvarta avatar May 22 '25 10:05 samuhvarta