some one plz help me in outgoing call the only thing left in my graduation project
Nabeel <[email protected]>
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
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".