nanosip


Namenanosip JSON
Version 0.0.7 PyPI version JSON
download
home_page
SummarySimply ring a phone via SIP/VoIP
upload_time2023-12-30 21:03:54
maintainer
docs_urlNone
author
requires_python>=3.8
license
keywords call sip voip
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->
<a name="readme-top"></a>


<!-- PROJECT LOGO -->
<br />
<div align="center">
  <a href="https://github.com/philipp-fischer/nanosip">
    <img src="https://raw.githubusercontent.com/philipp-fischer/nanosip/main/images/logo.png" alt="Logo" width="128" height="128">
  </a>

<h3 align="center">nanosip</h3>
  <p align="center">
    Simply ring a phone
    <br />
    <a href="https://github.com/philipp-fischer/nanosip/issues">Report Bug</a>
    ยท
    <a href="https://github.com/philipp-fischer/nanosip">Request Feature</a>
  </p>
</div>



<!-- TABLE OF CONTENTS -->
<details>
  <summary>Table of Contents</summary>
  <ol>
    <li><a href="#about-the-project">About The Project</a></li>
    <li><a href="#installation">Installation</a></li>
    <li><a href="#usage">Usage</a></li>
    <li><a href="#license">License</a></li>
  </ol>
</details>



## About The Project

nanosip is a minimal implementation of the the [SIP](https://datatracker.ietf.org/doc/html/rfc3261) `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.

<p align="right">(<a href="#readme-top">back to top</a>)</p>


## Installation


Install the package from PyPI
```sh
pip install nanosip
```
This package does not have any dependencies

<p align="right">(<a href="#readme-top">back to top</a>)</p>


## Usage

To make a call, you will need

- either a cloud-based SIP registrar (e.g. [sipgate](https://www.sipgate.de/), [easybell](https://www.easybell.de/) or others)
- or a local PBX that runs on your router or local server (e.g. a [FRITZ!Box](https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7590/42_IP-Telefon-an-FRITZ-Box-anmelden-und-einrichten/) or [asterisk](https://www.asterisk.org/))

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:

```python
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')`.

<p align="right">(<a href="#readme-top">back to top</a>)</p>


## License

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

<p align="right">(<a href="#readme-top">back to top</a>)</p>


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "nanosip",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": "",
    "keywords": "call,sip,voip",
    "author": "",
    "author_email": "Philipp Fischer <me@phil.fm>",
    "download_url": "https://files.pythonhosted.org/packages/69/46/a851433e763cee86a570ee66162f64820a5515cd276d708a43be10e2ae92/nanosip-0.0.7.tar.gz",
    "platform": null,
    "description": "<!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 -->\n<a name=\"readme-top\"></a>\n\n\n<!-- PROJECT LOGO -->\n<br />\n<div align=\"center\">\n  <a href=\"https://github.com/philipp-fischer/nanosip\">\n    <img src=\"https://raw.githubusercontent.com/philipp-fischer/nanosip/main/images/logo.png\" alt=\"Logo\" width=\"128\" height=\"128\">\n  </a>\n\n<h3 align=\"center\">nanosip</h3>\n  <p align=\"center\">\n    Simply ring a phone\n    <br />\n    <a href=\"https://github.com/philipp-fischer/nanosip/issues\">Report Bug</a>\n    \u00b7\n    <a href=\"https://github.com/philipp-fischer/nanosip\">Request Feature</a>\n  </p>\n</div>\n\n\n\n<!-- TABLE OF CONTENTS -->\n<details>\n  <summary>Table of Contents</summary>\n  <ol>\n    <li><a href=\"#about-the-project\">About The Project</a></li>\n    <li><a href=\"#installation\">Installation</a></li>\n    <li><a href=\"#usage\">Usage</a></li>\n    <li><a href=\"#license\">License</a></li>\n  </ol>\n</details>\n\n\n\n## About The Project\n\nnanosip is a minimal implementation of the the [SIP](https://datatracker.ietf.org/doc/html/rfc3261) `INVITE` transaction, which is used to ring another phone.\n\nIt is \n\n- **not** a complete or compliant implementation of SIP.\n- **not** establishing a VoIP / audio link with the callee.\n\nSimply rings and hangs up.\n\nThis package was created to be used by my home assistant integration \"sipcall\", however it can be used in any other project.\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n\n## Installation\n\n\nInstall the package from PyPI\n```sh\npip install nanosip\n```\nThis package does not have any dependencies\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n\n## Usage\n\nTo make a call, you will need\n\n- either a cloud-based SIP registrar (e.g. [sipgate](https://www.sipgate.de/), [easybell](https://www.easybell.de/) or others)\n- or a local PBX that runs on your router or local server (e.g. a [FRITZ!Box](https://avm.de/service/wissensdatenbank/dok/FRITZ-Box-7590/42_IP-Telefon-an-FRITZ-Box-anmelden-und-einrichten/) or [asterisk](https://www.asterisk.org/))\n\nFrom your registrar you will obtain the following required information:\n\n- username\n- password\n- SIP server\n- Domain (usually the same as the server)\n\nYou can then make a call like this:\n\n```python\nfrom nanosip import call_and_cancel\n\n\nauth_creds = SIPAuthCreds(\n    username=\"USERNAME\",\n    password=\"PASSWORD\"\n)\n\ninv = Invite(\n    uri_from=\"sip:USERNAME@DOMAIN\",\n    uri_to=\"sip:CALLEE@DOMAIN\",\n    uri_via=\"SIP_SERVER\",\n    auth_creds=auth_creds,\n)\n\ncall_and_cancel(inv, 15, \"SIP_SERVER\")\n```\n\nThis package also supports use with `asyncio`. For more examples, check out the `examples/` subfolder.\n\nThe `call_and_cancel` method may throw an `OSError` if something with the connection of the SIP call went wrong.\nFor example, if the credentials are wrong, it will throw an `OSError('nanosip error: 407 Unauthorized')`.\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n\n## License\n\nDistributed under the GPLv3 License. See `LICENSE` for more information.\n\n<p align=\"right\">(<a href=\"#readme-top\">back to top</a>)</p>\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "Simply ring a phone via SIP/VoIP",
    "version": "0.0.7",
    "project_urls": {
        "Documentation": "https://github.com/philipp-fischer/nanosip",
        "Homepage": "https://github.com/philipp-fischer/nanosip",
        "Issues": "https://github.com/philipp-fischer/nanosip/issues",
        "Repository": "https://github.com/philipp-fischer/nanosip.git"
    },
    "split_keywords": [
        "call",
        "sip",
        "voip"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "573254eac4349c61ae4bf4438d1cd95e3b80db2639240e2c721319dda0e92ac9",
                "md5": "b1d91874f320d9ca9e0cb103048bfcb2",
                "sha256": "bed8fb0d538623efae05fc932f4d463666ff87061917da2a8ab8fb73be5bd827"
            },
            "downloads": -1,
            "filename": "nanosip-0.0.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1d91874f320d9ca9e0cb103048bfcb2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 19267,
            "upload_time": "2023-12-30T21:03:52",
            "upload_time_iso_8601": "2023-12-30T21:03:52.380440Z",
            "url": "https://files.pythonhosted.org/packages/57/32/54eac4349c61ae4bf4438d1cd95e3b80db2639240e2c721319dda0e92ac9/nanosip-0.0.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6946a851433e763cee86a570ee66162f64820a5515cd276d708a43be10e2ae92",
                "md5": "dd4fc2d8e83aa40c004fb987567ab15a",
                "sha256": "1fa03f6c184e411ca272b7e56808e417540feb480934619c75245dfbc0c2ed45"
            },
            "downloads": -1,
            "filename": "nanosip-0.0.7.tar.gz",
            "has_sig": false,
            "md5_digest": "dd4fc2d8e83aa40c004fb987567ab15a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 61892,
            "upload_time": "2023-12-30T21:03:54",
            "upload_time_iso_8601": "2023-12-30T21:03:54.177230Z",
            "url": "https://files.pythonhosted.org/packages/69/46/a851433e763cee86a570ee66162f64820a5515cd276d708a43be10e2ae92/nanosip-0.0.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-30 21:03:54",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "philipp-fischer",
    "github_project": "nanosip",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "nanosip"
}
        
Elapsed time: 0.71897s