Index: /pjproject/trunk/pjlib-util/src/pjlib-util/errno.c
===================================================================
--- /pjproject/trunk/pjlib-util/src/pjlib-util/errno.c	(revision 533)
+++ /pjproject/trunk/pjlib-util/src/pjlib-util/errno.c	(revision 534)
@@ -34,18 +34,18 @@
 {
     /* STUN errors */
-    { PJLIB_UTIL_ESTUNRESOLVE,	    "Unable to resolve STUN server" },
-    { PJLIB_UTIL_ESTUNINMSGTYPE,    "Unknown STUN message type" },
-    { PJLIB_UTIL_ESTUNINMSGLEN,	    "Invalid STUN message length" },
-    { PJLIB_UTIL_ESTUNINATTRLEN,    "STUN attribute length error" },
-    { PJLIB_UTIL_ESTUNINATTRTYPE,   "Invalid STUN attribute type" },
-    { PJLIB_UTIL_ESTUNININDEX,	    "Invalid STUN server/socket index" },
-    { PJLIB_UTIL_ESTUNNOBINDRES,    "No STUN binding response in the message" },
-    { PJLIB_UTIL_ESTUNRECVERRATTR,  "Received STUN error attribute" },
-    { PJLIB_UTIL_ESTUNNOMAP,	    "No STUN mapped address attribute" },
-    { PJLIB_UTIL_ESTUNNOTRESPOND,   "Received no response from STUN server" },
-    { PJLIB_UTIL_ESTUNSYMMETRIC,    "Symetric NAT detected by STUN" },
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNRESOLVE,	"Unable to resolve STUN server" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNINMSGTYPE,	"Unknown STUN message type" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNINMSGLEN,	"Invalid STUN message length" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNINATTRLEN,	"STUN attribute length error" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNINATTRTYPE,	"Invalid STUN attribute type" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNININDEX,	"Invalid STUN server/socket index" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNNOBINDRES,	"No STUN binding response in the message" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNRECVERRATTR,	"Received STUN error attribute" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNNOMAP,	"No STUN mapped address attribute" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNNOTRESPOND,	"Received no response from STUN server" ),
+    PJ_BUILD_ERR( PJLIB_UTIL_ESTUNSYMMETRIC,	"Symetric NAT detected by STUN" ),
 
     /* XML errors */
-    { PJLIB_UTIL_EINXML,	    "Invalid XML message" },
+    PJ_BUILD_ERR( PJLIB_UTIL_EINXML,		"Invalid XML message" ),
 };
 #endif	/* PJ_HAS_ERROR_STRING */
Index: /pjproject/trunk/pjlib/include/pj/errno.h
===================================================================
--- /pjproject/trunk/pjlib/include/pj/errno.h	(revision 533)
+++ /pjproject/trunk/pjlib/include/pj/errno.h	(revision 534)
@@ -67,5 +67,5 @@
  * Guidelines on error message length.
  */
-#define PJ_ERR_MSG_SIZE  64
+#define PJ_ERR_MSG_SIZE  80
 
 /**
@@ -190,4 +190,16 @@
 
 /**
+ * Use this macro to generate error message text for your error code,
+ * so that they look uniformly as the rest of the libraries.
+ *
+ * @param code	The error code
+ * @param msg	The error test.
+ */
+#ifndef PJ_BUILD_ERR
+#   define PJ_BUILD_ERR(code,msg) { code, msg " (" #code ")" }
+#endif
+
+
+/**
  * @hideinitializer
  * Unknown error has been reported.
@@ -269,4 +281,10 @@
  */
 #define PJ_EEOF		    (PJ_ERRNO_START_STATUS + 16)/* 70016 */
+/**
+ * @hideinitializer
+ * Size is too big.
+ */
+#define PJ_ETOOBIG	    (PJ_ERRNO_START_STATUS + 17)/* 70017 */
+
 
 /** @} */   /* pj_errnum */
Index: /pjproject/trunk/pjlib/src/pj/errno.c
===================================================================
--- /pjproject/trunk/pjlib/src/pj/errno.c	(revision 533)
+++ /pjproject/trunk/pjlib/src/pj/errno.c	(revision 534)
@@ -41,4 +41,5 @@
 /* PJLIB's own error codes/messages */
 #if defined(PJ_HAS_ERROR_STRING) && PJ_HAS_ERROR_STRING!=0
