Closed amccool closed 6 months ago
hi @amccool. Can you confirm you have tested with latest binary (I have no versioning yet). This line should do this lookup https://github.com/emiago/sipgo/blob/9a076d63800013d7cede0870315178131c76839f/sip/transport_layer.go#L434
As for source code, if you are doing dial this is invoked. https://github.com/emiago/sipgox/blob/main/phone.go#L418
So you can quickly build your softphone ;)
used the binary (windows) retrieved on 2024/03/27 from here: https://github.com/emiago/gophone/releases/tag/v1.0.0
could you supply some instructions on running the phone.go from sipgox. I seem to be missing something go run phone.go
no I meant, gophone is just exec binary for that function, so you can quickly write main function and execute above. There is in Readme example.
Anyway I would like to test and debug your case scenario. As you are on windows, maybe it is something within resolver.
Can you run gophone.exe
with env set in your power shell and paste output here.
So this
$env:LOG_LEVEL = debug
$env:SIP_DEBUG = true
\gophone.exe dial ......
I hate posting all this data, but its all internal
_sip._udp.33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net SRV service location: priority = 0 weight = 0 port = 5060 svr hostname = sip-registrar.devint.dev-r5ead.net
PS C:\Users\amccool\source\repos\amccool\sipgox> ..\gophone-windows.exe dial sip:a41r103b1@33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net
09:03:37.326 DBG Dial > Dialing... recipient=sip:a41r103b1@33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net
09:03:37.360 INF Dial > Listening on addr=172.18.26.74:65441 network=udp
09:03:37.364 DBG transportlayer > DNS Resolving host=33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net
09:03:37.371 DBG transport
hmm seems we have some skipped checks
So SRV lookup did not failed, but question is did sipgo failed to parse IP.
I see this line
09:03:37.415 WRN transportlayer > DNS resolution is slow dur=50.966
and connection got still created. In this case it is UDP but for TCP it would fail.
Here I added more logs in binary. So download from this comment in attach, and we should see at least response.
but bug is probably in sipgo library here https://github.com/emiago/sipgo/blob/54a4f2ad43f1c00b63bdc7ad0982aacb3891fa1b/sip/transport_layer.go#L439
hmm I think I know what is issue, with some latest refactoring, return value from SRV is probably not resolved to IP
using the new release. looks closer
DNS Resolving host=33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net 12:56:05.945 DBG IP addr resolving failed, doing via dns resolver... error="lookup 33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net: no such host" 12:56:05.948 DBG SRV resolved addrs=33333333-3333-3bad-c0de-333333333333.devint.dev-r5ead.net:5060 12:56:05.948 DBG Dial > Closing listener addr=172.18.26.74:64979 12:56:05.94912:56:05.949 DBG ERRtransport
>Dial Read connection closed >error= "read udp 172.18.26.74:64979: use of closed network connection"Call failed addr=error=172.18.26.74:64979 "SRV resolving failed for \"sip-registrar.devint.dev-r5ead.net\""12:56:05.951 DBG transport 12:56:05.951 > Read listener connection stopped DBG addr=transactionLayer172.18.26.74:64979 transaction layer closed 12:56:05.952 DBG transportlayer > Layer is closing
show me how to build this and I can sort out the data
Now I am sending you fix. This already landed on sipgo main, as I thought we have skipped resolving sip-registrar.devint.dev-r5ead.net
Pls confirm that now works
same error. I see the sipgo change. gimme a hint on building the gophone.go. I dont see where the command line arguments are getting setup
@amccool Here https://github.com/emiago/sipgox?tab=readme-ov-file#dialer
Same code is invoked by gophone. If you figure out, push PR. Thnx
@amccool this is now definetely fixed. Checkout latest release. I have tested. So one problem could be that default was always local resolving first.
You can pass -dns_srv
to prefer DNS SRV lookup, and local will be as failover.
@emiago this cmd line tool is very effective for testing. However the domain name of the sip address is not resolving using the SRV record of the sip address domain.
I would be happy to help out if I could see the source.
side note: I would need to plug into the "events" to perform execute additional actions or logging to complete the integration testing loop.