Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example for TCP sip client #19

Closed
spookycheekybreeky opened this issue Mar 14, 2023 · 1 comment
Closed

Example for TCP sip client #19

spookycheekybreeky opened this issue Mar 14, 2023 · 1 comment
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@spookycheekybreeky
Copy link

Hey Emiago, do you have an example for an TCP SIP client for connecting to tcp sip server ?

I'm looking to make a small private utils to test if my home TCP sip server are down or not. Can you provide a TCP client example ?

Thanks -Kalvelign

@emiago
Copy link
Owner

emiago commented Mar 15, 2023

Hi @Kalvelign For now I can quick point you on some existing example
After you build UAC like for example here
https://github.com/emiago/sipgo/tree/main/example/register/client

you need to change this line to listne on TCP (FOR NOW you have to make client accepting request on some port before sending to setup transports underneath)
https://github.com/emiago/sipgo/blob/main/example/register/client/main.go#L57

and any request you send you can either change sip.DefaultProtocol = "TCP"
or when building request call
req.SetTransport("TCP")

Library focus was more building server so if you find any issues let me know.
Also there is ongoing ticket to make client handle more API friendly (like no need for listener), so any feedback is welcome.

Use transaction request
https://pkg.go.dev/github.com/emiago/sipgo#Client.TransactionRequest

@emiago emiago added documentation Improvements or additions to documentation question Further information is requested labels Apr 30, 2023
@emiago emiago closed this as completed Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants