Changeset 447:e8e3b471e274 in qutecom-2.2


Ignore:
Timestamp:
Dec 3, 2009 3:48:32 PM (3 years ago)
Author:
laurent@…
Branch:
default
Message:

Show error codes in a more fashion way

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • libs/sipwrapper/include/sipwrapper/EnumPhoneCallState.h

    r10 r447  
    6969                PhoneCallStateRingingStart, 
    7070                PhoneCallStateRingingStop, 
     71                PhoneCallStateBusy, 
     72                PhoneCallStateRejected, 
     73                PhoneCallStateUserNotFound, 
     74                PhoneCallStateUserNotAvailable, 
     75 
    7176        }; 
    7277 
  • libs/sipwrapper/src/EnumPhoneCallState.cpp

    r10 r447  
    6363                return "PhoneCallStateRingingStop"; 
    6464 
     65        case PhoneCallStateBusy: 
     66                return "PhoneCallStateBusy"; 
     67 
     68        case PhoneCallStateRejected: 
     69                return "PhoneCallStateRejected"; 
     70 
     71        case PhoneCallStateUserNotFound: 
     72                return "PhoneCallStateUserNotFound"; 
     73 
     74        case PhoneCallStateUserNotAvailable: 
     75                return "PhoneCallStateUserNotAvailable"; 
     76 
    6577        default: 
    6678                LOG_FATAL("unknown PhoneCallState=" + String::fromNumber(state)); 
  • libs/sipwrapper/src/phapi/PhApiCallbacks.cpp

    r439 r447  
    190190                                                        from = info->szRemoteIdentity; 
    191191                                                } 
    192                                                 p->phoneCallStateChangedEvent(*p, info->hCall, EnumPhoneCallState::PhoneCallStateClosed, from); 
     192                                                p->phoneCallStateChangedEvent(*p, info->hCall, EnumPhoneCallState::PhoneCallStateBusy, from); 
     193                                                break; 
     194 
     195                                        case CALLSTATE_DISCONNECTED_REJECTED : 
     196                                                p->phoneCallStateChangedEvent(*p, info->hCall, EnumPhoneCallState::PhoneCallStateRejected, from); 
     197                                                break; 
     198 
     199                                        case CALLSTATE_DISCONNECTED_USER_NOT_FOUND : 
     200                                                p->phoneCallStateChangedEvent(*p, info->hCall, EnumPhoneCallState::PhoneCallStateUserNotFound, from); 
     201                                                break; 
     202 
     203                                        case CALLSTATE_DISCONNECTED_USER_NOT_AVAILABLE : 
     204                                                p->phoneCallStateChangedEvent(*p, info->hCall, EnumPhoneCallState::PhoneCallStateUserNotAvailable, from); 
    193205                                                break; 
    194206 
  • wengophone/src/model/phonecall/PhoneCall.cpp

    r332 r447  
    8989        static PhoneCallStateRingingStop stateRingingStop; 
    9090        _phoneCallStateList += &stateRingingStop; 
     91 
     92        static PhoneCallStateBusy stateBusy; 
     93        _phoneCallStateList += &stateBusy; 
     94 
     95        static PhoneCallStateRejected stateRejected; 
     96        _phoneCallStateList += &stateRejected; 
     97 
     98        static PhoneCallStateUserNotFound stateUserNotFound; 
     99        _phoneCallStateList += &stateUserNotFound; 
     100 
     101        static PhoneCallStateUserNotAvailable stateUserNotAvailable; 
     102        _phoneCallStateList += &stateUserNotAvailable; 
    91103} 
    92104 
     
    176188                break; 
    177189 
     190        case EnumPhoneCallState::PhoneCallStateBusy: 
     191        case EnumPhoneCallState::PhoneCallStateRejected: 
     192        case EnumPhoneCallState::PhoneCallStateUserNotFound: 
     193        case EnumPhoneCallState::PhoneCallStateUserNotAvailable: 
     194                break; 
     195 
    178196        case EnumPhoneCallState::PhoneCallStateError: 
    179197                break; 
  • wengophone/src/model/phonecall/PhoneCallStateUnknown.h

    r10 r447  
    3838}; 
    3939 
     40/** 
     41 * 
     42 * @ingroup model 
     43 * @author Preetish Kakkar 
     44 */ 
     45class PhoneCallStateBusy : public PhoneCallState { 
     46public: 
     47 
     48        EnumPhoneCallState::PhoneCallState getCode() const { 
     49                return EnumPhoneCallState::PhoneCallStateBusy; 
     50        } 
     51 
     52        void execute(PhoneCall & phoneCall,bool doublecall = false) {} 
     53}; 
     54 
     55/** 
     56 * 
     57 * @ingroup model 
     58 * @author Preetish Kakkar 
     59 */ 
     60class PhoneCallStateRejected : public PhoneCallState { 
     61public: 
     62 
     63        EnumPhoneCallState::PhoneCallState getCode() const { 
     64                return EnumPhoneCallState::PhoneCallStateRejected; 
     65        } 
     66 
     67        void execute(PhoneCall & phoneCall,bool doublecall = false) {} 
     68}; 
     69 
     70/** 
     71 * 
     72 * @ingroup model 
     73 * @author Preetish Kakkar 
     74 */ 
     75class PhoneCallStateUserNotFound : public PhoneCallState { 
     76public: 
     77 
     78        EnumPhoneCallState::PhoneCallState getCode() const { 
     79                return EnumPhoneCallState::PhoneCallStateUserNotFound; 
     80        } 
     81 
     82        void execute(PhoneCall & phoneCall,bool doublecall = false) {} 
     83}; 
     84 
     85/** 
     86 * 
     87 * @ingroup model 
     88 * @author Preetish Kakkar 
     89 */ 
     90class PhoneCallStateUserNotAvailable : public PhoneCallState { 
     91public: 
     92 
     93        EnumPhoneCallState::PhoneCallState getCode() const { 
     94                return EnumPhoneCallState::PhoneCallStateUserNotAvailable; 
     95        } 
     96 
     97        void execute(PhoneCall & phoneCall,bool doublecall = false) {} 
     98}; 
     99 
    40100#endif  //PHONECALLSTATEUNKNOWN_H 
  • wengophone/src/presentation/qt/phonecall/QtPhoneCall.cpp

    r340 r447  
    434434        case EnumPhoneCallState::PhoneCallStateMissed: 
    435435        case EnumPhoneCallState::PhoneCallStateRedirected: 
     436        case EnumPhoneCallState::PhoneCallStateBusy: 
    436437                break; 
    437438 
     
    554555        case EnumPhoneCallState::PhoneCallStateHold: 
    555556        case EnumPhoneCallState::PhoneCallStateRedirected: 
     557        case EnumPhoneCallState::PhoneCallStateBusy: 
     558        case EnumPhoneCallState::PhoneCallStateRejected: 
     559        case EnumPhoneCallState::PhoneCallStateUserNotFound: 
     560        case EnumPhoneCallState::PhoneCallStateUserNotAvailable: 
    556561                _cPhoneCall.hangUp(); 
    557562                break; 
     
    609614        case EnumPhoneCallState::PhoneCallStateDialing: 
    610615                text = tr("Dialing"); 
     616                break; 
     617 
     618        case EnumPhoneCallState::PhoneCallStateBusy: 
     619                text = tr("User busy"); 
     620                break; 
     621 
     622        case EnumPhoneCallState::PhoneCallStateRejected: 
     623                text = tr("Call Rejected"); 
     624                break; 
     625 
     626        case EnumPhoneCallState::PhoneCallStateUserNotFound: 
     627                text = tr("User/number not found"); 
     628                break; 
     629 
     630        case EnumPhoneCallState::PhoneCallStateUserNotAvailable: 
     631                text = tr("User not available"); 
    611632                break; 
    612633 
  • wifo/phapi/phapi-old.c

    r425 r447  
    34983498        info.localUri = je->local_uri; 
    34993499        info.userData = je->external_reference; 
    3500         if (je->status_code == 486) 
    3501         { 
     3500        switch(je->status_code) { 
     3501 
     3502        case 486: 
    35023503                info.event = phCALLBUSY; 
    35033504                info.u.remoteUri = je->remote_uri; 
    3504  
    35053505                owplFireCallEvent(ca->cid, CALLSTATE_DISCONNECTED, CALLSTATE_DISCONNECTED_BUSY, ca->remote_uri, 0); 
    3506         } 
    3507         else 
    3508         { 
     3506                break; 
     3507 
     3508        case 404: 
     3509                info.event = phCALLERROR; 
     3510                info.u.remoteUri = je->remote_uri; 
     3511                owplFireCallEvent(ca->cid, CALLSTATE_DISCONNECTED, CALLSTATE_DISCONNECTED_USER_NOT_FOUND, ca->remote_uri, 0); 
     3512                break; 
     3513 
     3514        case 603: 
     3515                info.event = phCALLERROR; 
     3516                info.u.remoteUri = je->remote_uri; 
     3517                owplFireCallEvent(ca->cid, CALLSTATE_DISCONNECTED, CALLSTATE_DISCONNECTED_REJECTED, ca->remote_uri, 0); 
     3518                break; 
     3519 
     3520        case 480: 
     3521                info.event = phCALLERROR; 
     3522                info.u.remoteUri = je->remote_uri; 
     3523                owplFireCallEvent(ca->cid, CALLSTATE_DISCONNECTED, CALLSTATE_DISCONNECTED_USER_NOT_AVAILABLE, ca->remote_uri, 0); 
     3524                break; 
     3525                 
     3526        default: 
    35093527                info.event = phCALLERROR; 
    35103528                info.u.errorCode = je->status_code; 
    3511  
    35123529                owplFireCallEvent(ca->cid, CALLSTATE_DISCONNECTED, CALLSTATE_DISCONNECTED_UNKNOWN, ca->remote_uri, 0); 
    3513         } 
     3530                break; 
     3531 
     3532        } 
     3533 
    35143534 
    35153535        if (phcb->callProgress) { 
     
    43814401                owplFireSubscriptionEvent(je->sid, OWPL_SUBSCRIPTION_ACTIVE, SUBSCRIPTION_CAUSE_NORMAL, je->remote_uri, 0); 
    43824402        } 
    4383         else if (je->type == EXOSIP_SUBSCRIPTION_REQUESTFAILURE) 
    4384         { 
    4385                 if (je->status_code == 481) { 
     4403        else if (je->type == EXOSIP_SUBSCRIPTION_REQUESTFAILURE || je->type == EXOSIP_SUBSCRIPTION_SERVERFAILURE) 
     4404        { 
     4405            if (je->status_code < 200 || je->status_code > 299) { 
    43864406                    char proxyBuf[256]; 
    43874407                    int n = sizeof(proxyBuf); 
     
    45334553 
    45344554                case EXOSIP_SUBSCRIPTION_REQUESTFAILURE: 
     4555                case EXOSIP_SUBSCRIPTION_SERVERFAILURE: 
    45354556                case EXOSIP_SUBSCRIPTION_ANSWERED: 
    45364557                        ph_subscription_progress(je); 
     
    47654786 
    47664787                                case EXOSIP_SUBSCRIPTION_REQUESTFAILURE: 
     4788                                case EXOSIP_SUBSCRIPTION_SERVERFAILURE: 
    47674789                                case EXOSIP_SUBSCRIPTION_ANSWERED: 
    47684790                                        ph_subscription_progress(je); 
  • wifo/phapi/phevents.h

    r18 r447  
    200200    CALLSTATE_DISCONNECTED_AUTH,                                        /**< Disconnected: Unable to authenticate */ 
    201201    CALLSTATE_DISCONNECTED_UNKNOWN,                                     /**< Disconnected: Unknown reason */ 
     202        CALLSTATE_DISCONNECTED_REJECTED,                                                                        /**< Disconnected: Call Rejected */ 
     203        CALLSTATE_DISCONNECTED_USER_NOT_FOUND,                                                          /**< Disconnected: User Not Found*/ 
     204        CALLSTATE_DISCONNECTED_USER_NOT_AVAILABLE,                                                      /**< Disconnected: User Not Available*/ 
    202205 
    203206        CALLSTATE_OFFERING_ACTIVE                 = CALLSTATE_OFFERING + 1,         /**< See OFFERING callstate event */ 
Note: See TracChangeset for help on using the changeset viewer.