+
 static const struct 
 {
@@ -47,20 +48,21 @@
 } err_str[] = 
 {
-    { PJ_EUNKNOWN,      "Unknown Error" },
-    { PJ_EPENDING,      "Pending operation" },
-    { PJ_ETOOMANYCONN,  "Too many connecting sockets" },
-    { PJ_EINVAL,        "Invalid value or argument" },
-    { PJ_ENAMETOOLONG,  "Name too long" },
-    { PJ_ENOTFOUND,     "Not found" },
-    { PJ_ENOMEM,        "Not enough memory" },
-    { PJ_EBUG,          "BUG DETECTED!" },
-    { PJ_ETIMEDOUT,     "Operation timed out" },
-    { PJ_ETOOMANY,      "Too many objects of the specified type"},
-    { PJ_EBUSY,         "Object is busy"},
-    { PJ_ENOTSUP,	"Option/operation is not supported"},
-    { PJ_EINVALIDOP,	"Invalid operation"},
-    { PJ_ECANCELLED,    "Operation cancelled"},
-    { PJ_EEXISTS,       "Object already exists" },
-    { PJ_EEOF,		"End of file" },
+    PJ_BUILD_ERR(PJ_EUNKNOWN,      "Unknown Error" ),
+    PJ_BUILD_ERR(PJ_EPENDING,      "Pending operation" ),
+    PJ_BUILD_ERR(PJ_ETOOMANYCONN,  "Too many connecting sockets" ),
+    PJ_BUILD_ERR(PJ_EINVAL,        "Invalid value or argument" ),
+    PJ_BUILD_ERR(PJ_ENAMETOOLONG,  "Name too long" ),
+    PJ_BUILD_ERR(PJ_ENOTFOUND,     "Not found" ),
+    PJ_BUILD_ERR(PJ_ENOMEM,        "Not enough memory" ),
+    PJ_BUILD_ERR(PJ_EBUG,          "BUG DETECTED!" ),
+    PJ_BUILD_ERR(PJ_ETIMEDOUT,     "Operation timed out" ),
+    PJ_BUILD_ERR(PJ_ETOOMANY,      "Too many objects of the specified type"),
+    PJ_BUILD_ERR(PJ_EBUSY,         "Object is busy"),
+    PJ_BUILD_ERR(PJ_ENOTSUP,	   "Option/operation is not supported"),
+    PJ_BUILD_ERR(PJ_EINVALIDOP,	   "Invalid operation"),
+    PJ_BUILD_ERR(PJ_ECANCELLED,    "Operation cancelled"),
+    PJ_BUILD_ERR(PJ_EEXISTS,       "Object already exists" ),
+    PJ_BUILD_ERR(PJ_EEOF,	   "End of file" ),
+    PJ_BUILD_ERR(PJ_ETOOBIG,	   "Size is too big"),
 };
 #endif	/* PJ_HAS_ERROR_STRING */
