Closed mattwilliamson closed 13 years ago
Hi Matt,
I think you inverted the FS logs: if bothLegs is true : plivo use record_session() if bothLegs is false: plivo use record()
I just checked something simple using luarun and a basic script :
-- /tmp/script.lua example script
freeswitch.consoleLog("notice", "plivo test\n");
Diaplan XML :
<extension name="plivo">
<condition field="destination_number" expression="^1234$">
<action application="set" data="record_post_process_exec_api=luarun:/tmp/script.lua"/>
<action application="socket" data="127.0.0.1:8084 async full"/>
</condition>
</extension>
If I use bothLegs='true', it works, I can see the log "plivo test" in FS.
If I use bothLegs='false', doesn't work, script is not fired.
Checking the FS code source, seems "record_post_process_exec_api" and "record_post_process_exec_api" are used only in record_session (when bothLEgs='true')
So cannot be used with bothLegs='false' .
I appreciate you looking into this for me. Does this mean I'll have to branch the freeswitch source and add the hook for record_session?
On Aug 5, 2011, at 4:40, tamielreply@reply.github.com wrote:
Hi Matt,
I think you inverted the FS logs: if bothLegs is true : plivo use record_session() if bothLegs is false: plivo use record()
I just checked something simple using luarun and a basic script :
-- /tmp/script.lua example script freeswitch.consoleLog("notice", "plivo test\n");
Diaplan XML :
<extension name="plivo"> <condition field="destination_number" expression="^1234$"> <action application="set" data="record_post_process_exec_api=luarun:/tmp/script.lua"/> <action application="socket" data="127.0.0.1:8084 async full"/> </condition> </extension>
If I use bothLegs='true', it works, I can see the log "plivo test" in FS.
If I use bothLegs='false', doesn't work, script is not fired.
Checking the FS code source, seems "record_post_process_exec_api" and "record_post_process_exec_api" are used only in record_session (when bothLEgs='true')
So cannot be used with bothLegs='false' .
Reply to this email directly or view it on GitHub: https://github.com/plivo/plivo/issues/27#issuecomment-1733790
Get the last git freeswitch source and reinstall FS.
And retry with it, we will see if it helps you =)
We recompiled freeswitch and it didn't seem to fix the issue. Looking over the gti.freeswitch.org logs, I don't see a commit that might fix it either.
ok I will test with a python script and see what happens .
This apparently is still not working.
Update to the last plivo revision.
I checked and worked for me.
Here what I have done to test :
I record in background using bothLegs="true" and set maxLength="10", so after 10 seconds, background recording is stopped and the python script is fired.
RESTXML :
<Response>
<Record bothLegs="true" maxLength="10" playBeep="true"/>
<Speak loop="20">Recording is in progress in background</Speak>
</Response>
FS DIALPLAN XML
<extension name="plivo">
<condition field="destination_number" expression="^1234$">
<action application="set" data="record_post_process_exec_api=pyrun:fstest"/>
<action application="socket" data="127.0.0.1:8084 async full"/>
</condition>
</extension>
Python script fstest.py
import os
from freeswitch import *
def runtime(args):
consoleLog("info", "test pyrun record_session postprocessing\n")
consoleLog("info", "test pyrun args => %s\n" % str(args))
I have installed freeswitch.py from freeswitch source and fstest.py into my python path.
FS logs for the python script :
2011-08-16 17:04:01.202207 [NOTICE] mod_python.c:114 Invoking py module: fstest
2011-08-16 17:04:01.202207 [DEBUG] mod_python.c:183 Call python script
2011-08-16 17:04:01.202207 [INFO] switch_cpp.cpp:1197 test pyrun record_session postprocessing
2011-08-16 17:04:01.202207 [INFO] switch_cpp.cpp:1197 test pyrun args =>
2011-08-16 17:04:01.202207 [DEBUG] mod_python.c:186 Finished calling python script
So the fix is in plivo, not freeswitch?
Seems in plivo, so now I think it will work for you.
It looks like this is indeed a freeswitch bug. I've submitted http://jira.freeswitch.org/browse/FS-3505 to them. Closing this issue.
You're a lucky guy, the fix has been commited to freeswitch =)
I saw that. And in under 10 minutes too!
On Aug 17, 2011, at 3:40, tamielreply@reply.github.com wrote:
You're a lucky guy, the patch was commited to freeswitch =)
Reply to this email directly or view it on GitHub: https://github.com/plivo/plivo/issues/27#issuecomment-1824176
It's also working
On Aug 17, 2011, at 3:40, tamielreply@reply.github.com wrote:
You're a lucky guy, the patch was commited to freeswitch =)
Reply to this email directly or view it on GitHub: https://github.com/plivo/plivo/issues/27#issuecomment-1824176
When using the following XML I can use the
record_post_process_exec_api
callback to trigger a python script and upload the recording file to Amazon. If I change tobothLegs=False
therecord_post_process_exec_api
is not triggered.Here is my FS config:
Here's what I see in the FS logs for bothLegs:
and when it's false: