edgeport - v1.0.3
    Preparing search index...

    Function connect

    • Connects to an SMSC over TCP, binds as an ESME, and returns a live session.

      Dials the core transport (implicit TLS when tls: 'implicit', otherwise plaintext), binds in the requested mode, and waits for the bind response so an auth failure surfaces here. A background pump then correlates responses and routes inbound deliver_sms to SmppSession.messages.

      Parameters

      Returns Promise<SmppSession>

      The live session.

      If the SMSC rejects the credentials.

      If the connection cannot be established.

      If the SMSC speaks the protocol incorrectly.

      1.0.3

      import { connect, DataCoding } from 'edgeport/smpp';

      await using smpp = await connect({
      hostname: 'smsc.example.com',
      systemId: 'esme',
      password: env.SMPP_PW,
      bindMode: 'transceiver'
      });

      const id = await smpp.submit({
      source: 'EDGEPORT',
      destination: '12065550111',
      message: 'hello from a Worker',
      registeredDelivery: true
      });

      for await (const inbound of smpp.messages()) {
      if (inbound.isDeliveryReceipt) {
      const r = inbound.receipt();
      if (r.id === id && r.stat === 'DELIVRD') break;
      }
      }