Re: help required in outgoingcall (Slightly modified)

Elliot Otchet <[email protected]>
Newsgroups gmane.comp.java.sun.jtapi
Message-ID <000401c41328$c95c1050$6401a8c0@office>
To expand a bit on Richard's point, some digital/VoIP systems have the same
problem when calls are placed to and from the PSTN.  For example, on Cisco's
3.x platform (not sure for 4.x) you immediately get a "Connected" event as
soon as the call reaches the voice gateway (and incidentally, before the
gateway even places the call on either digital or POTS lines).  Definitely
check your provider and set up a simple test to output all events and timing
of when they happen in the course of a call.  We had to create our own
activity tone detection to determine if the phone was ringing, busy/no
answer, etc then throw events for our application to work off of.  It was a
real pain, but worked in the long run.

Regards,

Elliot

-----Original Message-----
From: Discussion list for Java Telephony API
[mailto:[email protected]] On Behalf Of Richard Deadman
Sent: Friday, March 26, 2004 6:38 AM
To: [email protected]
Subject: Re: [JTAPI] help required in outgoingcall (Slightly modified)


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

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