freeswitch/scripts/socket/freepy/apirequest.sm
Traun Leyden f01fde034c add debugging information
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9008 d0543943-73ff-0310-b7d9-9358b9ac24b2
2008-07-13 03:14:44 +00:00

96 lines
1.5 KiB
Plaintext

%start MainMap::Startup
%class ApiRequest
%map MainMap
%%
Startup
{
ApiResponse
ApiResponseStarted
{
}
}
ApiResponseStarted
{
ContentLength
ContentPreStarted
{
}
}
ContentPreStarted
{
BlankLine
ContentStarted
{
}
}
ContentStarted
{
ProcessLine(line)
[ctxt.add_content(line) == True]
Startup
{
setRequestFinished(); callbackDeferred(ctxt.getResponse());
}
ProcessLine(line)
nil
{
// for some reason, have to add doNothing() here or
// importing smc will fail. looks like smc bug.
doNothing();
}
}
Default
{
BlankLine
nil
{
setRequestFinished();
errbackDeferred("Protocol failure - was not expecting blank line");
}
ContentFinished
nil
{
setRequestFinished();
errbackDeferred("Protocol failure - was not expecting content to be finished");
}
ContentLength
nil
{
setRequestFinished();
errbackDeferred("Protocol failure - was not expecting content-length header");
}
ApiResponse
nil
{
setRequestFinished();
errbackDeferred("Protocol failure - was not expecting api response");
}
ProcessLine(line)
nil
{
setRequestFinished();
errbackDeferred("Protocol failure - was not expecting needing to process a line");
}
}
%%