diff options
author | Benny Prijono <bennylp@teluu.com> | 2008-01-23 20:34:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2008-01-23 20:34:11 +0000 |
commit | 5035ea445fbf6de061efacd90c66390ca15806ed (patch) | |
tree | 4dff5cdad380c2d13f41d04a72d5d84fc6389c1e | |
parent | 38e36e524430f08869bc2364aa7bbbc630778e77 (diff) |
Handle SDP offer containing application as the media type
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1734 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjmedia/include/pjmedia/types.h | 5 | ||||
-rw-r--r-- | pjmedia/src/pjmedia/session.c | 7 |
2 files changed, 10 insertions, 2 deletions
diff --git a/pjmedia/include/pjmedia/types.h b/pjmedia/include/pjmedia/types.h index cf7725df..49a4c25e 100644 --- a/pjmedia/include/pjmedia/types.h +++ b/pjmedia/include/pjmedia/types.h @@ -63,7 +63,10 @@ typedef enum pjmedia_type /** Unknown media type, in this case the name will be specified in * encoding_name. */ - PJMEDIA_TYPE_UNKNOWN = 3 + PJMEDIA_TYPE_UNKNOWN = 3, + + /** The media is application. */ + PJMEDIA_TYPE_APPLICATION = 4 } pjmedia_type; diff --git a/pjmedia/src/pjmedia/session.c b/pjmedia/src/pjmedia/session.c index ffbbc544..70bda92b 100644 --- a/pjmedia/src/pjmedia/session.c +++ b/pjmedia/src/pjmedia/session.c @@ -50,6 +50,7 @@ struct pjmedia_session static const pj_str_t ID_AUDIO = { "audio", 5}; static const pj_str_t ID_VIDEO = { "video", 5}; +static const pj_str_t ID_APPLICATION = { "application", 11}; static const pj_str_t ID_IN = { "IN", 2 }; static const pj_str_t ID_IP4 = { "IP4", 3}; static const pj_str_t ID_IP6 = { "IP6", 3}; @@ -175,10 +176,15 @@ PJ_DEF(pj_status_t) pjmedia_stream_info_from_sdp( si->type = PJMEDIA_TYPE_VIDEO; + } else if (pj_stricmp(&local_m->desc.media, &ID_APPLICATION) == 0) { + + si->type = PJMEDIA_TYPE_APPLICATION; + } else { si->type = PJMEDIA_TYPE_UNKNOWN; return PJMEDIA_EINVALIMEDIATYPE; + } /* Transport protocol */ @@ -579,7 +585,6 @@ PJ_DEF(pj_status_t) pjmedia_session_info_from_sdp( pj_pool_t *pool, local, remote, i); if (status != PJ_SUCCESS) return status; - } return PJ_SUCCESS; |