Giter Club home page Giter Club logo

Comments (7)

rdegges avatar rdegges commented on August 29, 2024

Hi there. Looking at the code right now, but I'm a bit confused--would you mind posting all your Python code and Asterisk code as well?

The reason I ask is because your code is currently telling Asterisk to execute 'alarmes,s,1', but that priority doesn't exist in your Asterisk dialplan code (Your [alarmes] context starts with a priority of 2.)

Also: it looks like the channel you're trying to call is invalid, eg: 'sip/pstn/3478' doesn't look like any valid channel I've ever seen.

from pycall.

ramstein74 avatar ramstein74 commented on August 29, 2024

Sorry,
trial and error just deleted one line
I´m no expert. Just trying to make something usefull in my company.
I´m testing linksys spa3102 connected inside my company in a regular phone
line.

Here it is extensions.con

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

[pstn]
exten => 3436,1,Answer()
same=> n,NoOp(${CALLERID})
same => n,Read(TMP,vm-enter-num-to-call,3,,1,3)
same => n,AGI(script3.py,${TMP},${CALLERID))
same => n,Hangup()

[default]
exten=>_02.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_09.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,1,Verbose(2,a ligar do interno)
exten=>_3XXX,n,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,n,Hangup()
exten=>_5xxx,1,Dial(SIP/line1,10)
exten=>_5xxxx,2,Hangup()

my python code inside web2py framework

@service.xmlrpc
def phone(a,b,c):
print "calling ",a
vars = {'local': int(c)}
call = Call('sip/robert',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()
return 0

my sip file:

users
nat=yes
type=friend
host=dynamic
qualify=yes
context=default
disallow=all
allow=ulaw,g726,gsm
dtmfmode=rfc2833
srvlookup=yes

john
mailbox= john@default
callerid="john" <1000>
mailbox=200@default

robert
mailbox=robert@default
callerid="robert" <2000>
mailbox=210@default

line1
username=line1
secret=line1
callerid="line1" <5000>
canreinvite=no
context=default

[pstn]
type=peer
host=dynamic
context=pstn
username=pstn
secret=pstn
nat=yes
canreinvite=no
dtmfmode=rfc2833
qualify=yes
insecure=port,invite
disallow=all
allow=ulaw,g726,gsm
srvlookup=yes

2012/11/19 Randall Degges [email protected]

Hi there. Looking at the code right now, but I'm a bit confused--would you
mind posting all your Python code and Asterisk code as well?

The reason I ask is because your code is currently telling Asterisk to
execute 'alarmes,s,1', but that priority doesn't exist in your Asterisk
dialplan code (Your [alarmes] context starts with a priority of 2.)

Also: it looks like the channel you're trying to call is invalid, eg:
'sip/pstn/3478' doesn't look like any valid channel I've ever seen.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10531103.

from pycall.

ramstein74 avatar ramstein74 commented on August 29, 2024

Thank you for your support!
:)

2012/11/19 António Ramos [email protected]

Sorry,
trial and error just deleted one line
I´m no expert. Just trying to make something usefull in my company.
I´m testing linksys spa3102 connected inside my company in a regular phone
line.

Here it is extensions.con

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

[pstn]
exten => 3436,1,Answer()
same=> n,NoOp(${CALLERID})
same => n,Read(TMP,vm-enter-num-to-call,3,,1,3)
same => n,AGI(script3.py,${TMP},${CALLERID))
same => n,Hangup()

[default]
exten=>_02.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_09.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,1,Verbose(2,a ligar do interno)
exten=>_3XXX,n,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,n,Hangup()
exten=>_5xxx,1,Dial(SIP/line1,10)
exten=>_5xxxx,2,Hangup()

my python code inside web2py framework

