[Freeswitch-users] Conference javascript and hanuphooks giving me headaches

Anthony Minessale anthony.minessale at gmail.com
Thu Jan 22 14:25:54 PST 2009


Try this (update to svn trunk first)

<action application="bridge"
data="{api_hangup_hook=jsapi::foo.js}sofia/default/user at dest.com"/>

then place your call as usual

then in foo.js


// dumps the event to text/plain
env = request.dumpENV("text");

// dumps the event to text/xml
xmlenv = request.dumpENV("xml");

// makes an XML obj from the xml text
xinfo = new XML("<root>" + xmlenv + "</root>");

// dump the plain text event data
consoleLog("info", env + "\n");

// dump the xml event data
consoleLog("info", xmlenv + "\n");

// Get a header from the event object
consoleLog("warning", "media ip was [" + request.getHeader("local_media_ip")
+ "]\n");

// Get the same header from the xml object
consoleLog("warning", "media ip was [" + xinfo.event.headers.local_media_ip
+ "]\n");




On Thu, Jan 22, 2009 at 2:24 PM, Sias Mey <sias at cpdata.co.za> wrote:

> Hi,
>
> Im trying to originate calls from a conference and use javascript to
> watch out for hangup events so I can use the data in the session to
> flesh out some database info. However it seems that Im having some
> strangeness. It might just be my code. So I include that.
>
> I run FreeSwitch Version 1.0.trunk (11226)
>
> Dialplan:
> <extension name="js_logtodb">
>  <condition field="destination_number" expression="^confout-(10\d{2})$">
>    <action application="javascript" data="confout.js"/>
>  </condition>
> </extension>
>
> confout.js:
>  is attached
>
> I use API calls to pull one user into a conference. Then I use more api
> calls to do a conference dial to loopback/confout-1001
>
> This should run the js and then bridge extension 1001 into the same
> conference.
> (I have hardcoded the additional extension for testing). I dont know if
> there is another way to get a conference dial to run a javascript file for
> information logging, but I am open to enlightenment.
>
> Oh im using conference dial because that provides clear audible progress to
> the other conference memebers as to what is actually happening with the new
> call.
>
> Any help would be greatly apreciated, Thanks in advance.
> Sias
>
> _______________________________________________
> 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/20090122/f9466f95/attachment-0002.html 


More information about the FreeSWITCH-users mailing list