Index: /pjproject/trunk/pjmedia/src/pjmedia/errno.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/errno.c	(revision 533)
+++ /pjproject/trunk/pjmedia/src/pjmedia/errno.c	(revision 534)
@@ -38,99 +38,99 @@
 {
     /* Generic PJMEDIA errors, shouldn't be used! */
-    { PJMEDIA_ERROR,		    "Unspecified PJMEDIA error" },
+    PJ_BUILD_ERR( PJMEDIA_ERROR,	    "Unspecified PJMEDIA error" ),
 
     /* SDP error. */
-    { PJMEDIA_SDP_EINSDP,	    "Invalid SDP descriptor" },
-    { PJMEDIA_SDP_EINVER,	    "Invalid SDP version line" },
-    { PJMEDIA_SDP_EINORIGIN,	    "Invalid SDP origin line" },
-    { PJMEDIA_SDP_EINTIME,	    "Invalid SDP time line"},
-    { PJMEDIA_SDP_EINNAME,	    "SDP name/subject line is empty"},
-    { PJMEDIA_SDP_EINCONN,	    "Invalid SDP connection line"},
-    { PJMEDIA_SDP_EMISSINGCONN,	    "Missing SDP connection info line"},
-    { PJMEDIA_SDP_EINATTR,	    "Invalid SDP attributes"},
-    { PJMEDIA_SDP_EINRTPMAP,	    "Invalid SDP rtpmap attribute"},
-    { PJMEDIA_SDP_ERTPMAPTOOLONG,   "SDP rtpmap attribute too long"},
-    { PJMEDIA_SDP_EMISSINGRTPMAP,   "Missing SDP rtpmap for dynamic payload type"},
-    { PJMEDIA_SDP_EINMEDIA,	    "Invalid SDP media line" },
-    { PJMEDIA_SDP_ENOFMT,	    "No SDP payload format in the media line" },
-    { PJMEDIA_SDP_EINPT,	    "Invalid SDP payload type in media line" },
-    { PJMEDIA_SDP_EINFMTP,	    "Invalid SDP fmtp attribute" },
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINSDP,	    "Invalid SDP descriptor" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINVER,	    "Invalid SDP version line" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINORIGIN,    "Invalid SDP origin line" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINTIME,	    "Invalid SDP time line"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINNAME,	    "SDP name/subject line is empty"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINCONN,	    "Invalid SDP connection line"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EMISSINGCONN, "Missing SDP connection info line"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINATTR,	    "Invalid SDP attributes"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINRTPMAP,    "Invalid SDP rtpmap attribute"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ERTPMAPTOOLONG,"SDP rtpmap attribute too long"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EMISSINGRTPMAP,"Missing SDP rtpmap for dynamic payload type"),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINMEDIA,	    "Invalid SDP media line" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ENOFMT,	    "No SDP payload format in the media line" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINPT,	    "Invalid SDP payload type in media line" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EINFMTP,	    "Invalid SDP fmtp attribute" ),
 
     /* SDP negotiator errors. */
-    { PJMEDIA_SDPNEG_EINSTATE,	    "Invalid SDP negotiator state for operation" },
-    { PJMEDIA_SDPNEG_ENOINITIAL,    "No initial local SDP in SDP negotiator" },
-    { PJMEDIA_SDPNEG_ENOACTIVE,	    "No active SDP in SDP negotiator" },
-    { PJMEDIA_SDPNEG_ENONEG,	    "No current local/remote offer/answer" },
-    { PJMEDIA_SDPNEG_EMISMEDIA,	    "SDP media count mismatch in offer/answer" },
-    { PJMEDIA_SDPNEG_EINVANSMEDIA,  "SDP media type mismatch in offer/answer" },
-    { PJMEDIA_SDPNEG_EINVANSTP,	    "SDP media transport type mismatch in offer/answer" },
-    { PJMEDIA_SDPNEG_EANSNOMEDIA,   "No common SDP media payload in answer" },
-    { PJMEDIA_SDPNEG_ENOMEDIA,	    "No active media stream after negotiation" },
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EINSTATE,	"Invalid SDP negotiator state for operation" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOINITIAL,	"No initial local SDP in SDP negotiator" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOACTIVE,	"No active SDP in SDP negotiator" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENONEG,	"No current local/remote offer/answer" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EMISMEDIA,	"SDP media count mismatch in offer/answer" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EINVANSMEDIA,	"SDP media type mismatch in offer/answer" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EINVANSTP,	"SDP media transport type mismatch in offer/answer" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_EANSNOMEDIA,	"No common SDP media payload in answer" ),
+    PJ_BUILD_ERR( PJMEDIA_SDPNEG_ENOMEDIA,	"No active media stream after negotiation" ),
 
     /* SDP comparison results */
