1
/* $Id: errno.h 3945 2012-01-27 09:12:59Z nanang $ */
3
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJMEDIA_ERRNO_H__
21
#define __PJMEDIA_ERRNO_H__
24
* @file errno.h Error Codes
25
* @brief PJMEDIA specific error codes.
28
#include <pjmedia/types.h>
32
* @defgroup PJMEDIA_ERRNO Error Codes
33
* @ingroup PJMEDIA_BASE
34
* @brief PJMEDIA specific error codes.
43
* Start of error code relative to PJ_ERRNO_START_USER.
45
#define PJMEDIA_ERRNO_START (PJ_ERRNO_START_USER + PJ_ERRNO_SPACE_SIZE)
46
#define PJMEDIA_ERRNO_END (PJMEDIA_ERRNO_START + PJ_ERRNO_SPACE_SIZE - 1)
50
* Mapping from PortAudio error codes to pjmedia error space.
52
#define PJMEDIA_PORTAUDIO_ERRNO_START (PJMEDIA_ERRNO_END-10000)
53
#define PJMEDIA_PORTAUDIO_ERRNO_END (PJMEDIA_PORTAUDIO_ERRNO_START + 10000 -1)
55
* Convert PortAudio error code to PJMEDIA error code.
56
* PortAudio error code range: 0 >= err >= -10000
58
#define PJMEDIA_ERRNO_FROM_PORTAUDIO(err) ((int)PJMEDIA_PORTAUDIO_ERRNO_START-err)
61
#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
64
* Mapping from LibSRTP error codes to pjmedia error space.
66
#define PJMEDIA_LIBSRTP_ERRNO_START (PJMEDIA_ERRNO_END-10200)
67
#define PJMEDIA_LIBSRTP_ERRNO_END (PJMEDIA_LIBSRTP_ERRNO_START + 200 - 1)
69
* Convert LibSRTP error code to PJMEDIA error code.
70
* LibSRTP error code range: 0 <= err < 200
72
#define PJMEDIA_ERRNO_FROM_LIBSRTP(err) (PJMEDIA_LIBSRTP_ERRNO_START+err)
76
/************************************************************
77
* GENERIC/GENERAL PJMEDIA ERRORS
78
***********************************************************/
81
* General/unknown PJMEDIA error.
83
#define PJMEDIA_ERROR (PJMEDIA_ERRNO_START+1) /* 220001 */
86
/************************************************************
88
***********************************************************/
91
* Generic invalid SDP descriptor.
93
#define PJMEDIA_SDP_EINSDP (PJMEDIA_ERRNO_START+20) /* 220020 */
96
* Invalid SDP version.
98
#define PJMEDIA_SDP_EINVER (PJMEDIA_ERRNO_START+21) /* 220021 */
101
* Invalid SDP origin (o=) line.
103
#define PJMEDIA_SDP_EINORIGIN (PJMEDIA_ERRNO_START+22) /* 220022 */
106
* Invalid SDP time (t=) line.
108
#define PJMEDIA_SDP_EINTIME (PJMEDIA_ERRNO_START+23) /* 220023 */
111
* Empty SDP subject/name (s=) line.
113
#define PJMEDIA_SDP_EINNAME (PJMEDIA_ERRNO_START+24) /* 220024 */
116
* Invalid SDP connection info (c=) line.
118
#define PJMEDIA_SDP_EINCONN (PJMEDIA_ERRNO_START+25) /* 220025 */
121
* Missing SDP connection info line.
123
#define PJMEDIA_SDP_EMISSINGCONN (PJMEDIA_ERRNO_START+26) /* 220026 */
126
* Invalid attribute (a=) line.
128
#define PJMEDIA_SDP_EINATTR (PJMEDIA_ERRNO_START+27) /* 220027 */
131
* Invalid rtpmap attribute.
133
#define PJMEDIA_SDP_EINRTPMAP (PJMEDIA_ERRNO_START+28) /* 220028 */
136
* rtpmap attribute is too long.
138
#define PJMEDIA_SDP_ERTPMAPTOOLONG (PJMEDIA_ERRNO_START+29) /* 220029 */
141
* rtpmap is missing for dynamic payload type.
143
#define PJMEDIA_SDP_EMISSINGRTPMAP (PJMEDIA_ERRNO_START+30) /* 220030 */
146
* Invalid SDP media (m=) line.
148
#define PJMEDIA_SDP_EINMEDIA (PJMEDIA_ERRNO_START+31) /* 220031 */
151
* No payload format in the media stream.
153
#define PJMEDIA_SDP_ENOFMT (PJMEDIA_ERRNO_START+32) /* 220032 */
156
* Invalid payload type in media.
158
#define PJMEDIA_SDP_EINPT (PJMEDIA_ERRNO_START+33) /* 220033 */
161
* Invalid SDP "fmtp" attribute.
163
#define PJMEDIA_SDP_EINFMTP (PJMEDIA_ERRNO_START+34) /* 220034 */
166
* Invalid SDP "rtcp" attribute.
168
#define PJMEDIA_SDP_EINRTCP (PJMEDIA_ERRNO_START+35) /* 220035 */
171
* Invalid SDP media transport protocol.
173
#define PJMEDIA_SDP_EINPROTO (PJMEDIA_ERRNO_START+36) /* 220036 */
176
* Invalid SDP bandwidth info (b=) line.
178
#define PJMEDIA_SDP_EINBANDW (PJMEDIA_ERRNO_START+37) /* 220037 */
181
/************************************************************
182
* SDP NEGOTIATOR ERRORS
183
***********************************************************/
186
* Invalid state to perform the specified operation.
188
#define PJMEDIA_SDPNEG_EINSTATE (PJMEDIA_ERRNO_START+40) /* 220040 */
191
* No initial local SDP.
193
#define PJMEDIA_SDPNEG_ENOINITIAL (PJMEDIA_ERRNO_START+41) /* 220041 */
196
* No currently active SDP.
198
#define PJMEDIA_SDPNEG_ENOACTIVE (PJMEDIA_ERRNO_START+42) /* 220042 */
201
* No current offer or answer.
203
#define PJMEDIA_SDPNEG_ENONEG (PJMEDIA_ERRNO_START+43) /* 220043 */
206
* Media count mismatch in offer and answer.
208
#define PJMEDIA_SDPNEG_EMISMEDIA (PJMEDIA_ERRNO_START+44) /* 220044 */
211
* Media type is different in the remote answer.
213
#define PJMEDIA_SDPNEG_EINVANSMEDIA (PJMEDIA_ERRNO_START+45) /* 220045 */
216
* Transport type is different in the remote answer.
218
#define PJMEDIA_SDPNEG_EINVANSTP (PJMEDIA_ERRNO_START+46) /* 220046 */
221
* No common media payload is provided in the answer.
223
#define PJMEDIA_SDPNEG_EANSNOMEDIA (PJMEDIA_ERRNO_START+47) /* 220047 */
226
* No media is active after negotiation.
228
#define PJMEDIA_SDPNEG_ENOMEDIA (PJMEDIA_ERRNO_START+48) /* 220048 */
231
* No suitable codec for remote offer.
233
#define PJMEDIA_SDPNEG_NOANSCODEC (PJMEDIA_ERRNO_START+49) /* 220049 */
236
* No suitable telephone-event for remote offer.
238
#define PJMEDIA_SDPNEG_NOANSTELEVENT (PJMEDIA_ERRNO_START+50) /* 220050 */
241
* No suitable answer for unknown remote offer.
243
#define PJMEDIA_SDPNEG_NOANSUNKNOWN (PJMEDIA_ERRNO_START+51) /* 220051 */
246
/************************************************************
247
* SDP COMPARISON STATUS
248
***********************************************************/
251
* SDP media stream not equal.
253
#define PJMEDIA_SDP_EMEDIANOTEQUAL (PJMEDIA_ERRNO_START+60) /* 220060 */
256
* Port number in SDP media descriptor not equal.
258
#define PJMEDIA_SDP_EPORTNOTEQUAL (PJMEDIA_ERRNO_START+61) /* 220061 */
261
* Transport in SDP media descriptor not equal.
263
#define PJMEDIA_SDP_ETPORTNOTEQUAL (PJMEDIA_ERRNO_START+62) /* 220062 */
266
* Media format in SDP media descriptor not equal.
268
#define PJMEDIA_SDP_EFORMATNOTEQUAL (PJMEDIA_ERRNO_START+63) /* 220063 */
271
* SDP connection description not equal.
273
#define PJMEDIA_SDP_ECONNNOTEQUAL (PJMEDIA_ERRNO_START+64) /* 220064 */
276
* SDP attributes not equal.
278
#define PJMEDIA_SDP_EATTRNOTEQUAL (PJMEDIA_ERRNO_START+65) /* 220065 */
281
* SDP media direction not equal.
283
#define PJMEDIA_SDP_EDIRNOTEQUAL (PJMEDIA_ERRNO_START+66) /* 220066 */
286
* SDP fmtp attribute not equal.
288
#define PJMEDIA_SDP_EFMTPNOTEQUAL (PJMEDIA_ERRNO_START+67) /* 220067 */
291
* SDP ftpmap attribute not equal.
293
#define PJMEDIA_SDP_ERTPMAPNOTEQUAL (PJMEDIA_ERRNO_START+68) /* 220068 */
296
* SDP session descriptor not equal.
298
#define PJMEDIA_SDP_ESESSNOTEQUAL (PJMEDIA_ERRNO_START+69) /* 220069 */
301
* SDP origin not equal.
303
#define PJMEDIA_SDP_EORIGINNOTEQUAL (PJMEDIA_ERRNO_START+70) /* 220070 */
306
* SDP name/subject not equal.
308
#define PJMEDIA_SDP_ENAMENOTEQUAL (PJMEDIA_ERRNO_START+71) /* 220071 */
311
* SDP time not equal.
313
#define PJMEDIA_SDP_ETIMENOTEQUAL (PJMEDIA_ERRNO_START+72) /* 220072 */
316
/************************************************************
318
***********************************************************/
323
#define PJMEDIA_CODEC_EUNSUP (PJMEDIA_ERRNO_START+80) /* 220080 */
326
* Codec internal creation error.
328
#define PJMEDIA_CODEC_EFAILED (PJMEDIA_ERRNO_START+81) /* 220081 */
331
* Codec frame is too short.
333
#define PJMEDIA_CODEC_EFRMTOOSHORT (PJMEDIA_ERRNO_START+82) /* 220082 */
336
* PCM buffer is too short.
338
#define PJMEDIA_CODEC_EPCMTOOSHORT (PJMEDIA_ERRNO_START+83) /* 220083 */
341
* Invalid codec frame length.
343
#define PJMEDIA_CODEC_EFRMINLEN (PJMEDIA_ERRNO_START+84) /* 220084 */
346
* Invalid PCM frame length.
348
#define PJMEDIA_CODEC_EPCMFRMINLEN (PJMEDIA_ERRNO_START+85) /* 220085 */
353
#define PJMEDIA_CODEC_EINMODE (PJMEDIA_ERRNO_START+86) /* 220086 */
356
* Bad or corrupted bitstream.
358
#define PJMEDIA_CODEC_EBADBITSTREAM (PJMEDIA_ERRNO_START+87) /* 220087 */
361
/************************************************************
363
***********************************************************/
366
* Invalid remote IP address (in SDP).
368
#define PJMEDIA_EINVALIDIP (PJMEDIA_ERRNO_START+100) /* 220100 */
371
* Asymetric codec is not supported.
373
#define PJMEDIA_EASYMCODEC (PJMEDIA_ERRNO_START+101) /* 220101 */
376
* Invalid payload type.
378
#define PJMEDIA_EINVALIDPT (PJMEDIA_ERRNO_START+102) /* 220102 */
383
#define PJMEDIA_EMISSINGRTPMAP (PJMEDIA_ERRNO_START+103) /* 220103 */
386
* Invalid media type.
388
#define PJMEDIA_EINVALIMEDIATYPE (PJMEDIA_ERRNO_START+104) /* 220104 */
391
* Remote does not support DTMF.
393
#define PJMEDIA_EREMOTENODTMF (PJMEDIA_ERRNO_START+105) /* 220105 */
396
* Invalid DTMF digit.
398
#define PJMEDIA_RTP_EINDTMF (PJMEDIA_ERRNO_START+106) /* 220106 */
401
* Remote does not support RFC 2833
403
#define PJMEDIA_RTP_EREMNORFC2833 (PJMEDIA_ERRNO_START+107) /* 220107 */
406
* Invalid or bad format
408
#define PJMEDIA_EBADFMT (PJMEDIA_ERRNO_START+108) /* 220108 */
411
/************************************************************
413
***********************************************************/
416
* General invalid RTP packet error.
418
#define PJMEDIA_RTP_EINPKT (PJMEDIA_ERRNO_START+120) /* 220120 */
421
* Invalid RTP packet packing.
423
#define PJMEDIA_RTP_EINPACK (PJMEDIA_ERRNO_START+121) /* 220121 */
426
* Invalid RTP packet version.
428
#define PJMEDIA_RTP_EINVER (PJMEDIA_ERRNO_START+122) /* 220122 */
431
* RTP SSRC id mismatch.
433
#define PJMEDIA_RTP_EINSSRC (PJMEDIA_ERRNO_START+123) /* 220123 */
436
* RTP payload type mismatch.
438
#define PJMEDIA_RTP_EINPT (PJMEDIA_ERRNO_START+124) /* 220124 */
441
* Invalid RTP packet length.
443
#define PJMEDIA_RTP_EINLEN (PJMEDIA_ERRNO_START+125) /* 220125 */
446
* RTP session restarted.
448
#define PJMEDIA_RTP_ESESSRESTART (PJMEDIA_ERRNO_START+130) /* 220130 */
451
* RTP session in probation
453
#define PJMEDIA_RTP_ESESSPROBATION (PJMEDIA_ERRNO_START+131) /* 220131 */
456
* Bad RTP sequence number
458
#define PJMEDIA_RTP_EBADSEQ (PJMEDIA_ERRNO_START+132) /* 220132 */
461
* RTP media port destination is not configured
463
#define PJMEDIA_RTP_EBADDEST (PJMEDIA_ERRNO_START+133) /* 220133 */
466
* RTP is not configured.
468
#define PJMEDIA_RTP_ENOCONFIG (PJMEDIA_ERRNO_START+134) /* 220134 */
471
/************************************************************
473
***********************************************************/
476
* Generic incompatible port error.
478
#define PJMEDIA_ENOTCOMPATIBLE (PJMEDIA_ERRNO_START+160) /* 220160 */
481
* Incompatible clock rate
483
#define PJMEDIA_ENCCLOCKRATE (PJMEDIA_ERRNO_START+161) /* 220161 */
486
* Incompatible samples per frame
488
#define PJMEDIA_ENCSAMPLESPFRAME (PJMEDIA_ERRNO_START+162) /* 220162 */
491
* Incompatible media type
493
#define PJMEDIA_ENCTYPE (PJMEDIA_ERRNO_START+163) /* 220163 */
496
* Incompatible bits per sample
498
#define PJMEDIA_ENCBITS (PJMEDIA_ERRNO_START+164) /* 220164 */
501
* Incompatible bytes per frame
503
#define PJMEDIA_ENCBYTES (PJMEDIA_ERRNO_START+165) /* 220165 */
506
* Incompatible number of channels
508
#define PJMEDIA_ENCCHANNEL (PJMEDIA_ERRNO_START+166) /* 220166 */
511
/************************************************************
513
***********************************************************/
516
* Not a valid WAVE file.
518
#define PJMEDIA_ENOTVALIDWAVE (PJMEDIA_ERRNO_START+180) /* 220180 */
521
* Unsupported WAVE file.
523
#define PJMEDIA_EWAVEUNSUPP (PJMEDIA_ERRNO_START+181) /* 220181 */
526
* Wave file too short.
528
#define PJMEDIA_EWAVETOOSHORT (PJMEDIA_ERRNO_START+182) /* 220182 */
531
* Sound frame is too large for file buffer.
533
#define PJMEDIA_EFRMFILETOOBIG (PJMEDIA_ERRNO_START+183) /* 220183 */
536
* Unsupported AVI file.
538
#define PJMEDIA_EAVIUNSUPP (PJMEDIA_ERRNO_START+191) /* 220191 */
541
/************************************************************
542
* SOUND DEVICE ERRORS
543
***********************************************************/
546
* No suitable audio capture device.
548
#define PJMEDIA_ENOSNDREC (PJMEDIA_ERRNO_START+200) /* 220200 */
551
* No suitable audio playback device.
553
#define PJMEDIA_ENOSNDPLAY (PJMEDIA_ERRNO_START+201) /* 220201 */
556
* Invalid sound device ID.
558
#define PJMEDIA_ESNDINDEVID (PJMEDIA_ERRNO_START+202) /* 220202 */
561
* Invalid sample format for sound device.
563
#define PJMEDIA_ESNDINSAMPLEFMT (PJMEDIA_ERRNO_START+203) /* 220203 */
566
#if defined(PJMEDIA_HAS_SRTP) && (PJMEDIA_HAS_SRTP != 0)
567
/************************************************************
568
* SRTP TRANSPORT ERRORS
569
***********************************************************/
572
* SRTP crypto-suite name not match the offerer tag.
574
#define PJMEDIA_SRTP_ECRYPTONOTMATCH (PJMEDIA_ERRNO_START+220) /* 220220 */
577
* Invalid SRTP key length for specific crypto.
579
#define PJMEDIA_SRTP_EINKEYLEN (PJMEDIA_ERRNO_START+221) /* 220221 */
582
* Unsupported SRTP crypto-suite.
584
#define PJMEDIA_SRTP_ENOTSUPCRYPTO (PJMEDIA_ERRNO_START+222) /* 220222 */
587
* SRTP SDP contains ambigue answer.
589
#define PJMEDIA_SRTP_ESDPAMBIGUEANS (PJMEDIA_ERRNO_START+223) /* 220223 */
592
* Duplicated crypto tag.
594
#define PJMEDIA_SRTP_ESDPDUPCRYPTOTAG (PJMEDIA_ERRNO_START+224) /* 220224 */
597
* Invalid crypto attribute.
599
#define PJMEDIA_SRTP_ESDPINCRYPTO (PJMEDIA_ERRNO_START+225) /* 220225 */
602
* Invalid crypto tag.
604
#define PJMEDIA_SRTP_ESDPINCRYPTOTAG (PJMEDIA_ERRNO_START+226) /* 220226 */
607
* Invalid SDP media transport for SRTP.
609
#define PJMEDIA_SRTP_ESDPINTRANSPORT (PJMEDIA_ERRNO_START+227) /* 220227 */
612
* SRTP crypto attribute required in SDP.
614
#define PJMEDIA_SRTP_ESDPREQCRYPTO (PJMEDIA_ERRNO_START+228) /* 220228 */
617
* Secure transport required in SDP media descriptor.
619
#define PJMEDIA_SRTP_ESDPREQSECTP (PJMEDIA_ERRNO_START+229) /* 220229 */
621
#endif /* PJMEDIA_HAS_SRTP */
625
* Get error message for the specified error code. Note that this
626
* function is only able to decode PJMEDIA specific error code.
627
* Application should use pj_strerror(), which should be able to
628
* decode all error codes belonging to all subsystems (e.g. pjlib,
629
* pjmedia, pjsip, etc).
631
* @param status The error code.
632
* @param buffer The buffer where to put the error message.
633
* @param bufsize Size of the buffer.
635
* @return The error message as NULL terminated string,
636
* wrapped with pj_str_t.
638
PJ_DECL(pj_str_t) pjmedia_strerror( pj_status_t status, char *buffer,
649
#endif /* __PJMEDIA_ERRNO_H__ */