Skip to main content

Github contributors

License: MIT

Description

Twinkle sip client, ported to a python module.

Tested environments

Hardware Rpi zero W
Operating systems Linux
Python versions Python 3.x
Distros Raspbian 10
Languages English

Instalation

sudo apt-get install twinkle
sudo pip3 install pytwinkle

Example

from pytwinkle import Twinkle

def callback(event, *args):
    if event=="registration_succeeded":
        uri, expires = args
        print("registratiom succeeded, uri: %s, expires in %s seconds"%(uri, expires))
        # The module keeps the session, you havent to register
        mTP.message("name@domain", "Hello")
        mTP.call("name@domain")

    if event=="new_msg":
        msg=args[0]
        print("new_msg!: "+str(msg))
    
    if event=="incoming_call":
        call=args[0]
        print("call: "+str(call))

    if event=="cancelled_call":
        line=args[0]
        print("call cancelled, line: %s"%(line))
        
    if event=="answered_call":
        call=args[0]
        print("answered: %s"%(str(call)))
        
    if event=="ended_call":
        line=args[0]
        print("call ended, line: %s"%(line))
  
mTP = Twinkle(callback)  
mTP.set_account("name","domain","password")
mTP.run()
  • Callbacks
Event Description *Returns *
"registration_succeeded" When the registration suceed Line number and seconds to expire (*)
"new_msg" New message receives msg={'from':uri, 'to':uri 'msg':msg}
"incoming_call" Incoming call call={'from':uri, 'to':uri}
"cancelled_call" Cancelled call Line number
"answered_call" Answered call call={'msg':msg, 'code':num, 'to':uri}
"ended_call" Ended call Line number

(*) doesnt matter the seconds to expire, the program keep the session active

  • Functions

  • call Call someone

  • answer Answer an incoming call

  • answerbye Answer an incoming call or end a call

  • reject Reject an incoming call

  • bye End a call

  • hold Put a call on-hold

  • retrieve Retrieve a held call

  • redial Repeat last call

  • register Register your phone at a registrar

  • deregister De-register your phone at a registrar

  • message Send an instant message

  • Not supported at the moment

    • redirect Redirect an incoming call
    • transfer Transfer a standing call
    • conference Join 2 calls in a 3-way conference
    • mute Mute a line
    • dtmf Send DTMF
    • fetch_reg Fetch registrations from registrar
    • options Get capabilities of another SIP endpoint
    • line Toggle between phone lines
    • dnd Do not disturb
    • auto_answer Auto answer
    • user Show users / set active user
    • presence Publish your presence state
    • quit Quit

Dependencies

  • System dependencies
    • python3
    • twinkle
  • Python dependencies
    • multiprocessing

Mentions

@LubosD - https://github.com/LubosD/twinkle

Developer

Roberto Lama Rodríguez - roberlama@gmail.com

Metadata

Release files for pytwinkle 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytwinkle 0.1.3
File Size Uploaded Provenance Actions
pytwinkle-0.1.3.tar.gz 7.3 kB Without provenance Details for pytwinkle-0.1.3.tar.gz

Release files / pytwinkle-0.1.3.tar.gz

Download URL pytwinkle-0.1.3.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
78e41e4f3a837bc94a1efa4586594fd8feca1e4b6745fcbc231ef8eb9a9aa4cd
BLAKE2b-256 checksum
How to use checksums
ec7157344320bf98aa2f3f6d3fe75eb13bcb27ec513d1160082182728909178c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.3

Security for pytwinkle 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page