-    { PJMEDIA_SDP_EMEDIANOTEQUAL,   "SDP media descriptor not equal" },
-    { PJMEDIA_SDP_EPORTNOTEQUAL,    "Port in SDP media descriptor not equal" },
-    { PJMEDIA_SDP_ETPORTNOTEQUAL,   "Transport in SDP media descriptor not equal" },
-    { PJMEDIA_SDP_EFORMATNOTEQUAL,  "Format in SDP media descriptor not equal" },
-    { PJMEDIA_SDP_ECONNNOTEQUAL,    "SDP connection line not equal" },
-    { PJMEDIA_SDP_EATTRNOTEQUAL,    "SDP attributes not equal" },
-    { PJMEDIA_SDP_EDIRNOTEQUAL,	    "SDP media direction not equal" },
-    { PJMEDIA_SDP_EFMTPNOTEQUAL,    "SDP fmtp attribute not equal" },
-    { PJMEDIA_SDP_ERTPMAPNOTEQUAL,  "SDP rtpmap attribute not equal" },
-    { PJMEDIA_SDP_ESESSNOTEQUAL,    "SDP session descriptor not equal" },
-    { PJMEDIA_SDP_EORIGINNOTEQUAL,  "SDP origin line not equal" },
-    { PJMEDIA_SDP_ENAMENOTEQUAL,    "SDP name/subject line not equal" },
-    { PJMEDIA_SDP_ETIMENOTEQUAL,    "SDP time line not equal" },
+    PJ_BUILD_ERR( PJMEDIA_SDP_EMEDIANOTEQUAL,   "SDP media descriptor not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EPORTNOTEQUAL,    "Port in SDP media descriptor not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ETPORTNOTEQUAL,   "Transport in SDP media descriptor not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EFORMATNOTEQUAL,  "Format in SDP media descriptor not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ECONNNOTEQUAL,    "SDP connection line not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EATTRNOTEQUAL,    "SDP attributes not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EDIRNOTEQUAL,     "SDP media direction not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EFMTPNOTEQUAL,    "SDP fmtp attribute not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ERTPMAPNOTEQUAL,  "SDP rtpmap attribute not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ESESSNOTEQUAL,    "SDP session descriptor not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_EORIGINNOTEQUAL,  "SDP origin line not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ENAMENOTEQUAL,    "SDP name/subject line not equal" ),
+    PJ_BUILD_ERR( PJMEDIA_SDP_ETIMENOTEQUAL,    "SDP time line not equal" ),
 
     /* Codec errors. */
-    { PJMEDIA_CODEC_EUNSUP,	    "Unsupported media codec" },
-    { PJMEDIA_CODEC_EFAILED,	    "Codec internal creation error" },
-    { PJMEDIA_CODEC_EFRMTOOSHORT,   "Codec frame is too short" },
-    { PJMEDIA_CODEC_EPCMTOOSHORT,   "PCM frame is too short" },
-    { PJMEDIA_CODEC_EFRMINLEN,	    "Invalid codec frame length" },
+    PJ_BUILD_ERR( PJMEDIA_CODEC_EUNSUP,		"Unsupported media codec" ),
+    PJ_BUILD_ERR( PJMEDIA_CODEC_EFAILED,	"Codec internal creation error" ),
+    PJ_BUILD_ERR( PJMEDIA_CODEC_EFRMTOOSHORT,   "Codec frame is too short" ),
+    PJ_BUILD_ERR( PJMEDIA_CODEC_EPCMTOOSHORT,   "PCM frame is too short" ),
+    PJ_BUILD_ERR( PJMEDIA_CODEC_EFRMINLEN,      "Invalid codec frame length" ),
 
     /* Media errors. */
-    { PJMEDIA_EINVALIDIP,	    "Invalid remote media (IP) address" },
-    { PJMEDIA_EASYMCODEC,	    "Asymetric media codec is not supported" },
-    { PJMEDIA_EINVALIDPT,	    "Invalid media payload type" },
-    { PJMEDIA_EMISSINGRTPMAP,	    "Missing rtpmap in media description" },
-    { PJMEDIA_EINVALIMEDIATYPE,	    "Invalid media type" },
-    { PJMEDIA_EREMOTENODTMF,	    "Remote does not support DTMF" },
-    { PJMEDIA_RTP_EINDTMF,	    "Invalid DTMF digit" },
-    { PJMEDIA_RTP_EREMNORFC2833,    "Remote does not support RFC 2833" },
+    PJ_BUILD_ERR( PJMEDIA_EINVALIDIP,	    "Invalid remote media (IP) address" ),
+    PJ_BUILD_ERR( PJMEDIA_EASYMCODEC,	    "Asymetric media codec is not supported" ),
+    PJ_BUILD_ERR( PJMEDIA_EINVALIDPT,	    "Invalid media payload type" ),
+    PJ_BUILD_ERR( PJMEDIA_EMISSINGRTPMAP,   "Missing rtpmap in media description" ),
+    PJ_BUILD_ERR( PJMEDIA_EINVALIMEDIATYPE, "Invalid media type" ),
+    PJ_BUILD_ERR( PJMEDIA_EREMOTENODTMF,    "Remote does not support DTMF" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINDTMF,	    "Invalid DTMF digit" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EREMNORFC2833,"Remote does not support RFC 2833" ),
 
     /* RTP session errors. */
-    { PJMEDIA_RTP_EINPKT,	    "Invalid RTP packet" },
-    { PJMEDIA_RTP_EINPACK,	    "Invalid RTP packing (internal error)" },
-    { PJMEDIA_RTP_EINVER,	    "Invalid RTP version" },
-    { PJMEDIA_RTP_EINSSRC,	    "RTP packet SSRC id mismatch" },
-    { PJMEDIA_RTP_EINPT,	    "RTP packet payload type mismatch" },
-    { PJMEDIA_RTP_EINLEN,	    "Invalid RTP packet length" },
-    { PJMEDIA_RTP_ESESSRESTART,	    "RTP session restarted" },
-    { PJMEDIA_RTP_ESESSPROBATION,   "RTP session in probation" },
-    { PJMEDIA_RTP_EBADSEQ,	    "Bad sequence number in RTP packet" },
-    { PJMEDIA_RTP_EBADDEST,	    "RTP media port destination is not configured" },
-    { PJMEDIA_RTP_ENOCONFIG,	    "RTP is not configured" },
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINPKT,	    "Invalid RTP packet" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINPACK,	    "Invalid RTP packing (internal error)" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINVER,	    "Invalid RTP version" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINSSRC,	    "RTP packet SSRC id mismatch" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINPT,	    "RTP packet payload type mismatch" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EINLEN,	    "Invalid RTP packet length" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_ESESSRESTART,    "RTP session restarted" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_ESESSPROBATION,  "RTP session in probation" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EBADSEQ,	    "Bad sequence number in RTP packet" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_EBADDEST,	    "RTP media port destination is not configured" ),
+    PJ_BUILD_ERR( PJMEDIA_RTP_ENOCONFIG,    "RTP is not configured" ),
     
     /* Media port errors: */
