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

Added the error code into error messages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/errno.c

    r438 r534  
    3838{ 
    3939    /* Generic PJMEDIA errors, shouldn't be used! */ 
    40     { PJMEDIA_ERROR,                "Unspecified PJMEDIA error" }, 
     40    PJ_BUILD_ERR( PJMEDIA_ERROR,            "Unspecified PJMEDIA error" ), 
    4141 
    4242    /* SDP error. */ 
    43     { PJMEDIA_SDP_EINSDP,           "Invalid SDP descriptor" }, 
    44     { PJMEDIA_SDP_EINVER,           "Invalid SDP version line" }, 
    45     { PJMEDIA_SDP_EINORIGIN,        "Invalid SDP origin line" }, 
    46     { PJMEDIA_SDP_EINTIME,          "Invalid SDP time line"}, 
    47     { PJMEDIA_SDP_EINNAME,          "SDP name/subject line is empty"}, 
    48     { PJMEDIA_SDP_EINCONN,          "Invalid SDP connection line"}, 
    49     { PJMEDIA_SDP_EMISSINGCONN,     "Missing SDP connection info line"}, 
    50     { PJMEDIA_SDP_EINATTR,          "Invalid SDP attributes"}, 
    51     { PJMEDIA_SDP_EINRTPMAP,        "Invalid SDP rtpmap attribute"}, 
    52     { PJMEDIA_SDP_ERTPMAPTOOLONG,   "SDP rtpmap attribute too long"}, 
    53     { PJMEDIA_SDP_EMISSINGRTPMAP,   "Missing SDP rtpmap for dynamic payload type"}, 
    54     { PJMEDIA_SDP_EINMEDIA,         "Invalid SDP media line" }, 
    55     { PJMEDIA_SDP_ENOFMT,           "No SDP payload format in the media line" }, 
    56     { PJMEDIA_SDP_EINPT,            "Invalid SDP payload type in media line" }, 
    57     { PJMEDIA_SDP_EINFMTP,          "Invalid SDP fmtp attribute" }, 
     43    PJ_BUILD_ERR( PJMEDIA_SDP_EINSDP,       "Invalid SDP descriptor" ), 
     44    PJ_BUILD_ERR( PJMEDIA_SDP_EINVER,       "Invalid SDP version line" ), 
     45    PJ_BUILD_ERR( PJMEDIA_SDP_EINORIGIN,    "Invalid SDP origin line" ), 
     46    PJ_BUILD_ERR( PJMEDIA_SDP_EINTIME,      "Invalid SDP time line"), 
     47    PJ_BUILD_ERR( PJMEDIA_SDP_EINNAME,      "SDP name/subject line is empty"), 
     48    PJ_BUILD_ERR( PJMEDIA_SDP_EINCONN,      "Invalid SDP connection line"), 
     49    PJ_BUILD_ERR( PJMEDIA_SDP_EMISSINGCONN, "Missing SDP connection info line"), 
     50    PJ_BUILD_ERR( PJMEDIA_SDP_EINATTR,      "Invalid SDP attributes"), 
     51    PJ_BUILD_ERR( PJMEDIA_SDP_EINRTPMAP,    "Invalid SDP rtpmap attribute"), 
     52    PJ_BUILD_ERR( PJMEDIA_SDP_ERTPMAPTOOLONG,"SDP rtpmap attribute too long"), 
     53    PJ_BUILD_ERR( PJMEDIA_SDP_EMISSINGRTPMAP,"Missing SDP rtpmap for dynamic payload type"), 
     54    PJ_BUILD_ERR( PJMEDIA_SDP_EINMEDIA,     "Invalid SDP media line" ), 
     55    PJ_BUILD_ERR( PJMEDIA_SDP_ENOFMT,       "No SDP payload format in the media line" ), 
     56    PJ_BUILD_ERR( PJMEDIA_SDP_EINPT,        "Invalid SDP payload type in media line" ), 
     57    PJ_BUILD_ERR( PJMEDIA_SDP_EINFMTP,      "Invalid SDP fmtp attribute" ), 
    5858 
    5959    /* SDP negotiator errors. */ 
    60     { PJMEDIA_SDPNEG_EINSTATE,      "Invalid SDP negotiator state for operation" }, 
    61     { PJMEDIA_SDPNEG_ENOINITIAL,    "No initial local SDP in SDP negotiator" }, 
    62     { PJMEDIA_SDPNEG_ENOACTIVE,     "No active SDP in SDP negotiator" }, 
    63     { PJMEDIA_SDPNEG_ENONEG,        "No current local/remote offer/answer" }, 
    64     { PJMEDIA_SDPNEG_EMISMEDIA,     "SDP media count mismatch in offer/answer" }, 
    65     { PJMEDIA_SDPNEG_EINVANSMEDIA,  "SDP media type mismatch in offer/answer" }, 
    66     { PJMEDIA_SDPNEG_EINVANSTP,     "SDP media transport type mismatch in offer/answer" }, 
    67     { PJMEDIA_SDPNEG_EANSNOMEDIA,   "No common SDP media payload in answer" }, 
    68     { PJMEDIA_SDPNEG_ENOMEDIA,      "No active media stream after negotiation" }, 
     60    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EINSTATE,      "Invalid SDP negotiator state for operation" ), 
     61    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOINITIAL,    "No initial local SDP in SDP negotiator" ), 
     62    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOACTIVE,     "No active SDP in SDP negotiator" ), 
     63    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENONEG,        "No current local/remote offer/answer" ), 
     64    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EMISMEDIA,     "SDP media count mismatch in offer/answer" ), 
     65    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EINVANSMEDIA,  "SDP media type mismatch in offer/answer" ), 
     66    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EINVANSTP,     "SDP media transport type mismatch in offer/answer" ), 
     67    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EANSNOMEDIA,   "No common SDP media payload in answer" ), 
     68    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOMEDIA,      "No active media stream after negotiation" ), 
    6969 
    7070    /* SDP comparison results */ 
    71     { PJMEDIA_SDP_EMEDIANOTEQUAL,   "SDP media descriptor not equal" }, 
    72     { PJMEDIA_SDP_EPORTNOTEQUAL,    "Port in SDP media descriptor not equal" }, 
    73     { PJMEDIA_SDP_ETPORTNOTEQUAL,   "Transport in SDP media descriptor not equal" }, 
    74     { PJMEDIA_SDP_EFORMATNOTEQUAL,  "Format in SDP media descriptor not equal" }, 
    75     { PJMEDIA_SDP_ECONNNOTEQUAL,    "SDP connection line not equal" }, 
    76     { PJMEDIA_SDP_EATTRNOTEQUAL,    "SDP attributes not equal" }, 
    77     { PJMEDIA_SDP_EDIRNOTEQUAL,     "SDP media direction not equal" }, 
    78     { PJMEDIA_SDP_EFMTPNOTEQUAL,    "SDP fmtp attribute not equal" }, 
    79     { PJMEDIA_SDP_ERTPMAPNOTEQUAL,  "SDP rtpmap attribute not equal" }, 
    80     { PJMEDIA_SDP_ESESSNOTEQUAL,    "SDP session descriptor not equal" }, 
    81     { PJMEDIA_SDP_EORIGINNOTEQUAL,  "SDP origin line not equal" }, 
    82     { PJMEDIA_SDP_ENAMENOTEQUAL,    "SDP name/subject line not equal" }, 
    83     { PJMEDIA_SDP_ETIMENOTEQUAL,    "SDP time line not equal" }, 
     71    PJ_BUILD_ERR( PJMEDIA_SDP_EMEDIANOTEQUAL,   "SDP media descriptor not equal" ), 
     72    PJ_BUILD_ERR( PJMEDIA_SDP_EPORTNOTEQUAL,    "Port in SDP media descriptor not equal" ), 
     73    PJ_BUILD_ERR( PJMEDIA_SDP_ETPORTNOTEQUAL,   "Transport in SDP media descriptor not equal" ), 
     74    PJ_BUILD_ERR( PJMEDIA_SDP_EFORMATNOTEQUAL,  "Format in SDP media descriptor not equal" ), 
     75    PJ_BUILD_ERR( PJMEDIA_SDP_ECONNNOTEQUAL,    "SDP connection line not equal" ), 
     76    PJ_BUILD_ERR( PJMEDIA_SDP_EATTRNOTEQUAL,    "SDP attributes not equal" ), 
     77    PJ_BUILD_ERR( PJMEDIA_SDP_EDIRNOTEQUAL,     "SDP media direction not equal" ), 
     78    PJ_BUILD_ERR( PJMEDIA_SDP_EFMTPNOTEQUAL,    "SDP fmtp attribute not equal" ), 
     79    PJ_BUILD_ERR( PJMEDIA_SDP_ERTPMAPNOTEQUAL,  "SDP rtpmap attribute not equal" ), 
     80    PJ_BUILD_ERR( PJMEDIA_SDP_ESESSNOTEQUAL,    "SDP session descriptor not equal" ), 
     81    PJ_BUILD_ERR( PJMEDIA_SDP_EORIGINNOTEQUAL,  "SDP origin line not equal" ), 
     82    PJ_BUILD_ERR( PJMEDIA_SDP_ENAMENOTEQUAL,    "SDP name/subject line not equal" ), 
     83    PJ_BUILD_ERR( PJMEDIA_SDP_ETIMENOTEQUAL,    "SDP time line not equal" ), 
    8484 
    8585    /* Codec errors. */ 
    86     { PJMEDIA_CODEC_EUNSUP,         "Unsupported media codec" }, 
    87     { PJMEDIA_CODEC_EFAILED,        "Codec internal creation error" }, 
    88     { PJMEDIA_CODEC_EFRMTOOSHORT,   "Codec frame is too short" }, 
    89     { PJMEDIA_CODEC_EPCMTOOSHORT,   "PCM frame is too short" }, 
    90     { PJMEDIA_CODEC_EFRMINLEN,      "Invalid codec frame length" }, 
     86    PJ_BUILD_ERR( PJMEDIA_CODEC_EUNSUP,         "Unsupported media codec" ), 
     87    PJ_BUILD_ERR( PJMEDIA_CODEC_EFAILED,        "Codec internal creation error" ), 
     88    PJ_BUILD_ERR( PJMEDIA_CODEC_EFRMTOOSHORT,   "Codec frame is too short" ), 
     89    PJ_BUILD_ERR( PJMEDIA_CODEC_EPCMTOOSHORT,   "PCM frame is too short" ), 
     90    PJ_BUILD_ERR( PJMEDIA_CODEC_EFRMINLEN,      "Invalid codec frame length" ), 
    9191 
    9292    /* Media errors. */ 
    93     { PJMEDIA_EINVALIDIP,           "Invalid remote media (IP) address" }, 
    94     { PJMEDIA_EASYMCODEC,           "Asymetric media codec is not supported" }, 
    95     { PJMEDIA_EINVALIDPT,           "Invalid media payload type" }, 
    96     { PJMEDIA_EMISSINGRTPMAP,       "Missing rtpmap in media description" }, 
    97     { PJMEDIA_EINVALIMEDIATYPE,     "Invalid media type" }, 
    98     { PJMEDIA_EREMOTENODTMF,        "Remote does not support DTMF" }, 
    99     { PJMEDIA_RTP_EINDTMF,          "Invalid DTMF digit" }, 
    100     { PJMEDIA_RTP_EREMNORFC2833,    "Remote does not support RFC 2833" }, 
     93    PJ_BUILD_ERR( PJMEDIA_EINVALIDIP,       "Invalid remote media (IP) address" ), 
     94    PJ_BUILD_ERR( PJMEDIA_EASYMCODEC,       "Asymetric media codec is not supported" ), 
     95    PJ_BUILD_ERR( PJMEDIA_EINVALIDPT,       "Invalid media payload type" ), 
     96    PJ_BUILD_ERR( PJMEDIA_EMISSINGRTPMAP,   "Missing rtpmap in media description" ), 
     97    PJ_BUILD_ERR( PJMEDIA_EINVALIMEDIATYPE, "Invalid media type" ), 
     98    PJ_BUILD_ERR( PJMEDIA_EREMOTENODTMF,    "Remote does not support DTMF" ), 
     99    PJ_BUILD_ERR( PJMEDIA_RTP_EINDTMF,      "Invalid DTMF digit" ), 
     100    PJ_BUILD_ERR( PJMEDIA_RTP_EREMNORFC2833,"Remote does not support RFC 2833" ), 
    101101 
    102102    /* RTP session errors. */ 
    103     { PJMEDIA_RTP_EINPKT,           "Invalid RTP packet" }, 
    104     { PJMEDIA_RTP_EINPACK,          "Invalid RTP packing (internal error)" }, 
    105     { PJMEDIA_RTP_EINVER,           "Invalid RTP version" }, 
    106     { PJMEDIA_RTP_EINSSRC,          "RTP packet SSRC id mismatch" }, 
    107     { PJMEDIA_RTP_EINPT,            "RTP packet payload type mismatch" }, 
    108     { PJMEDIA_RTP_EINLEN,           "Invalid RTP packet length" }, 
    109     { PJMEDIA_RTP_ESESSRESTART,     "RTP session restarted" }, 
    110     { PJMEDIA_RTP_ESESSPROBATION,   "RTP session in probation" }, 
    111     { PJMEDIA_RTP_EBADSEQ,          "Bad sequence number in RTP packet" }, 
    112     { PJMEDIA_RTP_EBADDEST,         "RTP media port destination is not configured" }, 
    113     { PJMEDIA_RTP_ENOCONFIG,        "RTP is not configured" }, 
     103    PJ_BUILD_ERR( PJMEDIA_RTP_EINPKT,       "Invalid RTP packet" ), 
     104    PJ_BUILD_ERR( PJMEDIA_RTP_EINPACK,      "Invalid RTP packing (internal error)" ), 
     105    PJ_BUILD_ERR( PJMEDIA_RTP_EINVER,       "Invalid RTP version" ), 
     106    PJ_BUILD_ERR( PJMEDIA_RTP_EINSSRC,      "RTP packet SSRC id mismatch" ), 
     107    PJ_BUILD_ERR( PJMEDIA_RTP_EINPT,        "RTP packet payload type mismatch" ), 
     108    PJ_BUILD_ERR( PJMEDIA_RTP_EINLEN,       "Invalid RTP packet length" ), 
     109    PJ_BUILD_ERR( PJMEDIA_RTP_ESESSRESTART,    "RTP session restarted" ), 
     110    PJ_BUILD_ERR( PJMEDIA_RTP_ESESSPROBATION,  "RTP session in probation" ), 
     111    PJ_BUILD_ERR( PJMEDIA_RTP_EBADSEQ,      "Bad sequence number in RTP packet" ), 
     112    PJ_BUILD_ERR( PJMEDIA_RTP_EBADDEST,     "RTP media port destination is not configured" ), 
     113    PJ_BUILD_ERR( PJMEDIA_RTP_ENOCONFIG,    "RTP is not configured" ), 
    114114     
    115115    /* Media port errors: */ 
    116     { PJMEDIA_ENOTCOMPATIBLE,       "Media ports are not compatible" }, 
    117     { PJMEDIA_ENCCLOCKRATE,         "Media ports have incompatible clock rate" }, 
    118     { PJMEDIA_ENCSAMPLESPFRAME,     "Media ports have incompatible samples per frame" }, 
    119     { PJMEDIA_ENCTYPE,              "Media ports have incompatible media type" }, 
    120     { PJMEDIA_ENCBITS,              "Media ports have incompatible bits per sample" }, 
    121     { PJMEDIA_ENCBYTES,             "Media ports have incompatible bytes per frame" }, 
    122     { PJMEDIA_ENCCHANNEL,           "Media ports have incompatible number of channels" }, 
     116    PJ_BUILD_ERR( PJMEDIA_ENOTCOMPATIBLE,   "Media ports are not compatible" ), 
     117    PJ_BUILD_ERR( PJMEDIA_ENCCLOCKRATE,     "Media ports have incompatible clock rate" ), 
     118    PJ_BUILD_ERR( PJMEDIA_ENCSAMPLESPFRAME, "Media ports have incompatible samples per frame" ), 
     119    PJ_BUILD_ERR( PJMEDIA_ENCTYPE,          "Media ports have incompatible media type" ), 
     120    PJ_BUILD_ERR( PJMEDIA_ENCBITS,          "Media ports have incompatible bits per sample" ), 
     121    PJ_BUILD_ERR( PJMEDIA_ENCBYTES,         "Media ports have incompatible bytes per frame" ), 
     122    PJ_BUILD_ERR( PJMEDIA_ENCCHANNEL,       "Media ports have incompatible number of channels" ), 
    123123 
    124124    /* Media file errors: */ 
    125     { PJMEDIA_ENOTVALIDWAVE,        "Not a valid WAVE file" }, 
    126     { PJMEDIA_EWAVEUNSUPP,          "Unsupported WAVE file format" }, 
    127     { PJMEDIA_EWAVETOOSHORT,        "WAVE file too short" }, 
    128     { PJMEDIA_EFRMFILETOOBIG,       "Sound frame too large for file buffer"}, 
     125    PJ_BUILD_ERR( PJMEDIA_ENOTVALIDWAVE,    "Not a valid WAVE file" ), 
     126    PJ_BUILD_ERR( PJMEDIA_EWAVEUNSUPP,      "Unsupported WAVE file format" ), 
     127    PJ_BUILD_ERR( PJMEDIA_EWAVETOOSHORT,    "WAVE file too short" ), 
     128    PJ_BUILD_ERR( PJMEDIA_EFRMFILETOOBIG,   "Sound frame too large for file buffer"), 
    129129 
    130130    /* Sound device errors: */ 
    131     { PJMEDIA_ENOSNDREC,            "No suitable sound capture device" }, 
    132     { PJMEDIA_ENOSNDPLAY,           "No suitable sound playback device" }, 
    133     { PJMEDIA_ESNDINDEVID,          "Invalid sound device ID" }, 
    134     { PJMEDIA_ESNDINSAMPLEFMT,      "Invalid sample format for sound device" }, 
     131    PJ_BUILD_ERR( PJMEDIA_ENOSNDREC,        "No suitable sound capture device" ), 
     132    PJ_BUILD_ERR( PJMEDIA_ENOSNDPLAY,       "No suitable sound playback device" ), 
     133    PJ_BUILD_ERR( PJMEDIA_ESNDINDEVID,      "Invalid sound device ID" ), 
     134    PJ_BUILD_ERR( PJMEDIA_ESNDINSAMPLEFMT,  "Invalid sample format for sound device" ), 
    135135}; 
    136136 
Note: See TracChangeset for help on using the changeset viewer.