SMPP: use default port from libsmpp34

Related: OS#5568
Change-Id: I2140ed57e64f17fb79130014eaf88f58b62d7a00
This commit is contained in:
Max 2022-10-15 15:59:16 +03:00
parent 9683b5f991
commit 4e8f0bb60d
2 changed files with 4 additions and 8 deletions

View File

@ -974,21 +974,17 @@ int smpp_smsc_start(struct smsc *smsc, const char *bind_addr, uint16_t port)
{
int rc;
/* default port for SMPP */
if (!port)
port = 2775;
LOGP(DSMPP, LOGL_NOTICE, "SMPP at %s %d\n",
bind_addr? bind_addr : "0.0.0.0", port);
bind_addr ? bind_addr : "0.0.0.0", port ? port : SMPP_PORT);
rc = osmo_sock_init_ofd(&smsc->listen_ofd, AF_UNSPEC, SOCK_STREAM,
IPPROTO_TCP, bind_addr, port,
IPPROTO_TCP, bind_addr, port ? port : SMPP_PORT,
OSMO_SOCK_F_BIND);
if (rc < 0)
return rc;
/* store new address and port */
rc = smpp_smsc_conf(smsc, bind_addr, port);
rc = smpp_smsc_conf(smsc, bind_addr, port ? port : SMPP_PORT);
if (rc)
smpp_smsc_stop(smsc);
return rc;

View File

@ -244,7 +244,7 @@ static int smpp_esme_init(struct esme *esme, const char *host, uint16_t port)
int rc;
if (port == 0)
port = 2775;
port = SMPP_PORT;
esme->wqueue.bfd.data = esme;
esme->wqueue.read_cb = esme_read_cb;