Error:- [ERR] switch_cpp.cpp:683 object is not initalized import org.freeswitch.*; import org.freeswitch.swig.*; public class PhoneTest implements FreeswitchScript, DTMFCallback, HangupHook { public PhoneTest() { } public String onDTMF(Object object, int i, String arg) { if (object instanceof String) freeswitch.console_log("notice", "DTMF: " + (String)object + " ARG: " + arg + "\n"); else freeswitch.console_log("notice", "WOW GOT AN EVENT: " + object.toString()); return "true"; } public void onHangup() { freeswitch.console_log("notice", "HANGUP!\n"); } public void run(String sessionUuid, String args) { freeswitch.console_log("notice", "UUID: " + sessionUuid + " ARGS: " + args + "\n"); JavaSession session = null; try { session = new JavaSession(sessionUuid); session.setDTMFCallback(this, "TEST"); // Getting error in this line. session object not initilizing session.setHangupHook(this); session.answer(); session.streamFile(args, 0); session.hangup(""); } finally { if (session != null) session.delete(); } } }
sessionUuid is probably not a valid existing call uuid, kid of a rude post BTW On Mon, Sep 18, 2017 at 1:16 AM, Freeswitch user <freeswitch940@gmail.com> wrote:
Error:- [ERR] switch_cpp.cpp:683 object is not initalized
import org.freeswitch.*; import org.freeswitch.swig.*;
public class PhoneTest implements FreeswitchScript, DTMFCallback, HangupHook { public PhoneTest() { }
public String onDTMF(Object object, int i, String arg) { if (object instanceof String) freeswitch.console_log("notice", "DTMF: " + (String)object + " ARG: " + arg + "\n"); else freeswitch.console_log("notice", "WOW GOT AN EVENT: " + object.toString()); return "true"; }
public void onHangup() { freeswitch.console_log("notice", "HANGUP!\n"); }
public void run(String sessionUuid, String args) { freeswitch.console_log("notice", "UUID: " + sessionUuid + " ARGS: " + args + "\n"); JavaSession session = null; try { session = new JavaSession(sessionUuid); session.setDTMFCallback(this, "TEST"); // Getting error in this line. session object not initilizing session.setHangupHook(this);
session.answer(); session.streamFile(args, 0); session.hangup(""); } finally { if (session != null) session.delete(); } } }
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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 ♬ @anthmfs ♬ @FreeSWITCH ♬ ☞ http://freeswitch.org/ ☞ http://cluecon.com/ ☞ http://twitter.com/FreeSWITCH ☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+ <http://freeswitch.org/g+>* ClueCon Weekly Development Call ☎ sip:888@conference.freeswitch.org ☎ +19193869900 https://www.youtube.com/watch?v=oAxXgyx5jUw https://www.youtube.com/watch?v=9XXgW34t40s https://www.youtube.com/watch?v=NLaDpGQuZDA
Thanks for reply.Can you please suggest how can setup session object in java and get channel variables.? On Tue, 19 Sep 2017 at 9:41 PM, Anthony Minessale < anthony.minessale@gmail.com> wrote:
sessionUuid is probably not a valid existing call uuid, kid of a rude post BTW
On Mon, Sep 18, 2017 at 1:16 AM, Freeswitch user <freeswitch940@gmail.com> wrote:
Error:- [ERR] switch_cpp.cpp:683 object is not initalized
import org.freeswitch.*; import org.freeswitch.swig.*;
public class PhoneTest implements FreeswitchScript, DTMFCallback, HangupHook { public PhoneTest() { }
public String onDTMF(Object object, int i, String arg) { if (object instanceof String) freeswitch.console_log("notice", "DTMF: " + (String)object + " ARG: " + arg + "\n"); else freeswitch.console_log("notice", "WOW GOT AN EVENT: " + object.toString()); return "true"; }
public void onHangup() { freeswitch.console_log("notice", "HANGUP!\n"); }
public void run(String sessionUuid, String args) { freeswitch.console_log("notice", "UUID: " + sessionUuid + " ARGS: " + args + "\n"); JavaSession session = null; try { session = new JavaSession(sessionUuid); session.setDTMFCallback(this, "TEST"); // Getting error in this line. session object not initilizing session.setHangupHook(this);
session.answer(); session.streamFile(args, 0); session.hangup(""); } finally { if (session != null) session.delete(); } } }
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@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 ♬ @anthmfs ♬ @FreeSWITCH ♬
☞ http://freeswitch.org/ ☞ http://cluecon.com/ ☞ http://twitter.com/FreeSWITCH ☞ irc.freenode.net #freeswitch ☞ *http://freeswitch.org/g+ <http://freeswitch.org/g+>*
ClueCon Weekly Development Call ☎ sip:888@conference.freeswitch.org ☎ +19193869900
https://www.youtube.com/watch?v=oAxXgyx5jUw https://www.youtube.com/watch?v=9XXgW34t40s https://www.youtube.com/watch?v=NLaDpGQuZDA _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
Official FreeSWITCH Sites http://www.freeswitch.org http://confluence.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (2)
-
Anthony Minessale
-
Freeswitch user