This page contains an archived post to the Jini Forum made prior to February 25, 2002.
If you wish to participate in discussions, please visit the new
Artima Forums.
Message:
help me..
Posted by hamid khan on May 10, 2001 at 8:52 AM
Assalamalaykum . i'm hamid khan want to know more about JTAPI (As i am a beginer). I know all the java programming but JTPAI is new for me. I am going to work on this technology very soon. So pls {if u don't mind}guide me if u can. i'll be very thankful to u. what is the procedure like ? what i've to do to import this telephony package ? I'm not getting the proper books for it . pls suggest me some good books on it. I've read about the book Essentials JTAPI by Spancer Roberts and UnderStanding JAVA TELEPHONY on net. how are these books ? Can i buy these books or search for some other writers .. pls reply. thanks. khudahafiz hamid > import javax.telephony.*; > import javax.telephony.events.*; > import MyOutCallObserver; > > /* > * Places a telephone call from 560750 to 667461 > */ > public class Outcall { > > public static final void main(String args[]) { > > /* > * Create a provider by first obtaining the default implementation of > * JTAPI and then the default provider of that implementation. > */ > Provider myprovider = null; > try { > System.out.println("ok"); > JtapiPeer peer = JtapiPeerFactory.getJtapiPeer(null); > System.out.println("ok"); > myprovider = peer.getProvider(null); > } catch (Exception excp) { > System.out.println("Can't get Provider: " + excp.toString()); > System.exit(0); > } > > /* > * We need to get the appropriate objects associated with the > * originating side of the telephone call. We ask the Address for a list > * of Terminals on it and arbitrarily choose one. > */ > Address origaddr = null; > Terminal origterm = null; > try { > origaddr = myprovider.getAddress("560750"); > > /* Just get some Terminal on this Address */ > Terminal[] terminals = origaddr.getTerminals(); > if (terminals == null) { > System.out.println("No Terminals on Address."); > System.exit(0); > } > origterm = terminals[0]; > } catch (Exception excp) { > // Handle exceptions; > } > > > /* > * Create the telephone call object and add an observer. > */ > Call mycall = null; > try { > mycall = myprovider.createCall(); > mycall.addObserver(new MyOutCallObserver()); > } catch (Exception excp) { > // Handle exceptions > } > > /* > * Place the telephone call. > */ > try { > Connection c[] = mycall.connect(origterm, origaddr, "667461"); > } catch (Exception excp) { > // Handle all Exceptions > } > } > }
Replies:
|