Giter Club home page Giter Club logo

pycall's Introduction

pycall

pycall Release pycall Downloads pycall Code Quality pycall Build pycall Coverage Randall Degges on Gratipay

A flexible python library for creating and using Asterisk call files.

Please visit our official website to get an overview, and see the docs: http://pycall.org/

Details

pycall's People

Contributors

beppler avatar kc57 avatar manzato avatar randalldegges-okta-2 avatar rdegges avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pycall's Issues

Call multiple phone numbers at once by separating your dial strings with the & character, not working

Hi, tks for the great lib!
I'm trying to use it to send multiple calls, like the docs explain, to separate with & each string:

`
from pycall import CallFile, Call, Application

call = Call('SIP/serverts2/12129998888&SIP/serverts2/12127778888')
action = Application('Playback', 'hello-world')

c = CallFile(call, action)
c.spool()
`

But it returns a parse error in asterisk ... what Am I doing wrong?

Tks

path.py >= 10.0 not working

With path.py = 10.0

python -c "import pycall"
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/pycall/init.py", line 8, in
from .callfile import CallFile
File "/usr/local/lib/python2.7/dist-packages/pycall/callfile.py", line 11, in
from path import path
ImportError: cannot import name path

pip install -I path.py==9.1
Downloading/unpacking path.py==9.1
Downloading path.py-9.1-py2.py3-none-any.whl
Installing collected packages: path.py
Successfully installed path.py
Cleaning up...

python -c "import pycall"

And now no errors

Regarding Environment Setup

Hi, I am really excited about this project and can't wait to test it. Could you please provide the preparation steps in detail that are mentioned here docs.pycall.org/en/latest/usage.html#preparation
I have Ubuntu 14.04 as my base OS.

Thanks

Write Integration Tests

Write all necessary integration tests. Make sure everything works as advertised. Test all functions.

path problem with py

hello i hope you can see this message im have instaled the pycall 2.2 but when trying to run the test file im getting this output

$# python call-test.py 19096382236
/usr/lib/python2.6/site-packages/path.py:1717: DeprecationWarning: path is deprecated. Use Path instead.
warnings.warn(msg, DeprecationWarning)
$#

don't mind me, i installed 2.7 py and it works, now going to test :D thanks for developing this.!!

pycall error - No module named 'pycall

im trying to run these lines of code in PyCharm 2020.2.1 and Python 3.8.3:

call.py

Initiate an internal call to 100 and say

'hello world!' when the caller answers.

from pycall import CallFile, Call, Application

call = Call('SIP/100')
action = Application('Playback', 'hello-world')

c = CallFile(call, action)
c.spool()

i faced with this message error

C:\PythonProgram\pycall-master\tests>python call.py
Traceback (most recent call last):
File "call.py", line 4, in
from pycall import CallFile, Call, Applica
ModuleNotFoundError: No module named 'pycall'

Could you help me solving my problem?
thank you in advance

No authentication ?

Couldn't find in the documentation how to authenticate the pycall as a legitimate SIP extension
in front of the PBX

Good for sip clients but bug with call to pstn numbers

hello
calling sip clients it works like a charm

However calling pstn numbers i got a strange behaviour.

here my python code
vars = {'local': int(c)}
call = Call('sip/pstn/3478',callerid=b,wait_time=10, retry_time=5,
max_retries=0,variables=vars)
#action = Application('Playback', 'hello-world')
#c = CallFile(call, action)
con = Context('alarmes', 's', '1')
c = CallFile(call, con)

c.spool()

extensions.conf

[alarmes]
exten => s,2,SayNumber(${local},c)
exten => s,3,SayAlpha(GOOD)
exten => s,4,Hangup()

in asterisk console i see that asterisk executes [alarmes] and dont wait for the pstn number to answer.
When the pstn number answers it still can hear the end of the "GOOD" word.

if i change sip/pstn/3478 to sip/someuser it waits for someuser to answer to start saying something.

Please help

Dont call and no error

as the title says, i've downloaded it using pip on my freepbx and just copied your script on the site pycall.org and changed the trunk name to mine and the number to the number i wanna call but after executing no error is provided but no call are sent, what are happening? i know that i've configured the trunk and outgoing calls route correctly because my provider helped me to do and confirm that it works correctly and even on the dashboard of freepbx i can see that theres a trunk online.

Finish Unit Tests

Finish all the unit tests and get 100% coverage. This should use only mock objects -- no integration testing.

Can do the integration testing later.

callfile.py typo

There is a typo in callfie.py on line 79

callerid += '<%s>' % se;f.callerid_num

pycall validation error

im trying to run these lines of code in atom and python3.6 :

from pycall import CallFile, Call, Application
import sys


def call():
        c = Call('SIP/200')
        a = Application('Playback', 'hello-world')
        cf = CallFile(c, a)
        cf.spool()

if __name__ == '__main__':
        call()

and my sip.conf and extension.conf are shown below:

sip.conf


[general]
disallow=all
allow=g729
allow=ulaw
allow=alaw
context=local_test
allowguest=no
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=no
alwaysauthreject=yes
canreinvite=no
nat=yes
session-timers=refuse
localnet=192.168.1.0/255.255.255.0
host=dynamic
callevents=yes
notifyhold = yes
callcounter=yes

[100]
type=friend
host=dynamic
secret=123
context=local_test

[200]
type=friend
host=dynamic
secret=123
context=local_test

extension.conf

[local_test]
exten => 1234,1,Answer ; answer the call
exten => 1234,2,Playback(tt-weasels) ; play an audio file that simulates the voice of the called user
exten => 1234,3,Hangup ; hang up the call

exten => 100,1,Set(VOLUME(RX)=10) ; set the RX volume
exten => 100,2,Set(VOLUME(TX)=10) ; set the RX volume
exten => 100,hint,SIP/100; hint  '100' used for presence notification
exten => 100,3,Dial(SIP/100) ; call the user 100'


exten => 200,1,Set(VOLUME(RX)=10) ; set the RX volume
exten => 200,2,Set(VOLUME(TX)=10) ; set the RX volume
exten => 200,hint,SIP/100; hint  '200' used for presence notification
exten => 200,3,Dial(SIP/200) call the user '200' used for presence notification

main.py

from pycall import CallFile, Call, Application
import sys


def call():
        c = Call('SIP/200')
        a = Application('Playback', 'hello-world')
        cf = CallFile(c, a)
        cf.spool()

if __name__ == '__main__':
        call()

finally i faced with this error:

Traceback (most recent call last):
  File "/home/pd/gits/voiphone/main.py", line 12, in <module>
    call()
  File "/home/pd/gits/voiphone/main.py", line 9, in call
    cf.spool()
  File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 135, in spool
    self.writefile()
  File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 123, in writefile
    f.write(self.contents)
  File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 118, in contents
    return '\n'.join(self.buildfile())
  File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 100, in buildfile
    raise ValidationError
pycall.errors.ValidationError

i would appreciate if you help me solving my problem.
thank you in advance

ImportError on pycall

Hi!
I have installed pycall but I can't use it:

$ python3
Python 3.4.2 (default, Oct 8 2014, 10:45:20)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.

from pycall import CallFile, Call, Application
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.4/dist-packages/pycall/init.py", line 6, in
from .errors import PycallError, InvalidTimeError, NoSpoolPermissionError, NoUserError, NoUserPermissionError, UnknownError, ValidationError
File "/usr/local/lib/python3.4/dist-packages/pycall/errors.py", line 4, in
from exceptions import Exception
ImportError: No module named 'exceptions'

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.