Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ GO_FILES := $(shell find ./* -iname '*.go')
GO_RUN := docker run --rm -e GO111MODULE=on -e CGO_ENABLED=0 -e VERSION=$(VERSION) -e HOME=/build/.cache -u $$(id -u $${USER}):$$(id -g $${USER}) -v $$PWD:/build -w /build golang:$(GO_VERSION)
.PHONY: build clean

build: bin/linux-amd64/sip-ping bin/windows-amd64/sip-ping.exe bin/darwin-amd64/sip-ping
build: bin/linux-amd64/sip-ping bin/windows-amd64/sip-ping.exe bin/darwin-amd64/sip-ping bin/darwin-arm64/sip-ping

bin/linux-amd64/sip-ping: $(GO_FILES)
$(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/linux-amd64/sip-ping'
bin/windows-amd64/sip-ping.exe: $(GO_FILES)
$(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/windows-amd64/sip-ping.exe'
bin/darwin-arm64/sip-ping: $(GO_FILES)
$(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=darwin GOARCH=arm64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/darwin-arm64/sip-ping'
bin/darwin-amd64/sip-ping: $(GO_FILES)
$(GO_RUN) bash -c 'CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -mod=vendor -v -ldflags="-s -w" -o ./bin/darwin-amd64/sip-ping'

Expand Down
6 changes: 3 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func main() {
signal.Notify(interrupt, os.Interrupt)

if len(*addr) == 0 {
log.Warn("No addr paramiter found!")
log.Warn("No addr parameter found!")
flag.Usage()
os.Exit(1)
}
Expand Down Expand Up @@ -136,7 +136,7 @@ func querySIP(url *url.URL, skipVerify *bool, request chan string, response chan
var err error
var conn net.Conn
if url.Scheme == "tls" {
log.Debug("doing TLS sip")
log.Debug("Doing TLS sip")
tlsClientConfig := &tls.Config{InsecureSkipVerify: *skipVerify}
conn, err = tls.Dial("tcp", url.Host, tlsClientConfig)
} else if url.Scheme == "udp" {
Expand All @@ -153,7 +153,7 @@ func querySIP(url *url.URL, skipVerify *bool, request chan string, response chan
defer conn.Close()
log.Debug("Rendering SIP Request")
req := renderRequest(TCP_OPTIONS, conn.LocalAddr().String(), url.Scheme)
log.Debug("Request Rendered, writting request")
log.Debug("Request Rendered, writing request")
_, err = conn.Write([]byte(req))
if err != nil {
response_err <- err
Expand Down