-    { PJMEDIA_ENOTCOMPATIBLE,	    "Media ports are not compatible" },
-    { PJMEDIA_ENCCLOCKRATE,	    "Media ports have incompatible clock rate" },
-    { PJMEDIA_ENCSAMPLESPFRAME,	    "Media ports have incompatible samples per frame" },
-    { PJMEDIA_ENCTYPE,		    "Media ports have incompatible media type" },
-    { PJMEDIA_ENCBITS,		    "Media ports have incompatible bits per sample" },
-    { PJMEDIA_ENCBYTES,		    "Media ports have incompatible bytes per frame" },
-    { PJMEDIA_ENCCHANNEL,	    "Media ports have incompatible number of channels" },
+    PJ_BUILD_ERR( PJMEDIA_ENOTCOMPATIBLE,   "Media ports are not compatible" ),
+    PJ_BUILD_ERR( PJMEDIA_ENCCLOCKRATE,	    "Media ports have incompatible clock rate" ),
+    PJ_BUILD_ERR( PJMEDIA_ENCSAMPLESPFRAME, "Media ports have incompatible samples per frame" ),
+    PJ_BUILD_ERR( PJMEDIA_ENCTYPE,	    "Media ports have incompatible media type" ),
+    PJ_BUILD_ERR( PJMEDIA_ENCBITS,	    "Media ports have incompatible bits per sample" ),
+    PJ_BUILD_ERR( PJMEDIA_ENCBYTES,	    "Media ports have incompatible bytes per frame" ),
+    PJ_BUILD_ERR( PJMEDIA_ENCCHANNEL,	    "Media ports have incompatible number of channels" ),
 
     /* Media file errors: */
