Re: help required in outgoingcall (Slightly modified)

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

What provider are you using?

Some analog line providers have a problem doing "line discrimination",
that is detecting when the user has answered the call, since PSTN analog
(POTS) lines don't send any easily detectable signal to identify this --
you really need low-level silence detection to guess at the call
progress state. If the JTAPI layer doesn't know the Connection has
connected, it may not allow the playing of audio.

Cheers,


Richard

BEEL wrote:

>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...."
>
>only events which are fire are..
>
>created
>altering
>inprogress
>connected
>
>
>
>
>
>
>
>
>
>
> 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".
>
>
>

--
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.