diff --git a/internal/infrastructure/smpp.go b/internal/infrastructure/smpp.go index 430c5b5..13ffde6 100644 --- a/internal/infrastructure/smpp.go +++ b/internal/infrastructure/smpp.go @@ -15,8 +15,6 @@ type SMPPClient struct { func NewSMPPClient(cfg *config.Config) (*SMPPClient, error) { smppCfg := cfg.SMPP - log.Println("SMPP Config:", smppCfg) // This will print the SMPP configuration - tx := &smpp.Transceiver{ Addr: smppCfg.Addr, User: smppCfg.User, @@ -24,16 +22,12 @@ func NewSMPPClient(cfg *config.Config) (*SMPPClient, error) { Handler: func(p pdu.Body) {}, } - log.Println("Attempting to bind to SMPP server at address:", smppCfg.Addr) - connStatus := tx.Bind() - go func() { - for c := range connStatus { - if c.Status() != smpp.Connected { - log.Println("Failed to connect:", c.Error()) - } - } - }() + status := <-connStatus + if status.Status() != smpp.Connected { + log.Println("Failed to connect:", status.Error()) + return nil, status.Error() + } return &SMPPClient{Transceiver: tx}, nil }