-    { PJMEDIA_ENOTVALIDWAVE,	    "Not a valid WAVE file" },
-    { PJMEDIA_EWAVEUNSUPP,	    "Unsupported WAVE file format" },
-    { PJMEDIA_EWAVETOOSHORT,	    "WAVE file too short" },
-    { PJMEDIA_EFRMFILETOOBIG,	    "Sound frame too large for file buffer"},
+    PJ_BUILD_ERR( PJMEDIA_ENOTVALIDWAVE,    "Not a valid WAVE file" ),
+    PJ_BUILD_ERR( PJMEDIA_EWAVEUNSUPP,	    "Unsupported WAVE file format" ),
+    PJ_BUILD_ERR( PJMEDIA_EWAVETOOSHORT,    "WAVE file too short" ),
+    PJ_BUILD_ERR( PJMEDIA_EFRMFILETOOBIG,   "Sound frame too large for file buffer"),
 
     /* Sound device errors: */
-    { PJMEDIA_ENOSNDREC,	    "No suitable sound capture device" },
-    { PJMEDIA_ENOSNDPLAY,	    "No suitable sound playback device" },
-    { PJMEDIA_ESNDINDEVID,	    "Invalid sound device ID" },
-    { PJMEDIA_ESNDINSAMPLEFMT,	    "Invalid sample format for sound device" },
+    PJ_BUILD_ERR( PJMEDIA_ENOSNDREC,	    "No suitable sound capture device" ),
+    PJ_BUILD_ERR( PJMEDIA_ENOSNDPLAY,	    "No suitable sound playback device" ),
+    PJ_BUILD_ERR( PJMEDIA_ESNDINDEVID,	    "Invalid sound device ID" ),
+    PJ_BUILD_ERR( PJMEDIA_ESNDINSAMPLEFMT,  "Invalid sample format for sound device" ),
 };
 
