Git Product home page Git Product logo

Comments (13)

mike-plivo avatar mike-plivo commented on July 29, 2024

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' .

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

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, [email protected] 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

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

Get the last git freeswitch source and reinstall FS.

And retry with it, we will see if it helps you =)

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

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.

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

ok I will test with a python script and see what happens .

from plivoframework.

efinkelman avatar efinkelman commented on July 29, 2024

This apparently is still not working.

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

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

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

So the fix is in plivo, not freeswitch?

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

Seems in plivo, so now I think it will work for you.

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

It looks like this is indeed a freeswitch bug. I've submitted http://jira.freeswitch.org/browse/FS-3505 to them. Closing this issue.

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

You're a lucky guy, the fix has been commited to freeswitch =)

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

I saw that. And in under 10 minutes too!

On Aug 17, 2011, at 3:40, [email protected] 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

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

It's also working

On Aug 17, 2011, at 3:40, [email protected] 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

from plivoframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.