forked from Mirrors/freeswitch
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
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting blank line");
|
||||
}
|
||||
|
||||
ContentFinished
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting content to be finished");
|
||||
}
|
||||
|
||||
ContentLength
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting content-length header");
|
||||
}
|
||||
|
||||
ApiResponse
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting api response");
|
||||
}
|
||||
|
||||
ProcessLine(line)
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting needing to process a line");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
# DO NOT MODIFY THIS CODE - AUTOMATICALLY GENERATED BY SMC
|
||||
# DO NOT EDIT.
|
||||
# generated by smc (http://smc.sourceforge.net/)
|
||||
# from file : apirequest.sm
|
||||
|
||||
import statemap
|
||||
|
||||
|
||||
class ApiRequestState(statemap.State):
|
||||
|
||||
def Entry(self, fsm):
|
||||
|
@ -31,7 +33,7 @@ class ApiRequestState(statemap.State):
|
|||
fsm.getDebugStream().write('TRANSITION : Default\n')
|
||||
msg = "\n\tState: %s\n\tTransition: %s" % (
|
||||
fsm.getState().getName(), fsm.getTransition())
|
||||
raise TransitionUndefinedException, msg
|
||||
raise statemap.TransitionUndefinedException, msg
|
||||
|
||||
class MainMap_Default(ApiRequestState):
|
||||
|
||||
|
@ -44,7 +46,7 @@ class MainMap_Default(ApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting blank line")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -57,7 +59,7 @@ class MainMap_Default(ApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting content to be finished")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -70,7 +72,7 @@ class MainMap_Default(ApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting content-length header")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -83,7 +85,7 @@ class MainMap_Default(ApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting api response")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -96,7 +98,7 @@ class MainMap_Default(ApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting needing to process a line")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
|
|
@ -43,28 +43,28 @@ Default
|
|||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting blank line");
|
||||
}
|
||||
|
||||
CommandReply
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting command reply");
|
||||
}
|
||||
|
||||
ReplyText
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting reply text");
|
||||
}
|
||||
|
||||
ProcessLine(line)
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting line needing to be processed");
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
|
||||
# DO NOT MODIFY THIS CODE - AUTOMATICALLY GENERATED BY SMC
|
||||
# DO NOT EDIT.
|
||||
# generated by smc (http://smc.sourceforge.net/)
|
||||
# from file : bgapirequest.sm
|
||||
|
||||
import statemap
|
||||
|
||||
|
||||
class BgApiRequestState(statemap.State):
|
||||
|
||||
def Entry(self, fsm):
|
||||
|
@ -28,7 +30,7 @@ class BgApiRequestState(statemap.State):
|
|||
fsm.getDebugStream().write('TRANSITION : Default\n')
|
||||
msg = "\n\tState: %s\n\tTransition: %s" % (
|
||||
fsm.getState().getName(), fsm.getTransition())
|
||||
raise TransitionUndefinedException, msg
|
||||
raise statemap.TransitionUndefinedException, msg
|
||||
|
||||
class MainMap_Default(BgApiRequestState):
|
||||
|
||||
|
@ -41,7 +43,7 @@ class MainMap_Default(BgApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting blank line")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -54,7 +56,7 @@ class MainMap_Default(BgApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting command reply")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -67,7 +69,7 @@ class MainMap_Default(BgApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting reply text")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -80,7 +82,7 @@ class MainMap_Default(BgApiRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting line needing to be processed")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
|
|
@ -57,35 +57,35 @@ Default
|
|||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - Was not expecting a blank line");
|
||||
}
|
||||
|
||||
AuthRequest
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - Was not expecting auth request");
|
||||
}
|
||||
|
||||
CommandReply
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting a command reply");
|
||||
}
|
||||
|
||||
ReplyText
|
||||
nil
|
||||
{
|
||||
setRequestFinished();
|
||||
errbackDeferred("Protocol failure");
|
||||
errbackDeferred("Protocol failure - was not expecting reply text");
|
||||
}
|
||||
|
||||
ProcessLine(line)
|
||||
nil
|
||||
{
|
||||
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 MODIFY THIS CODE - AUTOMATICALLY GENERATED BY SMC
|
||||
# DO NOT EDIT.
|
||||
# generated by smc (http://smc.sourceforge.net/)
|
||||
# from file : loginrequest.sm
|
||||
|
||||
import statemap
|
||||
|
||||
|
@ -32,7 +33,7 @@ class LoginRequestState(statemap.State):
|
|||
fsm.getDebugStream().write('TRANSITION : Default\n')
|
||||
msg = "\n\tState: %s\n\tTransition: %s" % (
|
||||
fsm.getState().getName(), fsm.getTransition())
|
||||
raise TransitionUndefinedException, msg
|
||||
raise statemap.TransitionUndefinedException, msg
|
||||
|
||||
class MainMap_Default(LoginRequestState):
|
||||
|
||||
|
@ -45,7 +46,7 @@ class MainMap_Default(LoginRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - Was not expecting a blank line")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -58,7 +59,7 @@ class MainMap_Default(LoginRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - Was not expecting auth request")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -71,7 +72,7 @@ class MainMap_Default(LoginRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting a command reply")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -84,7 +85,7 @@ class MainMap_Default(LoginRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting reply text")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
@ -97,7 +98,7 @@ class MainMap_Default(LoginRequestState):
|
|||
fsm.clearState()
|
||||
try:
|
||||
ctxt.setRequestFinished()
|
||||
ctxt.errbackDeferred("Protocol failure")
|
||||
ctxt.errbackDeferred("Protocol failure - was not expecting need to receive a line that needs to be processed")
|
||||
finally:
|
||||
fsm.setState(endState)
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ class FreepyRequest(object):
|
|||
self.deferred.callback(cbval)
|
||||
|
||||
def errbackDeferred(self, result):
|
||||
self.deferred.errback(result)
|
||||
self.deferred.errback(Exception(str(result)))
|
||||
|
||||
def process(self, line):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue