Please help whats wrong with my program(XTAPI+JTAPI)

hi, everybody ,I want to ask one problem about xtapi
i have download xtapi.jar and mstapi from http://sourceforge.net/projects/xtapi/
Now i am unable to understand this statement
terminal = myprovider.getTerminal("0");
i cannot understand wt parameter shuld be passed here if i pass here names of the ports LTP1, H323,etc it gives me exception InvalidArgumentException
i cannot understand what parameter should be passed here if i pass here 2,3,5,6 it works but it does not detect events observer in jtapi
Please tell me wt should i pass here so that i can observe my modem as terminal
Please help me i will be very thankful to you
MY CODE
import javax.telephony.*;
public class InCommingCall {
public InCommingCall() {
* Create a provider by first obtaining the default implementation of
* JTAPI and then the default provider of that implementation.
Provider myprovider = null;
try {
//JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null);
JtapiPeer peer = JtapiPeerFactory.getJtapiPeer("net.xtapi.XJtapiPeer");
myprovider = peer.getProvider(null);
catch (Exception excp) {
System.out.println("Can't get Provider: " + excp.toString());
excp.printStackTrace();
* Locate the Terminal associated with our near end and place a call
* observer on it. This will instruct the implementation to add a call
* observer once a telephone call comes to the Terminal. We are assuming
* Terminals are named after a primary telephone number on that terminal.
Terminal terminal;
try {
Terminal[] T=myprovider.getTerminals();
for(int i=0;i<T.length;i++){
System.out.println(T.getName());
terminal = myprovider.getTerminal("0");
terminal.addCallObserver(new CallAndDTMFObserver());
System.out.println("Now standing by for phone calls");
catch (Exception excp) {
excp.printStackTrace();
public static void main(String argv[]) {
InCommingCall callReceiver = new InCommingCall();
}

Duplicate of:
http://forum.java.sun.com/thread.jspa?threadID=623891

Similar Messages

  • Does ANYONE know whats wrong with this program?!?!

    Hey(again),
    Does anyone know whats wrong with this program?:
    public class FloatingNumbersTest
    public static void main(String args[])
    float float1 =50.0f;
    float closeFloat=0.001f
    float farfloat=100.0f
    if (float1<=closeFloat)
    System.out.print("Float1 pretty close to zero");
    if (float1>=closeFloat)
    System.out.print("Float1 is near 0");
    if (float1>=farfloat)
    System.out.print("Float1 is not even close to zero!"0
    }There has seemed to be 5 errors!

    public class FloatingNumbersTest
    public static void main(String args[])
    float float1 =50.0f;
    float closeFloat=0.001f
    float farfloat=100.0f
    if (float1<=closeFloat)
    HERE        System.out.print("Float1 pretty close to zero");
    if (float1>=closeFloat)
    System.out.print("Float1 is near 0");
    if (float1>=farfloat)
    System.out.print("Float1 is not even close to zero!"0
    }you're missing the opening { for the first if.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Whats wrong with this program???

    Sorry if this is the wrong place to put it...this is my first time....
    else if (e.getSource() == b1)
              while(e.getSource() == b1)
              quantity1++;
         TxtArea1.setText("Egg");
         TxtArea2.setText("1");
         TxtArea3.setText("$55.00");
         Price =55.00;
         Total = price*quantity1;
         Txtfild.setText(Txtfild.getText() + "\n EGG\t1 55.00");
    There no error during both compilation and run. Yet every time I press the button the program freezes.........

    Tried a little bit of this and a little bit of that plus an append.....got the problem fixed quantity is now updating! Thanks for the tips........
    Once a problem has been fixed a new one arises.......
    Now every time I press the problem is that it creates another line with the old quantity value......
    Ex. I press the button twice.....
    1 EGG 55.00
    2 EGG 110.00
    Please help me........
    Heres the new code:
    if (e.getSource() == b1)
    quantity1++;
         TxtArea.setText("EGG");
         TxtArea.setText("1");
         TxtArea.setText("Php55.00");
         Price =55.00;
         Total = price*quantity1;
         TxtFild.append("\n"+quantity1+" "+"EGG"+" "+Total);
         }

  • What wrong with my program? Help me!

    I try to load my model but all is black. Here my code:
    import java.applet.Applet;
    import java.awt.*;
    import java.io.*;
    import com.sun.j3d.utils.applet.MainFrame;
    import com.sun.j3d.utils.universe.*;
    import javax.media.j3d.*;
    import com.mnstarfire.loaders3d.Loader3DS;
    import com.sun.j3d.loaders.Scene;
    public class HelloJava3Da extends Applet
         public HelloJava3Da()
              setLayout(new BorderLayout());
              GraphicsConfiguration config = SimpleUniverse.getPreferredConfiguration();
              Canvas3D canvas3d = new Canvas3D(config);
              add("Center", canvas3d);
              BranchGroup scene = createSceneGraph();
              scene.compile();
              SimpleUniverse simpleU = new SimpleUniverse(canvas3d);
              simpleU.getViewingPlatform().setNominalViewingTransform();
              simpleU.addBranchGraph(scene);
         public BranchGroup createSceneGraph()
              BranchGroup objRoot = new BranchGroup();
              Loader3DS loader = new Loader3DS();
              Scene s = null;
              try{
                   s = loader.load("first-project.3DS");
              catch(FileNotFoundException e)
                   System.out.print("file not found");
                   System.exit(1);
              objRoot.addChild(s.getSceneGroup());
              return objRoot;
         public static void main(String[] args)
              Frame frame = new MainFrame(new HelloJava3Da(), 256, 256);
    It compile but all things are black

    How do you even know you are looking at your loaded model? Make sure you do that.
    Btw. black screen is a good thing, that means the scene is live. I guess you have to change your viewing direction to spot what you put into the scene.

  • Please wat is wrong with this program

    I want to reverse the user input but when I run this program it only asks for the input and when i key it in and press enter nothing happens.It just freezes.
    Sorry the code is a bit long .
    import java.io.*;
    class StackX
    private int maxSize;
    private char[] stackArray;
    private int top;
    public StackX(int max)  
           maxSize=max;
           stackArray=new char[maxSize];
           top=-1;
    public void push(char j) 
         stackArray[++top]=j;
    public char pop()    
         return stackArray[top--];
    public char peek()  
         return stackArray[top];
    public boolean isEmpty()   
         return (top==-1);
    class Reverser
         private String input;  
         private String output; 
    public Reverser(String in)
         {input = in;}
             public String doRev( )    
         int stackSize=input.length( ); 
         StackX theStack = new StackX(stackSize);
         for(int j=0;j<input.length( );j++)
         char ch=input.charAt(j); 
         theStack.push(ch);
         output ="";
         while( !theStack.isEmpty() )
         char ch=theStack.pop();
         output=output+ch; 
         return output;
    class ReverseApp
         public static void main(String[]args)throws IOException
         String input, output;
         while(true)
         System.out.print("Enter a string:");
         System.out.flush();
         input=getString();
         if( input.equals(""))
          break;
         Reverser theReverser = new Reverser(input);
         output = theReverser.doRev();
         System.out.println("Reversed: " + output);
    public static String getString()throws IOException
         InputStreamReader isr = new InputStreamReader(System.in);
         BufferedReader br= new BufferedReader(isr);
         String s = br.readLine();
         return s;
    }

    One potential problem is that you're using a new reader around system.in every time. I don't know what happens when you do that. Just make it a member variable, or create it once in main and pass it to getString.
    Asid from that, put a bunch of print statements in or use a debugger to see what's happening at each step of the way. You might be getting into an infinite loop somewhere in your reverse operation.

  • What wrong with this program

    It worked fine until i tried to make capitalized vowels recognized and now it doesn't work
    import cs1.Keyboard;
    public class Vowels
        public static void main (String[] args)
                int vowelcount = 0;
                char ltr;
                while (vowelcount <5)
                System.out.print ("Enter a letter to see if it's a vowel: "); //Prompt
                ltr = Keyboard.readChar();
                if (ltr =='a'||ltr =='e'||ltr =='o'||ltr =='i'||ltr =='u');
                System.out.println (""+ ltr +" is a vowel"); //Vowel entered
                vowelcount = (vowelcount + 1);
                else
                    System.out.println (""+ ltr +" is not a vowel"); //vowel not entered
                   System.out.println ("Congratulations you have entered all 5 vowels!");
    }I get a 'else' without 'if' error

    In java characters are internally represented with integers..
    for ex:
    char a=49 and
    char a='1' are same..
    Your are just checking for lowercase vowells..check the condition for liek this
    if(enteredChar ==65||enteredChar==96 )
    System.out.println("vowel");
    }

  • What Is Wrong With My Program Help

    This Is The Assignment I Have To Do:
    Write a Java program that prints a table with a list of at least 5 students together with their grades earned (lab points, bonus points, and the total) in the format below.
    == Student Points ==
    Name Lab Bonus Total
    Joe 43 7 50
    William 50 8 58
    Mary Sue 39 10 49
    The requirements for the program are as follows:
    1.     Name the project StudentGrades.
    2.     Print the border on the top as illustrated (using the slash and backslash characters).
    3.     Use tab characters to get your columns aligned and you must use the + operator both for addition and string concatenation.
    4.     Make up your own student names and points -- the ones shown are just for illustration purposes. You need 5 names.
    This Is What I Have So Far:
    * Darron Jones
    * 4th Period
    * ID 2497430
    *I recieved help from the internet and the book
    *StudentGrades
      public class StudentGrades
         public static void main (String[] args )
    System.out.println("///////////////////\\\\\\\\\\\\\\\\\\");
    System.out.println("==          Student Points          ==");
    System.out.println("\\\\\\\\\\\\\\\\\\\///////////////////");
    System.out.println("                                      ");
    System.out.println("Name            Lab     Bonus   Total");
    System.out.println("----            ---     -----   -----");
    System.out.println("Dill             43      7       50");
    System.out.println("Josh             50      8       58");
    System.out.println("Rebbeca          39      10      49");When I Compile It Keeps Having An Error Thats Saying: "Illegal Escape Character" Whats Wrong With The Program Help Please

    This will work exactly as you want it to be....hope u like it
         public static void main(String[] args)
              // TODO Auto-generated method stub
              System.out.print("///////////////////");
              System.out.print("\\\\\\\\\\\\\\\\\\\\\\\\");
              System.out.println("\\\\\\\\\\\\\\");
              System.out.println("== Student Points ==");
              System.out.print("\\\\\\\\\\\\\\");
              System.out.print("\\\\\\\\\\\\");
              System.out.print("\\\\\\\\\\\\");
              System.out.print("///////////////////");
              System.out.println(" ");
              System.out.println("Name Lab Bonus Total");
              System.out.println("---- --- ----- -----");
              System.out.println("Dill 43 7 50");
              System.out.println("Josh 50 8 58");
              System.out.println("Rebbeca 39 10 49");
         }

  • Help Me With This Error I Don't Know What Wrong With It Please

    Whats wrong with my program every time I compile it it has an error saying that ')' expected I don't know whats wrong with it someone help me, thank you.
    //   Robins.java
    //   Demonstrate the different behaviors of the + operator
    public class Robins
        // main prints some expressions using the + operator
        public static void main (String[] args)
         System.out.println ("Ten robins plus " + 13 canaries is + 23 birds);
    }

    System.out.println ("Ten robins plus " + "13 canaries is" + "23 birds");You can't type regular text that is not inside of " and " or it will be treated as a number / variable / something else.

  • I have been trying to open itunes that has already been installed. But, the thing is it never opens and when i do right click and trouble shoot also, it doesnt open. I dont whats wrong with itunes and my comp is 64 bit windows 7. Can somebody please help

    I have been trying to open itunes that has already been installed. But, the thing is it never opens and when i do right click and trouble shoot also, it doesnt open. I dont whats wrong with itunes and my comp is 64 bit windows 7. Can somebody please help

    no its 64 bit version of itunes. Can you please help me. I am not able to sync my iphone.

  • TS1702 i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help

    i if use "search" in music on my ipod touch 5th gen the result just show only album and playlist but nothing song result.whats wrong with it?please help

    The users guide says:
    Spotlight searches the following:
    Contacts—All content
    Apps—Titles
    Music—Names of songs, artists, and albums, and the titles of podcasts and videos
    Podcasts—Titles
    Videos—Titles
    Audiobooks—Titles
    Notes—Text of notes
    Calendar (Events)—Event titles, invitees, locations, and notes
    Mail—To, From, and Subject fields of all accounts (the text of messages isn’t searched)
    Reminders—Titles
    Messages—Names and text of messages
    Try:
    - Reset the iOS device. Nothing will be lost
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsynce all music and resync
    - Reset all settings
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup
    - Restore to factory settings/new iOS device.
    - Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • HELP PLEASE - WHATS WRONG WITH THIS CODE

    Hi. I get this message coming up when I try to compile the code,
    run:
    java.lang.NullPointerException
    at sumcalculator.SumNumbers.<init>(SumNumbers.java:34)
    at sumcalculator.SumNumbers.main(SumNumbers.java:93)
    Exception in thread "main"
    Java Result: 1
    BUILD SUCCESSFUL (total time: 2 seconds)
    I am not sure whats wrong with the code. Any assistance would be nice. The code is below.
    package sumcalculator;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class SumNumbers extends JFrame implements FocusListener {
    JTextField value1;
    JTextField value2;
    JLabel equals;
    JTextField sum;
    JButton add;
    JButton minus;
    JButton divide;
    JButton multiply;
    JLabel operation;
    public SumNumbers() {
    SumNumbersLayout customLayout = new SumNumbersLayout();
    getContentPane().setFont(new Font("Helvetica", Font.PLAIN, 12));
    getContentPane().setLayout(customLayout);
    value1.addFocusListener(this);
    value2.addFocusListener(this);
    sum.setEditable(true);
    value1 = new JTextField("");
    getContentPane().add(value1);
    value2 = new JTextField("");
    getContentPane().add(value2);
    equals = new JLabel("label_1");
    getContentPane().add(equals);
    sum = new JTextField("");
    getContentPane().add(sum);
    add = new JButton("+");
    getContentPane().add(add);
    minus = new JButton("-");
    getContentPane().add(minus);
    divide = new JButton("/");
    getContentPane().add(divide);
    multiply = new JButton("*");
    getContentPane().add(multiply);
    operation = new JLabel();
    getContentPane().add(operation);
    setSize(getPreferredSize());
    addWindowListener(new WindowAdapter() {
    public void windowClosing(WindowEvent e) {
    System.exit(0);
    public void focusGained(FocusEvent event){
    try {
    float total = Float.parseFloat(value1.getText()) +
    Float.parseFloat(value2.getText());
    sum.setText("" + total);
    } catch (NumberFormatException nfe) {
    value1.setText("0");
    value2.setText("0");
    sum.setText("0");
    public void focusLost(FocusEvent event){
    focusGained(event);
    public static void main(String args[]) {
    SumNumbers window = new SumNumbers();
    window.setTitle("SumNumbers");
    window.pack();
    window.show();
    class SumNumbersLayout implements LayoutManager {
    public SumNumbersLayout() {
    public void addLayoutComponent(String name, Component comp) {
    public void removeLayoutComponent(Component comp) {
    public Dimension preferredLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    Insets insets = parent.getInsets();
    dim.width = 711 + insets.left + insets.right;
    dim.height = 240 + insets.top + insets.bottom;
    return dim;
    public Dimension minimumLayoutSize(Container parent) {
    Dimension dim = new Dimension(0, 0);
    return dim;
    public void layoutContainer(Container parent) {
    Insets insets = parent.getInsets();
    Component c;
    c = parent.getComponent(0);
    if (c.isVisible()) {c.setBounds(insets.left+24,insets.top+48,128,40);}
    c = parent.getComponent(1);
    if (c.isVisible()) {c.setBounds(insets.left+256,insets.top+48,128,40);}
    c = parent.getComponent(2);
    if (c.isVisible()) {c.setBounds(insets.left+408,insets.top+48,56,40);}
    c = parent.getComponent(3);
    if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+48,152,40);}
    c = parent.getComponent(4);
    if (c.isVisible()) {c.setBounds(insets.left+128,insets.top+136,72,40);}
    c = parent.getComponent(5);
    if (c.isVisible()) {c.setBounds(insets.left+248,insets.top+136,72,40);}
    c = parent.getComponent(6);
    if (c.isVisible()) {c.setBounds(insets.left+368,insets.top+136,72,40);}
    c = parent.getComponent(7);
    if (c.isVisible()) {c.setBounds(insets.left+488,insets.top+136,72,40);}
    c = parent.getComponent(8);
    if (c.isVisible()) {c.setBounds(insets.left+176,insets.top+48,56,40);}
    }

    Thank you. How do i amend this? I have defined value1though.Yes, you did - but after the call to addFocusListener(...). It needs to be before it.
    BTW, you did the same thing with "value2.addFocusListener(this)" and "sum.setEditable(true)" on the next two lines. You're attempting to call a method on an object that doesn't exist yet (i.e., you haven't called new yet).

  • My iphone 5 doesn't sync with itunes on my pc. it says this computer has  previously been synced to another io6 device or iphone? please help what to do?

    My iphone 5 doesn't sync with itunes on my pc. it says this computer has  previously been synced to another io6 device or iphone? please help what to do?

    The error message you're seeing is likely the other way around -- i.e. something like "This iPhone has previously been synced with a different computer".   There's no problem syncing multiple iOS devices to the same computer.
    However, the reverse is not true for the iPhone --  you cannot connect an iPhone to another computer without it being erased, even if you manually manage music and video.  So, it sounds like you've been syncing your iPhone to a different computer?
    Also, 5.1 (not 5.0.1) is the latest iOS.

  • While installing windows with bootcamp error showing "A require Cd/Drive driver is missing" in the middle of installation. Please help what to do ??

    While installing windows with bootcamp error showing "A require Cd/Drive driver is missing" in the middle of installation m not able to install windows on my mac . Please help what to do ??

    What DVD drive are you using?

  • I bought a iPhone and I was able to log into my iCloud with no problem and when I tried to update it it kicked me out and now it's asking me for the old apple user please help what can I do...?

    I bought a iPhone and I was able to log into my iCloud with no problem and when I tried to update it it kicked me out and now it's asking me for the old apple user please help what can I do...?

    Contact the original owner, and ask them to remove the device from their icloud.
    http://support.apple.com/kb/PH13695
    HTH

  • Firefox is not able load any websites but others programs can. i tried everything given in the support forum but nothing worked out. so can you please help me out with it?

    firefox is not able to load any websites... i tried everything given in the support forum under the topic firefox is not able to load any websites but other programs can.. but still i am facing the same problem. so please help me out with this issue!!

    firefox is not able to load any websites... i tried everything given in the support forum under the topic firefox is not able to load any websites but other programs can.. but still i am facing the same problem. so please help me out with this issue!!

Maybe you are looking for

  • Firefox won't even open now that I've installed Snagit - what can I do to fix this?

    Today I bought and downloaded Snagit (TechSmith) for Macintosh. When the program was being installed it asked me if I wanted a nifty Firefox extension installed. I stupidly (as it turns out) agreed! Now, Firefox won't even open. I've tried restarting

  • How to create an EHS Work Area on Company Code level?

    Hi, Is it possible to create work area on company level? (In CBIH02 the EHS work area can only be created within a Plant) I had a look at the following transactions related to link a work area to Organization Management, I'm really confused and have

  • Project authorization at task level for a user

    Dear friends,     I have created one project called TEST in solution manager. I am have assigned standard ASAP methodology as a road map for that project. I wants to restrict my user to do business blueprinting only for particular business process. I

  • CAF-Core application development in CE 7.1

    Hi Experts, I am new to CAF. I need to help how to created CAF-Core Applications. 1. How Link RFC's to external services. 2. How to created BO. 3. How to expose BO to Web services. 4. How to return more than one table values to external service. 5. H

  • Can you make a movie uncopy able? Protect it?

    Is there a way to watermark, or make a movie that you make, uncopy able. So if i put it on to a dvd, that it is copyrighted or protected, so others cant make copies? I have my own video buisness and was wondering this, so that people dont try to make