1
0
mirror of https://github.com/signalwire/freeswitch.git synced 2025-08-13 01:26:58 +00:00
Files
build
clients
cmake_modules
conf
debian
docker
docs
dtd
fonts
fscomm
htdocs
html5
images
libs
scripts
applescript
basic
c
ci
javascript
lua
perl
php
py_modules
python
freepy
INSTALL
README
__init__.py
apirequest.sm
apirequest_sm.py
bgapirequest.sm
bgapirequest_sm.py
fseventlistener.py
fshelper.py
globals.py
loginrequest.sm
loginrequest_sm.py
models.py
request.py
mytest.py
recipewizard.py
rss
sql
trace
FreeSWITCH-debian-raspbian-installer.sh
backtrace-from-core
bisect
check-gitignore.sh
dailys.sh
debian_min_build.sh
debug_sofia.sh
freeswitch-gcore
freeswitch-reporter
freeswitch.pkg_deps.sh
freeswitch.sh
fsxs.in
gentls_cert.in
m4a-to-wav.sh
mk_fs_fhs.sh
setup-git.sh
tagscript.sh
yes_no.gram
src
support-d
tests
w32
web
yum
.clang-format
.drone.yml
.gitattributes
.gitignore
.mailmap
Freeswitch.2017.sln
Freeswitch.2017.sln.bat
INSTALL
Makefile.am
README.md
acinclude.m4
bootstrap.sh
cc.sh
cluecon.tmpl
cluecon2.tmpl
cluecon2_small.tmpl
cluecon_small.tmpl
configure.ac
devel-bootstrap.sh
erlang.spec
freeswitch-config-rayo.spec
freeswitch-sounds-en-ca-june.spec
freeswitch-sounds-en-us-allison.spec
freeswitch-sounds-en-us-callie.spec
freeswitch-sounds-fr-ca-june.spec
freeswitch-sounds-music.spec
freeswitch-sounds-pt-BR-karina.spec
freeswitch-sounds-ru-RU-elena.spec
freeswitch-sounds-sv-se-jakob.spec
freeswitch.spec
msbuild.cmd
swig_common.i
freeswitch/scripts/python/freepy/apirequest.sm

96 lines
1.5 KiB
Plaintext
Raw Normal View History

%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");
}
}
%%