Ignore:
Timestamp:
Jun 22, 2006 6:30:13 PM (15 years ago)
Author:
bennylp
Message:

Added the error code into error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsip/sip_errno.c

    r491 r534  
    3535{ 
    3636    /* Generic SIP errors */ 
    37     { PJSIP_EBUSY,              "Object is busy" }, 
    38     { PJSIP_ETYPEEXISTS ,       "Object with the same type exists" }, 
    39     { PJSIP_ESHUTDOWN,          "SIP stack shutting down" }, 
    40     { PJSIP_ENOTINITIALIZED,    "SIP object is not initialized." }, 
     37    PJ_BUILD_ERR( PJSIP_EBUSY,          "Object is busy" ), 
     38    PJ_BUILD_ERR( PJSIP_ETYPEEXISTS ,   "Object with the same type exists" ), 
     39    PJ_BUILD_ERR( PJSIP_ESHUTDOWN,      "SIP stack shutting down" ), 
     40    PJ_BUILD_ERR( PJSIP_ENOTINITIALIZED,"SIP object is not initialized." ), 
    4141 
    4242    /* Messaging errors */ 
    43     { PJSIP_EINVALIDMSG,        "Invalid message/syntax error" }, 
    44     { PJSIP_ENOTREQUESTMSG,     "Expecting request message"}, 
    45     { PJSIP_ENOTRESPONSEMSG,    "Expecting response message"}, 
    46     { PJSIP_EMSGTOOLONG,        "Message too long" }, 
    47     { PJSIP_EPARTIALMSG,        "Partial message" }, 
     43    PJ_BUILD_ERR( PJSIP_EINVALIDMSG,    "Invalid message/syntax error" ), 
     44    PJ_BUILD_ERR( PJSIP_ENOTREQUESTMSG, "Expecting request message"), 
     45    PJ_BUILD_ERR( PJSIP_ENOTRESPONSEMSG,"Expecting response message"), 
     46    PJ_BUILD_ERR( PJSIP_EMSGTOOLONG,    "Message too long" ), 
     47    PJ_BUILD_ERR( PJSIP_EPARTIALMSG,    "Partial message" ), 
    4848 
    49     { PJSIP_EINVALIDSTATUS,     "Invalid/unexpected SIP status code"}, 
     49    PJ_BUILD_ERR( PJSIP_EINVALIDSTATUS, "Invalid/unexpected SIP status code"), 
    5050 
    51     { PJSIP_EINVALIDURI,        "Invalid URI" }, 
    52     { PJSIP_EINVALIDSCHEME,     "Invalid URI scheme" }, 
    53     { PJSIP_EMISSINGREQURI,     "Missing Request-URI" }, 
    54     { PJSIP_EINVALIDREQURI,     "Invalid Request URI" }, 
    55     { PJSIP_EURITOOLONG,        "URI is too long" },  
     51    PJ_BUILD_ERR( PJSIP_EINVALIDURI,    "Invalid URI" ), 
     52    PJ_BUILD_ERR( PJSIP_EINVALIDSCHEME, "Invalid URI scheme" ), 
     53    PJ_BUILD_ERR( PJSIP_EMISSINGREQURI, "Missing Request-URI" ), 
     54    PJ_BUILD_ERR( PJSIP_EINVALIDREQURI, "Invalid Request URI" ), 
     55    PJ_BUILD_ERR( PJSIP_EURITOOLONG,    "URI is too long" ),  
    5656 
    57     { PJSIP_EMISSINGHDR,        "Missing required header(s)" }, 
    58     { PJSIP_EINVALIDHDR,        "Invalid header field"}, 
    59     { PJSIP_EINVALIDVIA,        "Invalid Via header" }, 
    60     { PJSIP_EMULTIPLEVIA,       "Multiple Via headers in response" }, 
     57    PJ_BUILD_ERR( PJSIP_EMISSINGHDR,    "Missing required header(s)" ), 
     58    PJ_BUILD_ERR( PJSIP_EINVALIDHDR,    "Invalid header field"), 
     59    PJ_BUILD_ERR( PJSIP_EINVALIDVIA,    "Invalid Via header" ), 
     60    PJ_BUILD_ERR( PJSIP_EMULTIPLEVIA,   "Multiple Via headers in response" ), 
    6161 
    62     { PJSIP_EMISSINGBODY,       "Missing message body" }, 
    63     { PJSIP_EINVALIDMETHOD,     "Invalid/unexpected method" }, 
     62    PJ_BUILD_ERR( PJSIP_EMISSINGBODY,   "Missing message body" ), 
     63    PJ_BUILD_ERR( PJSIP_EINVALIDMETHOD, "Invalid/unexpected method" ), 
    6464 
    6565    /* Transport errors */ 
    66     { PJSIP_EUNSUPTRANSPORT,    "Unsupported transport"}, 
    67     { PJSIP_EPENDINGTX,         "Transmit buffer already pending"}, 
    68     { PJSIP_ERXOVERFLOW,        "Rx buffer overflow"}, 
    69     { PJSIP_EBUFDESTROYED,      "Buffer destroyed"}, 
     66    PJ_BUILD_ERR( PJSIP_EUNSUPTRANSPORT,"Unsupported transport"), 
     67    PJ_BUILD_ERR( PJSIP_EPENDINGTX,     "Transmit buffer already pending"), 
     68    PJ_BUILD_ERR( PJSIP_ERXOVERFLOW,    "Rx buffer overflow"), 
     69    PJ_BUILD_ERR( PJSIP_EBUFDESTROYED,  "Buffer destroyed"), 
    7070 
    7171    /* Transaction errors */ 
    72     { PJSIP_ETSXDESTROYED,      "Transaction has been destroyed"}, 
    73     { PJSIP_ENOTSX,             "No transaction is associated with the object " 
    74                                 "(expecting stateful processing)" }, 
     72    PJ_BUILD_ERR( PJSIP_ETSXDESTROYED,  "Transaction has been destroyed"), 
     73    PJ_BUILD_ERR( PJSIP_ENOTSX,         "No transaction is associated with the object " 
     74                                        "(expecting stateful processing)" ), 
    7575 
    7676    /* URI comparison status */ 
    77     { PJSIP_ECMPSCHEME,         "URI scheme mismatch" }, 
    78     { PJSIP_ECMPUSER,           "URI user part mismatch" }, 
    79     { PJSIP_ECMPPASSWD,         "URI password part mismatch" }, 
    80     { PJSIP_ECMPHOST,           "URI host part mismatch" }, 
    81     { PJSIP_ECMPPORT,           "URI port mismatch" }, 
    82     { PJSIP_ECMPTRANSPORTPRM,   "URI transport param mismatch" }, 
    83     { PJSIP_ECMPTTLPARAM,       "URI ttl param mismatch" }, 
    84     { PJSIP_ECMPUSERPARAM,      "URI user param mismatch" }, 
    85     { PJSIP_ECMPMETHODPARAM,    "URI method param mismatch" }, 
    86     { PJSIP_ECMPMADDRPARAM,     "URI maddr param mismatch" }, 
    87     { PJSIP_ECMPOTHERPARAM,     "URI other param mismatch" }, 
    88     { PJSIP_ECMPHEADERPARAM,    "URI header parameter mismatch" }, 
     77    PJ_BUILD_ERR( PJSIP_ECMPSCHEME,     "URI scheme mismatch" ), 
     78    PJ_BUILD_ERR( PJSIP_ECMPUSER,       "URI user part mismatch" ), 
     79    PJ_BUILD_ERR( PJSIP_ECMPPASSWD,     "URI password part mismatch" ), 
     80    PJ_BUILD_ERR( PJSIP_ECMPHOST,       "URI host part mismatch" ), 
     81    PJ_BUILD_ERR( PJSIP_ECMPPORT,       "URI port mismatch" ), 
     82    PJ_BUILD_ERR( PJSIP_ECMPTRANSPORTPRM,"URI transport param mismatch" ), 
     83    PJ_BUILD_ERR( PJSIP_ECMPTTLPARAM,   "URI ttl param mismatch" ), 
     84    PJ_BUILD_ERR( PJSIP_ECMPUSERPARAM,  "URI user param mismatch" ), 
     85    PJ_BUILD_ERR( PJSIP_ECMPMETHODPARAM,"URI method param mismatch" ), 
     86    PJ_BUILD_ERR( PJSIP_ECMPMADDRPARAM, "URI maddr param mismatch" ), 
     87    PJ_BUILD_ERR( PJSIP_ECMPOTHERPARAM, "URI other param mismatch" ), 
     88    PJ_BUILD_ERR( PJSIP_ECMPHEADERPARAM,"URI header parameter mismatch" ), 
    8989 
    9090    /* Authentication. */ 
    91     { PJSIP_EFAILEDCREDENTIAL,  "Credential failed to authenticate"}, 
    92     { PJSIP_ENOCREDENTIAL,      "No suitable credential"}, 
    93     { PJSIP_EINVALIDALGORITHM,  "Invalid/unsupported digest algorithm" }, 
    94     { PJSIP_EINVALIDQOP,        "Invalid/unsupported digest qop" }, 
    95     { PJSIP_EINVALIDAUTHSCHEME, "Unsupported authentication scheme" }, 
    96     { PJSIP_EAUTHNOPREVCHAL,    "No previous challenge" }, 
    97     { PJSIP_EAUTHNOAUTH,        "No suitable authorization header" }, 
    98     { PJSIP_EAUTHACCNOTFOUND,   "Account or credential not found" }, 
    99     { PJSIP_EAUTHACCDISABLED,   "Account or credential is disabled" }, 
    100     { PJSIP_EAUTHINVALIDREALM,  "Invalid authorization realm"}, 
    101     { PJSIP_EAUTHINVALIDDIGEST, "Invalid authorization digest" }, 
     91    PJ_BUILD_ERR( PJSIP_EFAILEDCREDENTIAL, "Credential failed to authenticate"), 
     92    PJ_BUILD_ERR( PJSIP_ENOCREDENTIAL,     "No suitable credential"), 
     93    PJ_BUILD_ERR( PJSIP_EINVALIDALGORITHM, "Invalid/unsupported digest algorithm" ), 
     94    PJ_BUILD_ERR( PJSIP_EINVALIDQOP,       "Invalid/unsupported digest qop" ), 
     95    PJ_BUILD_ERR( PJSIP_EINVALIDAUTHSCHEME,"Unsupported authentication scheme" ), 
     96    PJ_BUILD_ERR( PJSIP_EAUTHNOPREVCHAL,   "No previous challenge" ), 
     97    PJ_BUILD_ERR( PJSIP_EAUTHNOAUTH,       "No suitable authorization header" ), 
     98    PJ_BUILD_ERR( PJSIP_EAUTHACCNOTFOUND,  "Account or credential not found" ), 
     99    PJ_BUILD_ERR( PJSIP_EAUTHACCDISABLED,  "Account or credential is disabled" ), 
     100    PJ_BUILD_ERR( PJSIP_EAUTHINVALIDREALM, "Invalid authorization realm"), 
     101    PJ_BUILD_ERR( PJSIP_EAUTHINVALIDDIGEST,"Invalid authorization digest" ), 
    102102 
    103103    /* UA/dialog layer. */ 
    104     { PJSIP_EMISSINGTAG,        "Missing From/To tag parameter" }, 
    105     { PJSIP_ENOTREFER,          "Expecting REFER request"} , 
    106     { PJSIP_ENOREFERSESSION,    "Not associated with REFER subscription"}, 
     104    PJ_BUILD_ERR( PJSIP_EMISSINGTAG,    "Missing From/To tag parameter" ), 
     105    PJ_BUILD_ERR( PJSIP_ENOTREFER,      "Expecting REFER request") , 
     106    PJ_BUILD_ERR( PJSIP_ENOREFERSESSION,"Not associated with REFER subscription"), 
    107107 
    108108    /* Invite session. */ 
    109     { PJSIP_ESESSIONTERMINATED, "INVITE session already terminated" }, 
    110     { PJSIP_ESESSIONSTATE,      "Invalid INVITE session state" }, 
     109    PJ_BUILD_ERR( PJSIP_ESESSIONTERMINATED, "INVITE session already terminated" ), 
     110    PJ_BUILD_ERR( PJSIP_ESESSIONSTATE,      "Invalid INVITE session state" ), 
    111111}; 
    112112 
Note: See TracChangeset for help on using the changeset viewer.