Index: /pjproject/trunk/pjsip/src/pjsip/sip_errno.c
===================================================================
--- /pjproject/trunk/pjsip/src/pjsip/sip_errno.c	(revision 533)
+++ /pjproject/trunk/pjsip/src/pjsip/sip_errno.c	(revision 534)
@@ -35,78 +35,78 @@
 {
     /* Generic SIP errors */
-    { PJSIP_EBUSY,		"Object is busy" },
-    { PJSIP_ETYPEEXISTS ,	"Object with the same type exists" },
-    { PJSIP_ESHUTDOWN,		"SIP stack shutting down" },
-    { PJSIP_ENOTINITIALIZED,	"SIP object is not initialized." },
+    PJ_BUILD_ERR( PJSIP_EBUSY,		"Object is busy" ),
+    PJ_BUILD_ERR( PJSIP_ETYPEEXISTS ,	"Object with the same type exists" ),
+    PJ_BUILD_ERR( PJSIP_ESHUTDOWN,	"SIP stack shutting down" ),
+    PJ_BUILD_ERR( PJSIP_ENOTINITIALIZED,"SIP object is not initialized." ),
 
     /* Messaging errors */
-    { PJSIP_EINVALIDMSG,	"Invalid message/syntax error" },
-    { PJSIP_ENOTREQUESTMSG,	"Expecting request message"},
-    { PJSIP_ENOTRESPONSEMSG,	"Expecting response message"},
-    { PJSIP_EMSGTOOLONG,	"Message too long" },
-    { PJSIP_EPARTIALMSG,	"Partial message" },
+    PJ_BUILD_ERR( PJSIP_EINVALIDMSG,	"Invalid message/syntax error" ),
+    PJ_BUILD_ERR( PJSIP_ENOTREQUESTMSG,	"Expecting request message"),
+    PJ_BUILD_ERR( PJSIP_ENOTRESPONSEMSG,"Expecting response message"),
+    PJ_BUILD_ERR( PJSIP_EMSGTOOLONG,	"Message too long" ),
+    PJ_BUILD_ERR( PJSIP_EPARTIALMSG,	"Partial message" ),
 
-    { PJSIP_EINVALIDSTATUS,	"Invalid/unexpected SIP status code"},
+    PJ_BUILD_ERR( PJSIP_EINVALIDSTATUS,	"Invalid/unexpected SIP status code"),
 
-    { PJSIP_EINVALIDURI,	"Invalid URI" },
-    { PJSIP_EINVALIDSCHEME,	"Invalid URI scheme" },
-    { PJSIP_EMISSINGREQURI,	"Missing Request-URI" },
-    { PJSIP_EINVALIDREQURI,	"Invalid Request URI" },
-    { PJSIP_EURITOOLONG,	"URI is too long" }, 
+    PJ_BUILD_ERR( PJSIP_EINVALIDURI,	"Invalid URI" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDSCHEME,	"Invalid URI scheme" ),
+    PJ_BUILD_ERR( PJSIP_EMISSINGREQURI,	"Missing Request-URI" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDREQURI,	"Invalid Request URI" ),
+    PJ_BUILD_ERR( PJSIP_EURITOOLONG,	"URI is too long" ), 
 
-    { PJSIP_EMISSINGHDR,	"Missing required header(s)" },
-    { PJSIP_EINVALIDHDR,	"Invalid header field"},
-    { PJSIP_EINVALIDVIA,	"Invalid Via header" },
-    { PJSIP_EMULTIPLEVIA,	"Multiple Via headers in response" },
+    PJ_BUILD_ERR( PJSIP_EMISSINGHDR,	"Missing required header(s)" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDHDR,	"Invalid header field"),
+    PJ_BUILD_ERR( PJSIP_EINVALIDVIA,	"Invalid Via header" ),
+    PJ_BUILD_ERR( PJSIP_EMULTIPLEVIA,	"Multiple Via headers in response" ),
 
-    { PJSIP_EMISSINGBODY,	"Missing message body" },
-    { PJSIP_EINVALIDMETHOD,	"Invalid/unexpected method" },
+    PJ_BUILD_ERR( PJSIP_EMISSINGBODY,	"Missing message body" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDMETHOD,	"Invalid/unexpected method" ),
 
     /* Transport errors */
-    { PJSIP_EUNSUPTRANSPORT,	"Unsupported transport"},
-    { PJSIP_EPENDINGTX,		"Transmit buffer already pending"},
-    { PJSIP_ERXOVERFLOW,	"Rx buffer overflow"},
-    { PJSIP_EBUFDESTROYED,	"Buffer destroyed"},
+    PJ_BUILD_ERR( PJSIP_EUNSUPTRANSPORT,"Unsupported transport"),
+    PJ_BUILD_ERR( PJSIP_EPENDINGTX,	"Transmit buffer already pending"),
+    PJ_BUILD_ERR( PJSIP_ERXOVERFLOW,	"Rx buffer overflow"),
+    PJ_BUILD_ERR( PJSIP_EBUFDESTROYED,	"Buffer destroyed"),
 
     /* Transaction errors */
-    { PJSIP_ETSXDESTROYED,	"Transaction has been destroyed"},
-    { PJSIP_ENOTSX,		"No transaction is associated with the object "
-			        "(expecting stateful processing)" },
+    PJ_BUILD_ERR( PJSIP_ETSXDESTROYED,	"Transaction has been destroyed"),
+    PJ_BUILD_ERR( PJSIP_ENOTSX,		"No transaction is associated with the object "
+					"(expecting stateful processing)" ),
 
     /* URI comparison status */
-    { PJSIP_ECMPSCHEME,		"URI scheme mismatch" },
-    { PJSIP_ECMPUSER,		"URI user part mismatch" },
-    { PJSIP_ECMPPASSWD,		"URI password part mismatch" },
-    { PJSIP_ECMPHOST,		"URI host part mismatch" },
-    { PJSIP_ECMPPORT,		"URI port mismatch" },
-    { PJSIP_ECMPTRANSPORTPRM,	"URI transport param mismatch" },
-    { PJSIP_ECMPTTLPARAM,	"URI ttl param mismatch" },
-    { PJSIP_ECMPUSERPARAM,	"URI user param mismatch" },
-    { PJSIP_ECMPMETHODPARAM,	"URI method param mismatch" },
-    { PJSIP_ECMPMADDRPARAM,	"URI maddr param mismatch" },
-    { PJSIP_ECMPOTHERPARAM,	"URI other param mismatch" },
-    { PJSIP_ECMPHEADERPARAM,	"URI header parameter mismatch" },
+    PJ_BUILD_ERR( PJSIP_ECMPSCHEME,	"URI scheme mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPUSER,	"URI user part mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPPASSWD,	"URI password part mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPHOST,	"URI host part mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPPORT,	"URI port mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPTRANSPORTPRM,"URI transport param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPTTLPARAM,	"URI ttl param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPUSERPARAM,	"URI user param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPMETHODPARAM,"URI method param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPMADDRPARAM,	"URI maddr param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPOTHERPARAM,	"URI other param mismatch" ),
+    PJ_BUILD_ERR( PJSIP_ECMPHEADERPARAM,"URI header parameter mismatch" ),
 
     /* Authentication. */
-    { PJSIP_EFAILEDCREDENTIAL,	"Credential failed to authenticate"},
-    { PJSIP_ENOCREDENTIAL,	"No suitable credential"},
-    { PJSIP_EINVALIDALGORITHM,	"Invalid/unsupported digest algorithm" },
-    { PJSIP_EINVALIDQOP,	"Invalid/unsupported digest qop" },
-    { PJSIP_EINVALIDAUTHSCHEME,	"Unsupported authentication scheme" },
-    { PJSIP_EAUTHNOPREVCHAL,	"No previous challenge" },
-    { PJSIP_EAUTHNOAUTH,	"No suitable authorization header" },
-    { PJSIP_EAUTHACCNOTFOUND,	"Account or credential not found" },
-    { PJSIP_EAUTHACCDISABLED,	"Account or credential is disabled" },
-    { PJSIP_EAUTHINVALIDREALM,	"Invalid authorization realm"},
-    { PJSIP_EAUTHINVALIDDIGEST,	"Invalid authorization digest" },
+    PJ_BUILD_ERR( PJSIP_EFAILEDCREDENTIAL, "Credential failed to authenticate"),
+    PJ_BUILD_ERR( PJSIP_ENOCREDENTIAL,	   "No suitable credential"),
+    PJ_BUILD_ERR( PJSIP_EINVALIDALGORITHM, "Invalid/unsupported digest algorithm" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDQOP,	   "Invalid/unsupported digest qop" ),
+    PJ_BUILD_ERR( PJSIP_EINVALIDAUTHSCHEME,"Unsupported authentication scheme" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHNOPREVCHAL,   "No previous challenge" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHNOAUTH,	   "No suitable authorization header" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHACCNOTFOUND,  "Account or credential not found" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHACCDISABLED,  "Account or credential is disabled" ),
+    PJ_BUILD_ERR( PJSIP_EAUTHINVALIDREALM, "Invalid authorization realm"),
+    PJ_BUILD_ERR( PJSIP_EAUTHINVALIDDIGEST,"Invalid authorization digest" ),
 
     /* UA/dialog layer. */
-    { PJSIP_EMISSINGTAG,	"Missing From/To tag parameter" },
-    { PJSIP_ENOTREFER,		"Expecting REFER request"} ,
-    { PJSIP_ENOREFERSESSION,	"Not associated with REFER subscription"},
+    PJ_BUILD_ERR( PJSIP_EMISSINGTAG,	"Missing From/To tag parameter" ),
+    PJ_BUILD_ERR( PJSIP_ENOTREFER,	"Expecting REFER request") ,
+    PJ_BUILD_ERR( PJSIP_ENOREFERSESSION,"Not associated with REFER subscription"),
 
     /* Invite session. */
-    { PJSIP_ESESSIONTERMINATED,	"INVITE session already terminated" },
-    { PJSIP_ESESSIONSTATE,      "Invalid INVITE session state" },
+    PJ_BUILD_ERR( PJSIP_ESESSIONTERMINATED, "INVITE session already terminated" ),
+    PJ_BUILD_ERR( PJSIP_ESESSIONSTATE,      "Invalid INVITE session state" ),
 };
 
