[Freeswitch-users] Javascript: record ringing of session

Anthony Minessale anthony.minessale at gmail.com
Tue Nov 25 06:52:31 PST 2008


ring_ready does not have audio so there is nothing to record.
ring_ready is a 180 ringing which is just a packet telling your phone to
play a ringing sound
on your end.

Remember what i said?  originate returns the exact instant there is any
audio.



On Tue, Nov 25, 2008 at 8:29 AM, Birgit Arkesteijn <birgit at westhawk.co.uk>wrote:

> Hi Anthony,
>
> Thanks for your feedback.
> I still cannot get it to work, maybe the snippet and the output will
> give you an idea?
>
>
> *** I've got the following javascript:
>
> var endpoint_url = 'sofia/gateway/westhawk/0663';
> var recordfile = "/usr/local/freeswitch/recordings/dispatcher.wav";
>
> setGlobalVariable("RECORD_ANSWER_REQ", false);
> var mSession = new Session("{ignore_early_media=false}" + endpoint_url);
> console_log("info", "mSession created, start recording\n");
>
> mSession.execute("record_session", recordfile);
>
>
> *** When I run it:
> freeswitch at apso> jsrun record_rings.js
> API CALL [jsrun(record_rings.js)] output:
> OK
>
> freeswitch at apso> 2008-11-25 14:22:10 [NOTICE] switch_channel.c:551
> switch_channel_set_name() New Channel sofia/external/0663
> [7225b30a-bafc-11dd-be4c-05a0d8dd6ae1]
> 2008-11-25 14:22:10 [NOTICE] sofia.c:2327 sofia_handle_sip_i_state()
> Ring-Ready sofia/external/0663!
> 2008-11-25 14:22:22 [NOTICE] sofia.c:2723 sofia_handle_sip_i_state()
> Channel [sofia/external/0663] has been answered
> 2008-11-25 14:22:22 [INFO] record_rings.js:1 console_log() mSession
> created, start recording
> 2008-11-25 14:22:22 [NOTICE] mod_spidermonkey.c:2959 session_destroy()
> Hangup sofia/external/0663 [CS_SOFT_EXECUTE] [NORMAL_CLEARING]
> 2008-11-25 14:22:22 [NOTICE] switch_core_session.c:927
> switch_core_session_thread() Session 3 (sofia/external/0663) Ended
> 2008-11-25 14:22:22 [NOTICE] switch_core_session.c:929
> switch_core_session_thread() Close Channel sofia/external/0663 [CS_HANGUP]
>
>
>
> As you can see, 'new Session' does not return on the 'ring ready' and
> therefore doesn't record the rings to/on this new channel (that is
> mSession).
> Having said that, I don't know if 'ring ready' qualifies as 'early media'.
>
> Cheers, Birgit
>
>
>
>
> On 25/11/08 14:13, Anthony Minessale wrote:
> > The originate method does not return until either early media or answer
> > has been received.
> > in other words the very instant it returns is the soonest there is even
> > any media to record.
> >
> > you can execute record_session app on the A leg before you call and
> > that's the best you can do.
> >
> > session.execute("record_session");
> > session.execute("bridge", LIST_OF_DESTINATIONS);
> >
> > if you are not doing much else in your script it may be better to set
> > the dest as a variable then
> > exit your script and execute bridge from the regular dialplan to avoid
> > extra JS overhead during the call.
> >
> >
> >
> >
> >
> > On Tue, Nov 25, 2008 at 8:03 AM, Birgit Arkesteijn
> > <birgit at westhawk.co.uk <mailto:birgit at westhawk.co.uk>> wrote:
> >
> >     Hi Michael,
> >
> >     Sorry to nag you again.
> >     I'm getting close to my deadline and I would like to give our
> customer
> >     some feedback on this issue.
> >
> >     Would you be so kind to explain what the issue is with recording
> rings
> >     when doing 'new Session(originate_url)'?
> >
> >     As far as I've been able to work out, this statement will only
> >     return after
> >     a) the (or some) timeout has expired or
> >     b) the user has picked up
> >
> >     Only in case b) we've got a originated session, that can be used to
> >     record. However, since the user has already answered, the rings are
> not
> >     recorded.
> >
> >     Is that right?
> >
> >     Cheers, Birgit
>
>
> --
> -- Birgit Arkesteijn, birgit at westhawk.co.uk,
> -- Westhawk Ltd, Albion Wharf, 19 Albion Street, Manchester M1 5LN, UK
> -- Company no: 1769350
> -- Registered Office:
> -- 15 London Road, Stockton Heath, Warrington WA4 6SJ. UK.
> -- tel.: +44 (0)161 237 0660
> -- <URL: http://www.westhawk.co.uk>
>
> _______________________________________________
> Freeswitch-users mailing list
> Freeswitch-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>



-- 
Anthony Minessale II

FreeSWITCH http://www.freeswitch.org/
ClueCon http://www.cluecon.com/

AIM: anthm
MSN:anthony_minessale at hotmail.com <MSN%3Aanthony_minessale at hotmail.com>
GTALK/JABBER/PAYPAL:anthony.minessale at gmail.com<PAYPAL%3Aanthony.minessale at gmail.com>
IRC: irc.freenode.net #freeswitch

FreeSWITCH Developer Conference
sip:888 at conference.freeswitch.org <sip%3A888 at conference.freeswitch.org>
iax:guest at conference.freeswitch.org/888
googletalk:conf+888 at conference.freeswitch.org<googletalk%3Aconf%2B888 at conference.freeswitch.org>
pstn:213-799-1400
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20081125/ba040d84/attachment-0002.html 


More information about the FreeSWITCH-users mailing list