Giter Club home page Giter Club logo

smppsend's Introduction

SMPPSend

Elixir CI

Simple utility for testing SMSC connections. It allows to bind to SMSCs, send submit_sm PDUs and wait for delivery reports.

Build

mix do deps.get,escript.build

Usage

See:

smppsend --help

Sample usage:

smppsend --submit-sm --source-addr test --destination-addr 71234567890 --source-addr-ton 5 --source-addr-npi 0 --dest-addr-ton 1 --dest-addr-npi 1 --data-coding 0 --host smppex.rubybox.ru --port 2775 --system-id testsid --password password --bind-mode trx --short-message "test" --wait

Sponsored by FunBox

smppsend's People

Contributors

igoradamenko avatar jimni avatar mdlkxzmcp avatar n-epifanov avatar olgeni avatar savonarola avatar tuzovakaoff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smppsend's Issues

При отправке любого sequence_number (--sn) в ручную, в bind всегда подставляется 0.

При отправке через опцию --sn, например

smppsend --submit-sm --source-addr test --destination-addr 71234567890 --source-addr-ton 5 --source-addr-npi 0 --dest-addr-ton 1 --dest-addr-npi 1 --data-coding 0 --host smppex.rubybox.ru --port 2775 --system-id testsid --password password --bind-mode trx --short-message "test" --sn 4

В bind всегда будет подставляться 0. А не переданное в опции --sn значение 4+1.

pdu: bind_transceiver
 .....
  sequence_number: 0
.....

В bind_transmitter_resp вернет верное значение --sn + 1 => 5

 pdu:  bind_transmitter_resp
 .....
  sequence_number: 5
.....

Unable to bind on OTP 17

The following script works fine with smppsend v.0.1.7. and doesn't work with v.0.1.8–v.0.1.11:

./smppsend-17 \
   --submit-sm \
   --source-addr test \
   --destination-addr 70000000000 \
   --source-addr-ton 5 \
   --source-addr-npi 0 \
   --dest-addr-ton 1 \
   --dest-addr-npi 1 \
   --data-coding 0 \
   --host 0.0.0.0 \
   --port 2775 \
   --system-id test \
   --password test \
   --bind-mode trx \
   --short-message ab

Stack trace goes:

00:41:13.899 [info]  Connecting to 0.0.0.0:2775

00:41:13.993 [info]  Connected

00:41:13.993 [info]  Binding

00:41:14.082 [error] GenServer #PID<0.70.0> terminating
** (UndefinedFunctionError) undefined function: :ets.take/2
    (stdlib) :ets.take(32793, 1)
    (smppex) lib/smppex/pdu_storage.ex:67: SMPPEX.PduStorage.handle_call/3
    (stdlib) gen_server.erl:607: :gen_server.try_handle_call/4
    (stdlib) gen_server.erl:639: :gen_server.handle_msg/5
    (stdlib) proc_lib.erl:237: :proc_lib.init_p_do_apply/3
** (exit) exited in: GenServer.call(#PID<0.65.0>, {:call, {:request, %SMPPEX.Pdu{command_id: 9, command_status: 0, mandatory: %{addr_npi: nil, addr_ton: nil, address_range: nil, interface_version: nil, password: "ab52622", system_id: "ab52622", system_type: nil}, optional: %{}, ref: #Reference<0.0.0.101>, sequence_number: 0}}}, 5000)
    ** (EXIT) an exception was raised:
        ** (UndefinedFunctionError) undefined function: :ets.take/2
            (stdlib) :ets.take(32793, 1)
            (smppex) lib/smppex/pdu_storage.ex:67: SMPPEX.PduStorage.handle_call/3
            (stdlib) gen_server.erl:607: :gen_server.try_handle_call/4
            (stdlib) gen_server.erl:639: :gen_server.handle_msg/5
            (stdlib) proc_lib.erl:237: :proc_lib.init_p_do_apply/3
    (elixir) lib/gen_server.ex:544: GenServer.call/3
    (smppex) lib/smppex/esme/sync.ex:49: SMPPEX.ESME.Sync.request/3
    (smppsend) lib/smppsend/esme_helpers.ex:23: SMPPSend.ESMEHelpers.bind/3
    (smppsend) lib/smppsend.ex:174: SMPPSend.bind/1
    (smppsend) lib/smppsend.ex:252: SMPPSend.chain/2
    (smppsend) lib/smppsend.ex:83: SMPPSend.main/1
    (elixir) lib/kernel/cli.ex:76: anonymous fn/3 in Kernel.CLI.exec_fun/2

As far as I can tell this only affects OTP 17. All newer versions run just fine for me.

I also tried completely reverting commit savonarola/smppsend@cc1ebfc from the master (including the downgrade of smppex back to 0.2.0) and it solved this issue for me. However, this solution looks rather brute. Might there be a way to keep the OTP 17 support while still unbinding gracefully after send? And is this way worthwhile?

split-max-bytes не работает, если длина текcта short-message <= split-max-bytes

Шлю сообщение с опцией split-max-bytes

smppsend --bind-mode trx --host smppex.rubybox.ru --port 2775 --system-id testsid --password password --submit-sm --source-addr test --destination-addr 71234567890 --source-addr-npi 0 --source-addr-ton 5 --dest-addr-npi 1 --dest-addr-ton 1 --short-message 'SOME TEXT' --split-max-bytes=9 --udh-ref 889

HP
Сообщение не разбивается на части

OP
Судя по описанию опции, сообщение должно было разбиться на 5 частей по 9 байт
(7 байт загловок UDH + 2 байта текст сообщения)

--split-max-bytes len Split short_message and send resulting parts with several submit_sm PDUs, so that each submit_sm's short_message size(including UDHs) does not exceed len bytes. Each short_messages is automatically prepended with UDHs with ref taken from --udh-ref option

для целей тестирования было бы удобнее, если бы split-max-bytes не учитывал длину заголовка UDH, а считал только сам текст сообщения

Exception on deliver_sm

Hi,

I am getting this error when sending deliver_sm from our server

** (UndefinedFunctionError) function SMPPEX.ESME.Sync.send_pdu/2 is undefined or private. Did you mean one of:

      * handle_pdu/2

    (smppex) SMPPEX.ESME.Sync.send_pdu(#PID<0.133.0>, %SMPPEX.Pdu{command_id: 2147483653, command_status: 0, mandatory: %{}, optional: %{}, ref: #Reference<0.1747105837.212336642.231499>, sequence_number: 1})
    (smppsend) lib/smppsend/esme_helpers.ex:144: SMPPSend.ESMEHelpers.handle_async_results/4
    (smppsend) lib/smppsend/esme_helpers.ex:98: SMPPSend.ESMEHelpers.wait_dlrs/4
    (smppsend) lib/smppsend.ex:290: SMPPSend.wait_dlrs/1
    (smppsend) lib/smppsend.ex:340: SMPPSend.chain/2
    (smppsend) lib/smppsend.ex:83: SMPPSend.main/1
    (elixir) lib/kernel/cli.ex:121: anonymous fn/3 in Kernel.CLI.exec_fun/2

The call to smpsend is fairly standard:

./smppsend --host localhost --port 7777 --system-id [redacted] --password [redacted] --bind-mode trx --submit-sm --source-addr SIROCCO --destination-addr [redacted] --short-message test1 --registered-delivery 1 --source-addr-npi 1 --source-addr-ton 5 --dest-addr-npi 1 --dest-addr-ton 1 --wait-dlrs 1200000 --wait

And this is my runtime config

Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1]
Elixir 1.9.1 (compiled with Erlang/OTP 22)

Any hint ?

Thanks

Strange `no-break space` conversion to UCS2

I was trying to convert no-break space (0xC2A0 in UTF-8) to UCS2, expecting 0x00A0 as a result. What I'm getting instead is 0x00C2A0 which is not only incorrect but also corrupts the rest of the message (0xA0 becomes a start of the next alleged code point).

I am using a binary from this release https://github.com/savonarola/smppsend/releases/tag/v0.1.9 on a Mac with Erlang/OTP 20 [erts-9.0.4] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Show application version

I would like to be able to get app version from a compiled binary because there are a lot of hosts in our production environment and I'm never sure if the script I'm running is up to date.

I could try making a PR for this feature if you don't mind.
Is smppsend --version elixir-ish enough way of implementing this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.