@service.xmlrpc
def phone(a,b,c):
print "calling ",a
vars = {'local': int(c)}
call = Call('sip/robert',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()
return 0

my sip file:

users
nat=yes
type=friend
host=dynamic
qualify=yes
context=default
disallow=all
allow=ulaw,g726,gsm
dtmfmode=rfc2833
srvlookup=yes

john
mailbox= john@default
callerid="john" <1000>
mailbox=200@default

robert
mailbox=robert@default
callerid="robert" <2000>
mailbox=210@default

line1
username=line1
secret=line1
callerid="line1" <5000>
canreinvite=no
context=default

[pstn]
type=peer
host=dynamic
context=pstn
username=pstn
secret=pstn
nat=yes
canreinvite=no
dtmfmode=rfc2833
qualify=yes
insecure=port,invite
disallow=all
allow=ulaw,g726,gsm
srvlookup=yes

2012/11/19 Randall Degges [email protected]

Hi there. Looking at the code right now, but I'm a bit confused--would
you mind posting all your Python code and Asterisk code as well?

The reason I ask is because your code is currently telling Asterisk to
execute 'alarmes,s,1', but that priority doesn't exist in your Asterisk
dialplan code (Your [alarmes] context starts with a priority of 2.)

Also: it looks like the channel you're trying to call is invalid, eg:
'sip/pstn/3478' doesn't look like any valid channel I've ever seen.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10531103.

from pycall.

rdegges avatar rdegges commented on August 29, 2024

Hi Robert,

Ok, would you mind making the following modifications and giving it another try? I've edited some of your code a bit, to fix some problems I think I see. This may not work, but it should help us get closer to a solution.

; /etc/asterisk/extensions.conf

[alarmes]
exten => s,1,SayNumber(${local})
exten => s,n,SayAlpha(good)
exten => s,n,Hangup()

[pstn]
exten => 3436,1,Answer()
exten => 3436,n,NoOp(${CALLERID(num)})
exten => 3436,n,Read(tmp,vm-enter-num-to-call,3,,1,3)
exten => 3436,n,AGI(script3.py,${tmp},${CALLERID(num)})
exten => 3436,n,Hangup()

[default]
exten=>_02.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_09.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,1,Verbose(2,a ligar do interno)
exten=>_3XXX,n,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,n,Hangup()
exten=>_5XXX,1,Dial(SIP/line1,10)
exten=>_5XXX,n,Hangup()

What I'd like you to do next is (on the command line), open up Asterisk, and enable verbose logging. Then make a call using your call file script, and copy the output from the Asterisk console so that I can see what the output says--this will make it easier to track down the exact issue. You can do this by running:

$ asterisk -rx 'core set verbose 99'
$ asterisk -r # will put you into Asterisk console

From what I can tell, this is an Asterisk configuration problem.

from pycall.

ramstein74 avatar ramstein74 commented on August 29, 2024

Hello,
after your suggested modifications and console core commands
i get this

The call to sip client waits for client answer ( the console log stops at
bold text)

-- Attempting call on sip/robert for s@alarmes:1 (Retry 1)
== Using SIP RTP CoS mark 5
> Channel SIP/robert-00000080 was answered.
-- Executing [s@alarmes:1] SayNumber("SIP/robert-00000080", "15,c") in
new stack
-- <SIP/robert-00000080> Playing 'digits/15.gsm' (language 'en')
-- Executing [s@alarmes:2] SayAlpha("SIP/robert-00000080", "GOOD") in
new stack
-- <SIP/robert-00000080> Playing 'letters/g.gsm' (language 'en')
-- <SIP/robert-00000080> Playing 'letters/o.gsm' (language 'en')
-- <SIP/robert-00000080> Playing 'letters/o.gsm' (language 'en')
-- <SIP/robert-00000080> Playing 'letters/d.gsm' (language 'en')
-- Executing [s@alarmes:3] Hangup("SIP/robert-00000080", "") in new
stack
== Spawn extension (alarmes, s, 3) exited non-zero on
'SIP/robert-00000080'
[Nov 20 09:39:25] NOTICE[23531]: pbx_spool.c:373 attempt_thread: Call
completed to sip/robert

Next is the call to pstn number, the console log never stops and
says Channel SIP/pstn-00000082 was answered, when the client phone did not
answer. When the client number (3478) answers i can still hear the end of
the playing letters.

-- Attempting call on sip/pstn/3478 for s@alarmes:1 (Retry 1)
== Using SIP RTP CoS mark 5
> Channel SIP/pstn-00000082 was answered.
-- Executing [s@alarmes:1] SayNumber("SIP/pstn-00000082", "15,c") in
new stack
-- <SIP/pstn-00000082> Playing 'digits/15.gsm' (language 'en')
-- Executing [s@alarmes:2] SayAlpha("SIP/pstn-00000082", "GOOD") in new
stack
-- <SIP/pstn-00000082> Playing 'letters/g.gsm' (language 'en')
-- <SIP/pstn-00000082> Playing 'letters/o.gsm' (language 'en')
-- <SIP/pstn-00000082> Playing 'letters/o.gsm' (language 'en')
-- <SIP/pstn-00000082> Playing 'letters/d.gsm' (language 'en')
-- Executing [s@alarmes:3] Hangup("SIP/pstn-00000082", "") in new stack
== Spawn extension (alarmes, s, 3) exited non-zero on 'SIP/pstn-00000082'
[Nov 20 09:42:55] NOTICE[23541]: pbx_spool.c:373 attempt_thread: Call
completed to sip/pstn/3478

Best regards and thank you for your support

António

2012/11/19 Randall Degges [email protected]

Hi Robert,

Ok, would you mind making the following modifications and giving it
another try? I've edited some of your code a bit, to fix some problems I
think I see. This may not work, but it should help us get closer to a
solution.

; /etc/asterisk/extensions.conf

[alarmes]
exten => s,1,SayNumber(${local})
exten => s,n,SayAlpha(good)
exten => s,n,Hangup()

[pstn]
exten => 3436,1,Answer()
exten => 3436,n,NoOp(${CALLERID(num)})
exten => 3436,n,Read(tmp,vm-enter-num-to-call,3,,1,3)
exten => 3436,n,AGI(script3.py,${tmp},${CALLERID(num)})
exten => 3436,n,Hangup()

[default]
exten=>_02.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_09.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,1,Verbose(2,a ligar do interno)
exten=>_3XXX,n,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,n,Hangup()
exten=>_5XXX,1,Dial(SIP/line1,10)
exten=>_5XXX,n,Hangup()

What I'd like you to do next is (on the command line), open up Asterisk,
and enable verbose logging. Then make a call using your call file script,
and copy the output from the Asterisk console so that I can see what the
output says--this will make it easier to track down the exact issue. You
can do this by running:

$ asterisk -rx 'core set verbose 99'$ asterisk -r # will put you into Asterisk console

From what I can tell, this is an Asterisk configuration problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10532430.

from pycall.

ramstein74 avatar ramstein74 commented on August 29, 2024

another detail
I´m in Portugal!!!!
maybe some detail in linksys spa3102? or codecs or ring tones can cause
this problem?

Best regards
António

2012/11/20 António Ramos [email protected]

Hello,
after your suggested modifications and console core commands
i get this

The call to sip client waits for client answer ( the console log stops at
bold text)

-- Attempting call on sip/robert for s@alarmes:1 (Retry 1)
== Using SIP RTP CoS mark 5
> Channel SIP/robert-00000080 was answered.
-- Executing [s@alarmes:1] SayNumber("SIP/robert-00000080", "15,c")
in new stack
-- <SIP/robert-00000080> Playing 'digits/15.gsm' (language 'en')
-- Executing [s@alarmes:2] SayAlpha("SIP/robert-00000080", "GOOD") in
new stack
-- <SIP/robert-00000080> Playing 'letters/g.gsm' (language 'en')
-- <SIP/robert-00000080> Playing 'letters/o.gsm' (language 'en')
-- <SIP/robert-00000080> Playing 'letters/o.gsm' (language 'en')
-- <SIP/robert-00000080> Playing 'letters/d.gsm' (language 'en')
-- Executing [s@alarmes:3] Hangup("SIP/robert-00000080", "") in new
stack
== Spawn extension (alarmes, s, 3) exited non-zero on
'SIP/robert-00000080'
[Nov 20 09:39:25] NOTICE[23531]: pbx_spool.c:373 attempt_thread: Call
completed to sip/robert

Next is the call to pstn number, the console log never stops and
says Channel SIP/pstn-00000082 was answered, when the client phone did not
answer. When the client number (3478) answers i can still hear the end of
the playing letters.

-- Attempting call on sip/pstn/3478 for s@alarmes:1 (Retry 1)
== Using SIP RTP CoS mark 5
> Channel SIP/pstn-00000082 was answered.
-- Executing [s@alarmes:1] SayNumber("SIP/pstn-00000082", "15,c") in
new stack
-- <SIP/pstn-00000082> Playing 'digits/15.gsm' (language 'en')
-- Executing [s@alarmes:2] SayAlpha("SIP/pstn-00000082", "GOOD") in
new stack
-- <SIP/pstn-00000082> Playing 'letters/g.gsm' (language 'en')
-- <SIP/pstn-00000082> Playing 'letters/o.gsm' (language 'en')
-- <SIP/pstn-00000082> Playing 'letters/o.gsm' (language 'en')
-- <SIP/pstn-00000082> Playing 'letters/d.gsm' (language 'en')
-- Executing [s@alarmes:3] Hangup("SIP/pstn-00000082", "") in new
stack
== Spawn extension (alarmes, s, 3) exited non-zero on 'SIP/pstn-00000082'
[Nov 20 09:42:55] NOTICE[23541]: pbx_spool.c:373 attempt_thread: Call
completed to sip/pstn/3478

Best regards and thank you for your support

António

2012/11/19 Randall Degges [email protected]

Hi Robert,

Ok, would you mind making the following modifications and giving it
another try? I've edited some of your code a bit, to fix some problems I
think I see. This may not work, but it should help us get closer to a
solution.

; /etc/asterisk/extensions.conf

[alarmes]
exten => s,1,SayNumber(${local})
exten => s,n,SayAlpha(good)
exten => s,n,Hangup()

[pstn]
exten => 3436,1,Answer()
exten => 3436,n,NoOp(${CALLERID(num)})
exten => 3436,n,Read(tmp,vm-enter-num-to-call,3,,1,3)
exten => 3436,n,AGI(script3.py,${tmp},${CALLERID(num)})
exten => 3436,n,Hangup()

[default]
exten=>_02.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_09.,1,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,1,Verbose(2,a ligar do interno)
exten=>_3XXX,n,Dial(SIP/pstn/${EXTEN},10)
exten=>_3XXX,n,Hangup()
exten=>_5XXX,1,Dial(SIP/line1,10)
exten=>_5XXX,n,Hangup()

What I'd like you to do next is (on the command line), open up Asterisk,
and enable verbose logging. Then make a call using your call file script,
and copy the output from the Asterisk console so that I can see what the
output says--this will make it easier to track down the exact issue. You
can do this by running:

$ asterisk -rx 'core set verbose 99'$ asterisk -r # will put you into Asterisk console

From what I can tell, this is an Asterisk configuration problem.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-10532430.

from pycall.

rdegges avatar rdegges commented on August 29, 2024

Hi again,

So after looking at your console log, I'm still a bit confused here. Your dialplan is executing as desired, so there must be an Asterisk configuration issue here. The issue must lie in either your SIP configuration, or your extension configuration.

One of those two is causing you the issues.

I'm not really too great at debugging that part of Asterisk (I'm a dialplan guy myself), so I'm afraid I won't be of much use. What I'd suggest is asking for help on the Asterisk IRC channel (irc.freenode.net/#asterisk), as they have a lot of users online who can help you debug this in more detail.

Your pycall stuff seems to be working fine.

Sorry about that!

from pycall.

Related Issues (17)

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.