smpp implemented

This commit is contained in:
kemvl 2024-03-28 17:37:22 +05:00
parent 10703b0762
commit 6f8896d0ab
3 changed files with 18 additions and 3 deletions

View File

@ -26,10 +26,10 @@ type HTTPServer struct {
}
type SMPP struct {
Addr string `yaml:"addr"`
Addr string `yaml:"address"`
User string `yaml:"user"`
Pass string `yaml:"pass"`
Src_Phone_Number string `yaml:"src_phone_number"`
Pass string `yaml:"password"`
Src_Phone_Number string `yaml:"src_phone_num"`
}
func LoadConfig() *Config {

View File

@ -15,6 +15,8 @@ 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,
@ -22,6 +24,8 @@ 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 {

View File

@ -11,3 +11,14 @@ time=2024-03-28T15:57:27.775+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T15:57:35.522+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T15:58:06.282+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T15:58:12.643+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T16:38:46.746+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T16:39:01.539+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T16:56:56.196+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T16:57:01.415+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T17:04:01.045+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T17:04:12.227+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T17:06:33.939+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T17:07:06.700+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T17:35:03.319+05:00 level=INFO msg="Server is up and running"
time=2024-03-28T17:35:22.596+05:00 level=INFO msg="Shutting down the server gracefully..."
time=2024-03-28T17:35:26.502+05:00 level=INFO msg="Server is up and running"