mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-24 03:47:39 +00:00
add debugging information
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9008 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
2380cce175
commit
f01fde034c
@ -1,3 +1,24 @@
|
|||||||
|
|
||||||
Socket library to interface w/ freeswitch mod_event_socket from Twisted python applications.
|
DESCRIPTION
|
||||||
|
===========
|
||||||
|
|
||||||
|
Socket library to interface w/ freeswitch mod_event_socket from Twisted python applications. Used by WikiPBX for all non-http communication w/ Freeswitch.
|
||||||
|
|
||||||
|
Install
|
||||||
|
=======
|
||||||
|
|
||||||
|
See INSTALL
|
||||||
|
|
||||||
|
Rebulding State Machines
|
||||||
|
========================
|
||||||
|
for each .sm file:
|
||||||
|
|
||||||
|
java -jar /usr/src/smc/bin/Smc.jar -python -g THE.sm
|
||||||
|
|
||||||
|
and loginrequest.sm -> loginrequest_sm.py with the state machine.
|
||||||
|
|
||||||
|
TODO: create a Makefile to do this stuff
|
||||||
|
TODO: use Miro Samek's HSM framework instead of SMC
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,35 +61,35 @@ Default
|
|||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting blank line");
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentFinished
|
ContentFinished
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting content to be finished");
|
||||||
}
|
}
|
||||||
|
|
||||||
ContentLength
|
ContentLength
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting content-length header");
|
||||||
}
|
}
|
||||||
|
|
||||||
ApiResponse
|
ApiResponse
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting api response");
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessLine(line)
|
ProcessLine(line)
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting needing to process a line");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
# DO NOT EDIT.
|
||||||
# DO NOT MODIFY THIS CODE - AUTOMATICALLY GENERATED BY SMC
|
# generated by smc (http://smc.sourceforge.net/)
|
||||||
|
# from file : apirequest.sm
|
||||||
|
|
||||||
import statemap
|
import statemap
|
||||||
|
|
||||||
|
|
||||||
class ApiRequestState(statemap.State):
|
class ApiRequestState(statemap.State):
|
||||||
|
|
||||||
def Entry(self, fsm):
|
def Entry(self, fsm):
|
||||||
@ -31,7 +33,7 @@ class ApiRequestState(statemap.State):
|
|||||||
fsm.getDebugStream().write('TRANSITION : Default\n')
|
fsm.getDebugStream().write('TRANSITION : Default\n')
|
||||||
msg = "\n\tState: %s\n\tTransition: %s" % (
|
msg = "\n\tState: %s\n\tTransition: %s" % (
|
||||||
fsm.getState().getName(), fsm.getTransition())
|
fsm.getState().getName(), fsm.getTransition())
|
||||||
raise TransitionUndefinedException, msg
|
raise statemap.TransitionUndefinedException, msg
|
||||||
|
|
||||||
class MainMap_Default(ApiRequestState):
|
class MainMap_Default(ApiRequestState):
|
||||||
|
|
||||||
@ -44,7 +46,7 @@ class MainMap_Default(ApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting blank line")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -57,7 +59,7 @@ class MainMap_Default(ApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting content to be finished")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -70,7 +72,7 @@ class MainMap_Default(ApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting content-length header")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -83,7 +85,7 @@ class MainMap_Default(ApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting api response")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -96,7 +98,7 @@ class MainMap_Default(ApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting needing to process a line")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
|
@ -43,28 +43,28 @@ Default
|
|||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting blank line");
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandReply
|
CommandReply
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting command reply");
|
||||||
}
|
}
|
||||||
|
|
||||||
ReplyText
|
ReplyText
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting reply text");
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessLine(line)
|
ProcessLine(line)
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting line needing to be processed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
# DO NOT EDIT.
|
||||||
# DO NOT MODIFY THIS CODE - AUTOMATICALLY GENERATED BY SMC
|
# generated by smc (http://smc.sourceforge.net/)
|
||||||
|
# from file : bgapirequest.sm
|
||||||
|
|
||||||
import statemap
|
import statemap
|
||||||
|
|
||||||
|
|
||||||
class BgApiRequestState(statemap.State):
|
class BgApiRequestState(statemap.State):
|
||||||
|
|
||||||
def Entry(self, fsm):
|
def Entry(self, fsm):
|
||||||
@ -28,7 +30,7 @@ class BgApiRequestState(statemap.State):
|
|||||||
fsm.getDebugStream().write('TRANSITION : Default\n')
|
fsm.getDebugStream().write('TRANSITION : Default\n')
|
||||||
msg = "\n\tState: %s\n\tTransition: %s" % (
|
msg = "\n\tState: %s\n\tTransition: %s" % (
|
||||||
fsm.getState().getName(), fsm.getTransition())
|
fsm.getState().getName(), fsm.getTransition())
|
||||||
raise TransitionUndefinedException, msg
|
raise statemap.TransitionUndefinedException, msg
|
||||||
|
|
||||||
class MainMap_Default(BgApiRequestState):
|
class MainMap_Default(BgApiRequestState):
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ class MainMap_Default(BgApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting blank line")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -54,7 +56,7 @@ class MainMap_Default(BgApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting command reply")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -67,7 +69,7 @@ class MainMap_Default(BgApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting reply text")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -80,7 +82,7 @@ class MainMap_Default(BgApiRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting line needing to be processed")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
|
@ -57,35 +57,35 @@ Default
|
|||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - Was not expecting a blank line");
|
||||||
}
|
}
|
||||||
|
|
||||||
AuthRequest
|
AuthRequest
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - Was not expecting auth request");
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandReply
|
CommandReply
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting a command reply");
|
||||||
}
|
}
|
||||||
|
|
||||||
ReplyText
|
ReplyText
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting reply text");
|
||||||
}
|
}
|
||||||
|
|
||||||
ProcessLine(line)
|
ProcessLine(line)
|
||||||
nil
|
nil
|
||||||
{
|
{
|
||||||
setRequestFinished();
|
setRequestFinished();
|
||||||
errbackDeferred("Protocol failure");
|
errbackDeferred("Protocol failure - was not expecting need to receive a line that needs to be processed");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
|
# DO NOT EDIT.
|
||||||
# DO NOT MODIFY THIS CODE - AUTOMATICALLY GENERATED BY SMC
|
# generated by smc (http://smc.sourceforge.net/)
|
||||||
|
# from file : loginrequest.sm
|
||||||
|
|
||||||
import statemap
|
import statemap
|
||||||
|
|
||||||
@ -32,7 +33,7 @@ class LoginRequestState(statemap.State):
|
|||||||
fsm.getDebugStream().write('TRANSITION : Default\n')
|
fsm.getDebugStream().write('TRANSITION : Default\n')
|
||||||
msg = "\n\tState: %s\n\tTransition: %s" % (
|
msg = "\n\tState: %s\n\tTransition: %s" % (
|
||||||
fsm.getState().getName(), fsm.getTransition())
|
fsm.getState().getName(), fsm.getTransition())
|
||||||
raise TransitionUndefinedException, msg
|
raise statemap.TransitionUndefinedException, msg
|
||||||
|
|
||||||
class MainMap_Default(LoginRequestState):
|
class MainMap_Default(LoginRequestState):
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ class MainMap_Default(LoginRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - Was not expecting a blank line")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -58,7 +59,7 @@ class MainMap_Default(LoginRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - Was not expecting auth request")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ class MainMap_Default(LoginRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting a command reply")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -84,7 +85,7 @@ class MainMap_Default(LoginRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting reply text")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
@ -97,7 +98,7 @@ class MainMap_Default(LoginRequestState):
|
|||||||
fsm.clearState()
|
fsm.clearState()
|
||||||
try:
|
try:
|
||||||
ctxt.setRequestFinished()
|
ctxt.setRequestFinished()
|
||||||
ctxt.errbackDeferred("Protocol failure")
|
ctxt.errbackDeferred("Protocol failure - was not expecting need to receive a line that needs to be processed")
|
||||||
finally:
|
finally:
|
||||||
fsm.setState(endState)
|
fsm.setState(endState)
|
||||||
|
|
||||||
|
@ -70,7 +70,7 @@ class FreepyRequest(object):
|
|||||||
self.deferred.callback(cbval)
|
self.deferred.callback(cbval)
|
||||||
|
|
||||||
def errbackDeferred(self, result):
|
def errbackDeferred(self, result):
|
||||||
self.deferred.errback(result)
|
self.deferred.errback(Exception(str(result)))
|
||||||
|
|
||||||
def process(self, line):
|
def process(self, line):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user