Git Product home page Git Product logo

smstools-http-api's People

Contributors

lvasiliev avatar mordae avatar voileux avatar

Stargazers

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

Watchers

 avatar  avatar

smstools-http-api's Issues

IOError: [Errno 2] No such file or directory: when trying to send SMS

When trying to send my first SMS via command entered directly from readme.md
I am getting either python recursion error (mentioned in other issue) or a webpage with error:

IOError: [Errno 2] No such file or directory: 'tmp/outgoing/40fabae2-7edb-4092-a603-d580da0fece7.LOCK'

The full error dump is:

IOError
IOError: [Errno 2] No such file or directory: 'tmp/outgoing/40fabae2-7edb-4092-a603-d580da0fece7.LOCK'

Traceback (most recent call last)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2463, in __call__
return self.wsgi_app(environ, start_response)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2449, in wsgi_app
response = self.handle_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1866, in handle_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 2446, in wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1951, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1820, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1949, in full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line 1935, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/usr/local/lib/python2.7/dist-packages/flask_httpauth.py", line 105, in decorated
return f(*args, **kwargs)
File "/root/smstools-http-api-master/app/api_1_0/views.py", line 76, in outgoing_view
result = send_sms(data)
File "/root/smstools-http-api-master/app/api_1_0/smstools.py", line 160, in send_sms
with open(lock_file, write_mode) as fp:
IOError: [Errno 2] No such file or directory: 'tmp/outgoing/40fabae2-7edb-4092-a603-d580da0fece7.LOCK'
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it. For code execution mouse-over the frame you want to debug and click on the console icon on the right side.

You can execute arbitrary Python code in the stack frames and there are some extra helpers available for introspection:

dump() shows all variables in the frame
dump(obj) dumps all that's known about the object

Enhancement : Allow to delete SMS

Hello,

Thanks for this code. It works well. I would like to know whether you could add a REST method to delete/remove message, in incoming directory.

That will be something like this
DELETE /api/v1.0/sms//string:message_id

I'm willing to help, but i don't know very well how to code.

Regards

Thomas

RuntimeError: maximum recursion depth error

Hi!

Installed the smsmtools-http-api but found error

when open "/api/v1.0/sms/outgoing/" (eq with incomnig (any kind) )

RuntimeError: maximum recursion depth exceeded while calling a Python object..
Traceback (most recent call last):
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask_httpauth.py", line 93, in decorated
    return f(*args, **kwargs)
  File "/opt/smstools-http-api/app/api_1_0/views.py", line 18, in list_some_sms
    return list_some_sms(kind)
....... repeated more times ............
File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask_httpauth.py", line 88, in decorated
    if not self.authenticate(auth, password):
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/flask_httpauth.py", line 125, in authenticate
    return self.verify_password_callback(username, client_password)
  File "/opt/smstools-http-api/app/api_1_0/authentication.py", line 18, in verify_password
    if htpasswd_file.check_password(login, password):
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/passlib/apache.py", line 852, in check_password
    ok, new_hash = self.context.verify_and_update(password, hash)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/passlib/context.py", line 2428, in verify_and_update
    if not record.verify(secret, hash, **clean_kwds):
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/passlib/utils/handlers.py", line 757, in verify
    self = cls.from_string(hash, **context)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/passlib/handlers/md5_crypt.py", line 213, in from_string
    return cls(salt=salt, checksum=chk)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/passlib/utils/handlers.py", line 1376, in __init__
    super(HasSalt, self).__init__(**kwds)
  File "/opt/smstools-http-api/venv/lib/python2.7/site-packages/passlib/utils/handlers.py", line 590, in __init__
    super(GenericHandler, self).__init__(**kwds)
RuntimeError: maximum recursion depth exceeded while calling a Python object

When open
"api/v1.0/sms/incoming/GSM1.0H09ye"
already come the json object.

I try to checkout older states to "258a4b0362aa739c323d986ddc741c1160280e71" comit
but no changes

I try to change

 def list_some_sms(kind):
     result = {}
     return jsonify(result)

but no changes

I use Debian Linux jessie python2.7.9

UTF8 encoding

Polish letter ó in sms showing as a "chinese character".

Does NOT work out of the box - insufficient documentation to prevent 401 Not Authorized

When installed like in readme.md after creating a local server it does NOT work, returning error "unauthorized" 401 upon entering the commands listed in the readme. There is some user mentioned in the curl command listed

curl -u lvv:SecretPAss -i -H "Content-Type: application/json; charset=UTF-8" -d '{"text":"Hi, Jack!", "mobiles":["79680000000", "79160000000"]}' http://127.0.0.1:5000/api/v1.0/sms/outgoing

there is no information where shall I define the luv user with pass SecretPAss.

Listing messages with different From header

Hi, I had to remove this check in our fork because:

  • Incoming messages have From field indicating sender's phone number.
  • Our auditing application needs to see all messages to stash them in a DB.
  • All messages are listed, but only some can be accessed.

What is your use-case?

AttributeError: 'Blueprint' object has no attribute 'json_encoder'

When I try to run this on Ubuntu18.04 I get a stack trace and the message
AttributeError: 'Blueprint' object has no attribute 'json_encoder'
every time I try to send something via http://127.0.0.1:5000/api/v1.0/sms/outgoing. I'm using the curl command from the examples given, with a different mobile number obviously.

Full Trace follows:

Traceback (most recent call last):
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1997, in __call__
    return self.wsgi_app(environ, start_response)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask_httpauth.py", line 91, in decorated
    return self.auth_error_callback()
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask_httpauth.py", line 43, in decorated
    res = f(*args, **kwargs)
  File "/root/smstools-http-api/app/api_1_0/authentication.py", line 30, in auth_error
    return unauthorized('Unauthorized access')
  File "/root/smstools-http-api/app/api_1_0/errors.py", line 17, in unauthorized
    response = jsonify(response)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/json/__init__.py", line 321, in jsonify
    dumps(data, indent=indent, separators=separators) + '\n',
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/json/__init__.py", line 177, in dumps
    _dump_arg_defaults(kwargs)
  File "/root/smstools-http-api/venv/lib/python3.6/site-packages/flask/json/__init__.py", line 98, in _dump_arg_defaults
    bp.json_encoder if bp and bp.json_encoder
AttributeError: 'Blueprint' object has no attribute 'json_encoder'

REQUEST - SMS Status Report in message info

Hello,

is any simple way to add SMS report status into GET /api/v1.0/sms/<kind>/<string:message_id> ?

Report files contains Message_id and Status. Sent SMS files contains a Message_id

SMS STATUS REPORT
Message_id: 35
Discharge_timestamp: 17-08-25 02:41:58
Status: 0,Ok,short message received by the SME

Thank You

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.