Re: some one plz help me in outgoing call the only thing left in my graduation project

Richard Deadman <[email protected]>
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <[email protected]>
Nabeel,

It's hard to answer this. What JTAPI provider are you using? Do you know
that "file:sound" is the correct URl format for specifying the sound
file source for your provider? Can your provider handle wav files? Does
the file exist? Are any exceptions being thrown(you seem to be tossing
away exceptions)?


Richard

Nabeel wrote:

>i m able to receive call...
>i want to play a wav file in outgoing call ....
>plz help me in doing that here is some code which i m using for out going
>call that code is dialing correctly ..but nothing else doing except
>dialing...... would u plz add some code for playing audio file in it....
>
>
>
>
>import javax.telephony.*;
>import javax.telephony.events.*;
>import javax.telephony.callcontrol.*;
>import javax.telephony.callcontrol.events.*;
>import javax.telephony.CallObserver;
>import javax.telephony.media.*;
>import  javax.telephony.media.events.*;
>
>
>import java.net.*;
>
>
>public class MyCallCtlOutCallObserver extends java.lang.Object implements
>MediaCallObserver{
>
>  MediaTerminalConnection mtc;
>  public void stopSound(MediaTerminalConnection mtc) {
>
>     try {
>       mtc.stopPlaying();
>     }
>     catch (Exception myExcep) {
>       //////System.out.println("Exception in stopSound
>method:  "+myExcep.toString());
>     }
>   } /////
>
>///////////////////////////////////////////////////////////////
>   public void playSound(MediaTerminalConnection mtc, String sound) {
>     try {
>       mtc.usePlayURL(new URL("file:" + sound));
>       mtc.startPlaying();
>
>     }
>     catch (Exception excp) {
>       // Handle exceptions
>       //////System.out.println("Exception in playSound: " +excp.toString
>());
>     }
>   }
>
>   public void callChangedEvent(CallEv[] evlist) {
>     System.out.println("IN CALL CHANGE.....");
>
>
>
>for (int i = 0; i < evlist.length; i++)
>         {
>             CallEv ev = evlist[i];
>
> if (ev instanceof ConnEv)
>                 {
>                   String name = null;
>                   try {
>                    Connection connection = ( (ConnEv) ev).getConnection();
>                     Address addr = connection.getAddress();
>                     name = addr.getName();
>                   }
>                   catch (Exception e) {
>                     System.out.println("Exception is " + e);
>                   }
>
>                   String msg = "Connection to Address: " + name + " is ";
>
>                   switch (ev.getID())
>
>             {
>             case ConnAlertingEv.ID:
>           System.out.println(msg + "ALERTING");
>       break;
>   case ConnInProgressEv.ID:
> System.out.println(msg + "INPROGRESS");
>        break;
>    case ConnConnectedEv.ID:
>  System.out.println(msg + "CONNECTED");
>        break;
>}
>}//End IF
>}
>   }//end call change
>}
>
>plz reply soon...............
>
>===========================================================================
>To unsubscribe, send email to [email protected] and include in the body
>of the message "signoff JTAPI-INTEREST".  For general help, send email to
>[email protected] and include in the body of the message "help".
>
>
>

--
Richard Deadman
Deadman Consulting, Incorporated
http://www.deadman.ca
mailto:[email protected]
Office: 613-231-5112
Cell: 613-220-2469
Fax: 805-980-5818

===========================================================================
To unsubscribe, send email to [email protected] and include in the body
of the message "signoff JTAPI-INTEREST".  For general help, send email to
[email protected] and include in the body of the message "help".
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.