help required in outgoingcall
BEEL <[email protected]>
| Newsgroups | gmane.comp.java.sun.jtapi |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
we are developing an IVR System . In which we want to provide two facilities
1)Handling INCOMING CALLS
2)Handling Outgoing Calls
The Only Problem we are facing is in "Making call"(outgoing call).....
That is
"Our System is supposed to dial some numbers... and after dialing play
message".wav file" for the person whom we are dialing....
System is dialing properly...
but when the person picks up the phone..there is no event ....
neither disconnected nor any other...."
we are using MediaTerminalConnection's method startPlaying().....
we are using same method in incoming call it is working properly
there ..but not in outgoing call.But we are not sure whether the problem is
in in playing the wav file or in actually dialing events.
here is some code of the observer for outgoing call
waiting for anxiously for reply:)
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 java.net.*;
/*
* The MyCallCtlOutCallObserver class implements the CallControlCallObserver
* interface and receives all events associated with the Call.
*/
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));
System.out.println("in play sound method");
mtc.startPlaying();
}
catch (Exception excp) {
// Handle exceptions
System.out.println("Exception in playSound: " +excp.toString());
}
}
public void callChangedEvent(CallEv[] eventList) {
System.out.println("event detected");
int i =0;
for ( i = 0; i < eventList.length; i++ )
{
CallEv ev = eventList[i];
System.out.println("Received ");
switch(eventList[i].getID())
{
case CallActiveEv.ID:
System.out.println("Call Active Event\n");
break;
case CallInvalidEv.ID:
System.out.println("Call Invalid Event\n");
break;
case ConnAlertingEv.ID:
System.out.println("Connection Alerting Event\n");
break;
case ConnConnectedEv.ID:
System.out.println("Connection Connected Event\n");
break;
case ConnCreatedEv.ID:
System.out.println("Connection Created Event\n");
//
break;
case ConnDisconnectedEv.ID:
System.out.println("Connection Disconnected Event\n");
break;
case ConnFailedEv.ID:
System.out.println("Connection Failed Event\n");
break;
case ConnInProgressEv.ID:
System.out.println("Connection In Progress Event\n");
//
break;
case ConnUnknownEv.ID:
System.out.println("Connection Unknown Event\n");
break;
case TermConnActiveEv.ID:
//when this event is received, it means we have
a call active
//on our terminal. Change label to "Hang up".
System.out.println("TERMINAL CONNECTION ACTIVE
EVENT\n");
break;
case TermConnCreatedEv.ID:
System.out.println("TerminalConnection Created
Event\n");
//
break;
case TermConnDroppedEv.ID:
System.out.println("TerminalConnection Dropped
Event\n");
break;
case TermConnPassiveEv.ID:
System.out.println("TerminalConnection Passive
Event\n");
break;
case TermConnRingingEv.ID:
System.out.println("TerminalConnection Ringing
Event\n");
//
break;
case TermConnUnknownEv.ID:
System.out.println("TerminalConnection Unknown
Event\n");
break;
case CallObservationEndedEv.ID:
//when call is terminated either manually or from
the
//app, shutdown the provider
System.out.println("Call Observation Ended Event\n");
break;
default:
System.out.println("Unknown CallEv: " + eventList
[i].getID() + "\n");
break;
}
}
}//end method
}
===========================================================================
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".