Skip to main content

Simply ring a phone via SIP/VoIP

Project description


Logo

nanosip

Simply ring a phone
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Installation
  3. Usage
  4. License

About The Project

nanosip is a minimal implementation of the the SIP INVITE transaction, which is used to ring another phone.

It is

  • not a complete or compliant implementation of SIP.
  • not establishing a VoIP / audio link with the callee.

Simply rings and hangs up.

This package was created to be used by my home assistant integration "sipcall", however it can be used in any other project.

(back to top)

Installation

Install the package from PyPI

pip install nanosip

This package does not have any dependencies

(back to top)

Usage

To make a call, you will need

From your registrar you will obtain the following required information:

  • username
  • password
  • SIP server
  • Domain (usually the same as the server)

You can then make a call like this:

from nanosip import call_and_cancel


auth_creds = SIPAuthCreds(
    username="USERNAME",
    password="PASSWORD"
)

inv = Invite(
    uri_from="sip:USERNAME@DOMAIN",
    uri_to="sip:CALLEE@DOMAIN",
    uri_via="SIP_SERVER",
    auth_creds=auth_creds,
)

call_and_cancel(inv, 15, "SIP_SERVER")

This package also supports use with asyncio. For more examples, check out the examples/ subfolder.

The call_and_cancel method may throw an OSError if something with the connection of the SIP call went wrong. For example, if the credentials are wrong, it will throw an OSError('nanosip error: 407 Unauthorized').

(back to top)

License

Distributed under the GPLv3 License. See LICENSE for more information.

(back to top)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nanosip-0.0.7.tar.gz (61.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nanosip-0.0.7-py3-none-any.whl (19.3 kB view details)

Uploaded Python 3

File details

Details for the file nanosip-0.0.7.tar.gz.

File metadata

  • Download URL: nanosip-0.0.7.tar.gz
  • Upload date:
  • Size: 61.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for nanosip-0.0.7.tar.gz
Algorithm Hash digest
SHA256 1fa03f6c184e411ca272b7e56808e417540feb480934619c75245dfbc0c2ed45
MD5 dd4fc2d8e83aa40c004fb987567ab15a
BLAKE2b-256 6946a851433e763cee86a570ee66162f64820a5515cd276d708a43be10e2ae92

See more details on using hashes here.

File details

Details for the file nanosip-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: nanosip-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 19.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for nanosip-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 bed8fb0d538623efae05fc932f4d463666ff87061917da2a8ab8fb73be5bd827
MD5 b1d91874f320d9ca9e0cb103048bfcb2
BLAKE2b-256 573254eac4349c61ae4bf4438d1cd95e3b80db2639240e2c721319dda0e92ac9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page