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

Support of TCP #26

Merged
merged 11 commits into from
Feb 8, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixed regexp
  • Loading branch information
NoelM committed Feb 7, 2025
commit 0383f06b31f549d707a99ac44d2ac319d230f72f
8 changes: 2 additions & 6 deletions notel/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"net"
"regexp"
"sync"
"time"

"github.com/NoelM/minigo"
"github.com/NoelM/minigo/notel/confs"
Expand Down Expand Up @@ -76,10 +75,9 @@ func waitForConnect(tcp *minigo.TCP) (string, error) {
*/

msg := make([]byte, 0)
re := regexp.MustCompile(`CALLFROM\s(\d+)\nSTARTURL\nPCE\s\d`)
re := regexp.MustCompile(`CALLFROM\s(\d+)\nSTARTURL\s\nPCE\s\d`)

start := time.Now()
for time.Since(start) < time.Minute {
for {
part, err := tcp.Read()
if err != nil {
return "", err
Expand All @@ -91,6 +89,4 @@ func waitForConnect(tcp *minigo.TCP) (string, error) {
return re.FindStringSubmatch(string(msg))[0], nil
}
}

return "", fmt.Errorf("unable to connect V.23")
}