Index: /pjproject/trunk/pjmedia/include/pjmedia/codec.h
===================================================================
--- /pjproject/trunk/pjmedia/include/pjmedia/codec.h	(revision 275)
+++ /pjproject/trunk/pjmedia/include/pjmedia/codec.h	(revision 276)
@@ -414,4 +414,17 @@
 
 /**
+ * Get codec info for the specified static payload type.
+ *
+ * @param mgr	    The codec manager.
+ * @param pt	    Static payload type/number.
+ * @param inf	    Pointer to receive codec info.
+ *
+ * @return	    PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_codec_mgr_get_codec_info(pjmedia_codec_mgr *mgr,
+						      unsigned pt,
+						      pjmedia_codec_info *inf);
+
+/**
  * Get default codec param for the specified codec info.
  *
Index: /pjproject/trunk/pjmedia/src/pjmedia/codec.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 275)
+++ /pjproject/trunk/pjmedia/src/pjmedia/codec.c	(revision 276)
@@ -118,4 +118,25 @@
 
 /*
+ * Get codec info for static payload type.
+ */
+PJ_DEF(pj_status_t) pjmedia_codec_mgr_get_codec_info(pjmedia_codec_mgr *mgr,
+						     unsigned pt,
+						     pjmedia_codec_info *inf)
+{
+    unsigned i;
+
+    PJ_ASSERT_RETURN(mgr && inf && pt>=0 && pt < 96, PJ_EINVAL);
+
+    for (i=0; i<mgr->codec_cnt; ++i) {
+	if (mgr->codecs[i].pt == pt) {
+	    pj_memcpy(inf, &mgr->codecs[i], sizeof(pjmedia_codec_info));
+	    return PJ_SUCCESS;
+	}
+    }
+
+    return PJMEDIA_CODEC_EUNSUP;
+}
+
+/*
  * Allocate one codec.
  */
Index: /pjproject/trunk/pjmedia/src/pjmedia/session.c
===================================================================
--- /pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 275)
+++ /pjproject/trunk/pjmedia/src/pjmedia/session.c	(revision 276)
@@ -61,4 +61,5 @@
  */
 static pj_status_t create_stream_info_from_sdp(pj_pool_t *pool,
+					       pjmedia_endpt *endpt,
 					       pjmedia_stream_info *si,
 					       const pjmedia_sdp_conn *local_conn,
@@ -69,5 +70,5 @@
     const pjmedia_sdp_attr *attr;
     pjmedia_sdp_rtpmap *rtpmap;
-    unsigned i;
+    unsigned i, pt;
     pj_status_t status;
 
@@ -144,23 +145,39 @@
 	return PJMEDIA_EINVALIDPT;
 
-    /* Find rtpmap for the first codec. 
-     * For this version of PJMEDIA, we do not support static payload
-     * type without rtpmap.
+    /* Get the payload number. */
+    pt = pj_strtoul(&local_m->desc.fmt[0]);
+
+    /* Get codec info.
+     * For static payload types, get the info from codec manager.
+     * For dynamic payload types, MUST get the rtpmap.
      */
-    attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 
-				       &local_m->desc.fmt[0]);
-    if (attr == NULL)
-	return PJMEDIA_EMISSINGRTPMAP;
-
-    status = pjmedia_sdp_attr_to_rtpmap(pool, attr, &rtpmap);
-    if (status != PJ_SUCCESS)
-	return status;
-
-    /* Build codec format info: */
-
-    si->fmt.type = si->type;
-    si->fmt.pt = pj_strtoul(&local_m->desc.fmt[0]);
-    pj_strdup(pool, &si->fmt.encoding_name, &rtpmap->enc_name);
-    si->fmt.sample_rate = rtpmap->clock_rate;
+    if (pt < 96) {
+	
+	pjmedia_codec_mgr *mgr;
+
+	mgr = pjmedia_endpt_get_codec_mgr(endpt);
+
+	status = pjmedia_codec_mgr_get_codec_info( mgr, pt, &si->fmt);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+    } else {
+
+	attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 
+					   &local_m->desc.fmt[0]);
+	if (attr == NULL)
+	    return PJMEDIA_EMISSINGRTPMAP;
+
+	status = pjmedia_sdp_attr_to_rtpmap(pool, attr, &rtpmap);
+	if (status != PJ_SUCCESS)
+	    return status;
+
+	/* Build codec format info: */
+
+	si->fmt.type = si->type;
+	si->fmt.pt = pj_strtoul(&local_m->desc.fmt[0]);
+	pj_strdup(pool, &si->fmt.encoding_name, &rtpmap->enc_name);
+	si->fmt.sample_rate = rtpmap->clock_rate;
+    }
 
     /* Get local DTMF payload type */
@@ -255,5 +272,5 @@
 	rem_conn = rem_m->conn ? rem_m->conn : rem_sdp->conn;
 
-	status = create_stream_info_from_sdp(session->pool, si,
+	status = create_stream_info_from_sdp(session->pool, endpt, si,
 					     local_conn, rem_conn,
 					     local_m, rem_m);
