Changeset b054fad


Ignore:
Timestamp:
2008-04-02T22:57:17Z (16 years ago)
Author:
Miklos Vajna <vmiklos@…>
Branches:
master
Children:
76eb071
Parents:
51dc72d
Message:

new skype_call_strerror() function to handle different call errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • skype/skype.c

    r51dc72d rb054fad  
    109109        char *info_homepage;
    110110        char *info_about;
     111        /* When a call fails, we get the reason and later we get the failure
     112         * event, so store the failure code here till then */
     113        int failurereason;
    111114};
    112115
     
    234237
    235238        return ret;
     239}
     240
     241static char *skype_call_strerror(int err)
     242{
     243        switch(err) {
     244                case 1:
     245                        return "Miscellaneous error";
     246                case 2:
     247                        return "User or phone number does not exist.";
     248                case 3:
     249                        return "User is offline";
     250                case 4:
     251                        return "No proxy found";
     252                case 5:
     253                        return "Session terminated.";
     254                case 6:
     255                        return "No common codec found.";
     256                case 7:
     257                        return "Sound I/O error.";
     258                case 8:
     259                        return "Problem with remote sound device.";
     260                case 9:
     261                        return "Call blocked by recipient.";
     262                case 10:
     263                        return "Recipient not a friend.";
     264                case 11:
     265                        return "Current user not authorized by recipient.";
     266                case 12:
     267                        return "Sound recording error.";
     268                default:
     269                        return "Unknown error";
     270        }
    236271}
    237272
     
    593628                                        *info = '\0';
    594629                                        info++;
    595                                         if(!strcmp(info, "STATUS RINGING"))
     630                                        if(!strncmp(info, "FAILUREREASON ", 14))
     631                                                sd->failurereason = atoi(strchr(info, ' '));
     632                                        else if(!strcmp(info, "STATUS RINGING"))
    596633                                        {
    597634                                                if(sd->call_id)
     
    633670                                                sd->call_id = g_strdup(id);
    634671                                                sd->call_out = TRUE;
     672                                        }
     673                                        else if(!strcmp(info, "STATUS FAILED"))
     674                                        {
     675                                                imcb_error(ic, "Call failed: %s", skype_call_strerror(sd->failurereason));
    635676                                        }
    636677                                        else if(!strncmp(info, "DURATION ", 9))
Note: See TracChangeset for help on using the changeset viewer.