listen for the same Line Status with 2 AO's ?

Login to reply to this topic.
Tue, 2008-09-02 13:33
Joined: 2008-06-15
Forum posts: 48

Hello ,

I have a Notifier which listens to changes and if a change happens , it does something. that something needs to be dialling to a number .

Can i dial to the number and the same notifier will see the difference ?
Can i Listen to Status change and Dial to number with 2 different AO's ?

Thanx


Tue, 2008-09-02 13:56
Joined: 2003-12-05
Forum posts: 672
Re: listen for the same Line Status with 2 AO's ?

It depends on how you are going to use the asynch events. You need to pass the TRequestStatus variable of the AO to the asynch CTelephony method. So only the AO whose iStatus you pass as a parameter, will get the notification. But you can of course pass different AO's iStatuses to different asynch requests, assuming that the events are not related and state is handled correctly.

See e.g. a socket example, where there are two AOs, one sending and one receiving, using the same RSocket object.

Tue, 2008-09-02 14:03
Joined: 2008-06-15
Forum posts: 48
Re: listen for the same Line Status with 2 AO's ?

I have to different AO's , one for listen , one for dial .
if the Listener calls the notifier with iLine.iLineStatus=EStatusIdle , then i create the new AO for dial.
the listener is called from the notifying AO and after that , i call iTel->NotifyChange() and SetActive() . Code added :

CCallHandler::RequestNotification()
    {

    /*
       Panic if this object is already performing an asynchronous
       operation
       */
    _LIT( KNotifyPanic, "CCallHandler" );
    __ASSERT_ALWAYS( !IsActive(), User::Panic( KNotifyPanic, 1 ));
    iCurrState=EIdle;
    iTelephony->NotifyChange( iStatus,CTelephony::EVoiceLineStatusChange,iLineStatusPckg );
    SetActive();
    }

void CCallHandler::RunL()
    {
    if( iStatus==KErrNone )
       {
       if (( iLineStatus.iStatus == CTelephony::EStatusIdle ) && (iCurrState==EHang))
                       {
                        iPrevState=iCurrState;
                        iCurrState=ECallService;
                        iNotifier->NotifyOutgoingCall(iLineStatus.iStatus, CallerNumber);
                        iTelephony->NotifyChange( iStatus,CTelephony::EVoiceLineStatusChange,iLineStatusPckg );  
                        SetActive();
                       }
         }
  }

void CMyAppItemList::NotifyOutgoingCall(TInt nCallStatus, TBuf<64> bufOutgoingCallNumber)
{
               
switch (nCallStatus)
        {
        case CTelephony::EStatusDialling:
             {
        SimulateEndKey();
        break;
        }
        case CTelephony::EStatusIdle:
        {
        CTelephony* iTel = CTelephony::NewL();
        CleanupStack::PushL(iTel);
        CDialService* iDialer = new CDialService(iTel);
        CleanupStack::PushL(iDialer);
        iDialer->SetCB();
        iDialer->DialService();
        break;
        }
         }
}

Wed, 2008-09-03 06:56
Joined: 2008-06-15
Forum posts: 48
Re: listen for the same Line Status with 2 AO's ?

anyone? Sad

  • Login to reply to this topic.