Hi,
Below is my code.Can you just tell me what is wrong in it.I am able to login
into the account.But i am not able to make a call.I don't know what the
reason is.Can you just tell me what are the possible cases where we are just
not able to make a call.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
xmlns:ribbit="com.ribbit.api.*" creationComplete="login()">
<ribbit:RibbitServices id="request" >
 </ribbit:RibbitServices>
<mx:Script>
<![CDATA[
import mx.managers.CursorManager;
import com.ribbit.api.objects.CallState;
import com.ribbit.api.events.CallEvent;
import mx.controls.Alert;
import com.ribbit.api.events.AuthenticationEvent;
import com.ribbit.api.objects.LoginParam;
import com.ribbit.api.interfaces.ILoginParam;
public var lParam:ILoginParam= new LoginParam();
public function login():void
{
//request.authenticationManager.addEventListener(AuthenticationEvent.LOGGED_IN,
handlefunction);
CursorManager.setBusyCursor();
request.authenticationManager.addEventListener(AuthenticationEvent.LOGGED_IN,handlefunction);
request.login('','','','',lParam);
}
public function handlefunction(event:AuthenticationEvent):void
{
CursorManager.removeBusyCursor();
Alert.show(event.type.toString());
}
 public function makeCall():void
{
 //CursorManager.setBusyCursor();
request.callManager.addEventListener(CallEvent.CONNECTED,onCallStateEvent);
request.callManager.addEventListener(CallEvent.CALL_STATE_CHANGE,onCallStateEvent);
request.callManager.addEventListener(CallEvent.CALL_STATE_CHANGING,onCallStateEvent);
request.callManager.addEventListener(CallEvent.DISCONNECTED,onCallStateEvent);
request.callManager.addEventListener(CallEvent.ERROR,onCallStateEvent);
 var x:String=firstNo.text;
var y:String = null;
    if (secondNo.text.length > 0)
    {
   y  = secondNo.text;
}
//request.callManager.dial("4087704369",null);
//request.callManager.dial("8284889412",null);
//request.callManager.dial("7077464339",null);
//Alert.show("Ok1");
request.callManager.dial(x);
}
public function onCallStateEvent(event:CallEvent):void
{
   Alert.show("K")
 //CursorManager.removeBusyCursor();

   switch(event.type)
   {

      case CallEvent.CONNECTED:
      {
       Alert.show("Conected");
      }
      case CallEvent.CALL_STATE_CHANGE:
      {
         if(event.newState == CallState.ANSWERED)
         {
            // handle Call State Change
            Alert.show("Ok11");
         }
         if(event.newState == CallState.BUSY)
         {
            // handle Call State Change
            Alert.show("Ok12");
         }
         if(event.newState == CallState.DIALING)
         {
         Alert.show("Dialing");
         }
         if(event.newState == CallState.ACTIVE)
         {
         Alert.show("Active");
         }
         if(event.newState == CallState.CONNECTING)
         {
         Alert.show("Connecting");
         }
         if(event.newState == CallState.HUNGUP)
         {
         Alert.show("Hungup");
         }
         if(event.newState == CallState.RINGING)
         {
         Alert.show("Ringing");
         }
         if(event.newState == CallState.READY)
         {
         Alert.show("Ready");
         }
      }
      case CallEvent.CALL_STATE_CHANGE:
      {
       Alert.show("Change");
      }
      case CallEvent.DISCONNECTED:
      {
       Alert.show("Disconnected");
      }
   }
}
public function handleError(event:Error):void
{
Alert.show("Ok2");
}
]]>
</mx:Script>
<mx:Button click="makeCall()" label="Dial"></mx:Button>
<mx:TextInput id="firstNo"></mx:TextInput>
<mx:TextInput id="secondNo"></mx:TextInput>
</mx:Application>


On Wed, Nov 19, 2008 at 10:37 PM, Vivian Richard <[EMAIL PROTECTED]> wrote:

>
>   Hi Vishal,
>
>   please check this link in YouTube:
>
>   http://www.youtube.com/watch?v=KqxGhiC-zNc&feature=related
>
>   I was in this event in Sunnyvale. There are 5 videos and we had a
>   step by step tutorials there. I also had all the example codes but
>   I guess now I lost it. I guess you can find it if you google for it.
>
>   Here are some more links:
>
>   http://developer.ribbit.com/spawn2008/
>
>
>
> On Wed, Nov 19, 2008 at 3:39 AM, Vishal lad <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> > Has anyone here used Ribbit for calling a phone  from flex
> > application?.
> > My Problem is that when I run "SimpleRibbitPhone.mxml" it does not
> > allow me to login from flex application.
> > If anyone has used this before please guide me. If anyone wants to
> > explore this can visit this site http://developer.ribbit.com/
> >
> > Thanks in Advance
> > >
> >
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to flex_india@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to