Re: [Asterisk-java-users] Question about usage of "public AsteriskChannel originate(OriginateAction
Brought to you by:
srt
From: Yves A. <yv...@gm...> - 2013-01-24 16:24:12
|
Hi, line 90 of your HelloLive class seems to reference a Null-Object... hard to say, what exactly is going wrong without seeing the whole code... its just, what the exception says... yves Am 24.01.2013 15:37, schrieb Shitian Long: > Hello > > I have a question about usage of > "public AsteriskChannel originate(OriginateAction originateAction) > throws ManagerCommunicationException, NoSuchChannelException" > > > according to http://www.asterisk-java.org/development/apidocs/index.html > > publicAsteriskChannel <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/AsteriskChannel.html> originate(OriginateAction <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/manager/action/OriginateAction.html> originateAction) > throwsManagerCommunicationException <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/ManagerCommunicationException.html>, > NoSuchChannelException <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/NoSuchChannelException.html> > *Description copied from interface: |AsteriskServer > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/AsteriskServer.html#originate%28org.asteriskjava.manager.action.OriginateAction%29>|* > Generates an outgoing channel. > > *Specified by:* > |originate > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/AsteriskServer.html#originate%28org.asteriskjava.manager.action.OriginateAction%29>| in > interface |AsteriskServer > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/AsteriskServer.html>| > Parameters: > |originateAction| - the action that contains parameters for the > originate > Returns: > the generated channel > Throws: > |ManagerCommunicationException > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/ManagerCommunicationException.html>| - > if the originate action cannot be sent to Asterisk > |NoSuchChannelException > <http://www.asterisk-java.org/development/apidocs/org/asteriskjava/live/NoSuchChannelException.html>| - > if the channel is not available on the Asterisk server, for > example because you used "SIP/1310" and 1310 is not a valid SIP > user, the SIP channel module hasn't been loaded or the SIP or IAX > peer is not registered currently. > > > > > I have following implementation like > > OriginateAction originateAction = new OriginateAction(); > originateAction.setChannel("SIP/2000"); > originateAction.setContext("test-context"); > originateAction.setExten("2222"); > originateAction.setCallerId("1111"); > AsteriskChannel aChannel = asteriskServer.originate(originateAction); > > Then I got > > Exception in thread "main" java.lang.NullPointerException > at > org.asteriskjava.live.internal.AsteriskServerImpl.originate(AsteriskServerImpl.java:295) > at > org.asteriskjava.live.DefaultAsteriskServer.originate(DefaultAsteriskServer.java:137) > at HelloLive.run(HelloLive.java:36) > at HelloLive.main(HelloLive.java:90) > > This exception. > > I am wondering if someone could help me about the correct way of using > public AsteriskChannel originate(OriginateAction originateAction) > throws ManagerCommunicationException, NoSuchChannelException > this function > > Thanks. > > > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. ON SALE this month only -- learn more at: > http://p.sf.net/sfu/learnnow-d2d > > > _______________________________________________ > Asterisk-java-users mailing list > Ast...@li... > https://lists.sourceforge.net/lists/listinfo/asterisk-java-users |