You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Traceback (most recent call last):
File "show_channels.py", line 35, in
manager.close()
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 483, in close
self.logoff()
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 524, in logoff
response = self.send_action(cdict)
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 276, in send_action
raise ManagerSocketException(0, 'Connection Terminated')
asterisk.manager.ManagerSocketException: (0, 'Connection Terminated')
Exception in thread Thread-2 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
File "/usr/lib64/python2.6/threading.py", line 484, in run
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 425, in event_dispatch
File "/usr/lib64/python2.6/Queue.py", line 179, in get
File "/usr/lib64/python2.6/threading.py", line 274, in notify
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
The script appears to 'Logoff' twice. Asterisk closes the TCP connection before the second logoff action is completed, so pyst2 shows the above error.
Commenting out Line 22 of show_channels.py seems to fix the issue. I believe it's caused by Logoff being actioned twice.
The text was updated successfully, but these errors were encountered:
I took a quick look at this, it appears your issue asterisk.manager.ManagerSocketException: (0, 'Connection Terminated') can be avoided by catching the exception.
The logoff is executed early in the script, but when the manager.close() is executed it saw that an instance was running and attempted to logoff that instance, but the connection got closed before it could complete. Thus the asterisk.manager.ManagerSocketException: (0, 'Connection Terminated') was raised.
You can add a try: except: block in the finally: section to overcome this error, but at this time I do not see any issue with the manager event itself relating to this.
Remember that the asterisk manager interface is not the most robust when making multiple connections.
In testing it is rather easy to get connection errors simply by sending several requests back to back.
I get the following error when attempting to run the example, show_channels.py.
Python 2.6.6
CentOS 6.5
Asterisk 11.14.2
python show_channels.py
Success
SIP/6606-00000018!lhs-pager-conference!s!4!Up!ConfBridge!1234,pagerbridge,pagerparticipant,!6606!!!3!133!(None)!1446585827.34
--END COMMAND--
Traceback (most recent call last):
File "show_channels.py", line 35, in
manager.close()
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 483, in close
self.logoff()
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 524, in logoff
response = self.send_action(cdict)
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 276, in send_action
raise ManagerSocketException(0, 'Connection Terminated')
asterisk.manager.ManagerSocketException: (0, 'Connection Terminated')
Exception in thread Thread-2 (most likely raised during interpreter shutdown):
Traceback (most recent call last):
File "/usr/lib64/python2.6/threading.py", line 532, in __bootstrap_inner
File "/usr/lib64/python2.6/threading.py", line 484, in run
File "/usr/lib/python2.6/site-packages/pyst2-0.4.6-py2.6.egg/asterisk/manager.py", line 425, in event_dispatch
File "/usr/lib64/python2.6/Queue.py", line 179, in get
File "/usr/lib64/python2.6/threading.py", line 274, in notify
<type 'exceptions.TypeError'>: 'NoneType' object is not callable
The script appears to 'Logoff' twice. Asterisk closes the TCP connection before the second logoff action is completed, so pyst2 shows the above error.
Commenting out Line 22 of show_channels.py seems to fix the issue. I believe it's caused by Logoff being actioned twice.
The text was updated successfully, but these errors were encountered: