{"id":18352801,"url":"https://github.com/membraneframework/ex_sdp","last_synced_at":"2026-02-17T13:06:00.798Z","repository":{"id":40351579,"uuid":"171503664","full_name":"membraneframework/ex_sdp","owner":"membraneframework","description":"Parser and serializer for Session Description Protocol","archived":false,"fork":false,"pushed_at":"2024-04-12T16:14:10.000Z","size":339,"stargazers_count":6,"open_issues_count":0,"forks_count":9,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-04-12T23:50:34.765Z","etag":null,"topics":["elixir","membrane","sdp"],"latest_commit_sha":null,"homepage":"","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/membraneframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-19T15:56:55.000Z","updated_at":"2024-05-29T11:09:39.782Z","dependencies_parsed_at":"2023-02-12T03:01:41.271Z","dependency_job_id":"ebca18dc-d57b-447a-8071-c426a0d2cade","html_url":"https://github.com/membraneframework/ex_sdp","commit_stats":null,"previous_names":["membraneframework/membrane-protocol-sdp"],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_sdp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_sdp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_sdp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/membraneframework%2Fex_sdp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/membraneframework","download_url":"https://codeload.github.com/membraneframework/ex_sdp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247478152,"owners_count":20945258,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","membrane","sdp"],"created_at":"2024-11-05T21:37:26.702Z","updated_at":"2025-12-12T00:26:55.947Z","avatar_url":"https://github.com/membraneframework.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ExSDP\n\n[![Hex.pm](https://img.shields.io/hexpm/v/ex_sdp.svg)](https://hex.pm/packages/ex_sdp)\n[![API Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](https://hexdocs.pm/ex_sdp/)\n[![CircleCI](https://circleci.com/gh/membraneframework/ex_sdp.svg?style=svg)](https://circleci.com/gh/membraneframework/ex_sdp)\n\nParser and serializer for Session Description Protocol. Based on [RFC4566](https://tools.ietf.org/html/rfc4566)\n\n## Installation\n\nThe package can be installed by adding `ex_sdp` to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    {:ex_sdp, \"~\u003e 1.1\"}\n  ]\nend\n```\n\n## Usage\n\n### Parser\n\nParser parses string with `\\r\\n` terminated lines. (although it will also accept records terminated with\na single newline character)\n\n```elixir\n\"\"\"\nv=0\no=jdoe 2890844526 2890842807 IN IP4 10.47.16.5\ns=Very fancy session name\ni=A Seminar on the session description protocol\nu=http://www.example.com/seminars/sdp.pdf\ne=j.doe@example.com (Jane Doe)\np=111 111 111\nc=IN IP4 224.2.17.12/127\nb=AS:256\nt=2873397496 2873404696\nr=604800 3600 0 90000\nr=7d 1h 0 25h\nz=2882844526 -1h 2898848070 0\nk=clear:key\na=recvonly\na=key:value\nm=audio 49170 RTP/AVP 0\ni=Sample media title\nk=prompt\nm=video 51372 RTP/AVP 99\na=rtpmap:99 h263-1998/90000\n\"\"\"\n|\u003e String.replace(\"\\n\", \"\\r\\n\")\n|\u003e ExSDP.parse()\n\n# =\u003e\n{:ok,\n %ExSDP{\n   attributes: [{\"key\", \"value\"}, :recvonly],\n   bandwidth: [%ExSDP.Bandwidth{bandwidth: 256, type: :AS}],\n   connection_data: %ExSDP.ConnectionData{\n     address: {224, 2, 17, 12},\n     address_count: nil,\n     network_type: \"IN\",\n     ttl: 127\n   },\n   email: \"j.doe@example.com (Jane Doe)\",\n   encryption: %ExSDP.Encryption{key: \"key\", method: :clear},\n   media: [\n     %ExSDP.Media{\n       attributes: [],\n       bandwidth: [%ExSDP.Bandwidth{bandwidth: 256, type: :AS}],\n       connection_data: %ExSDP.ConnectionData{\n         address: {224, 2, 17, 12},\n         address_count: nil,\n         network_type: \"IN\",\n         ttl: 127\n       },\n       encryption: %ExSDP.Encryption{key: nil, method: :prompt},\n       fmt: [0],\n       port: 49170,\n       port_count: 1,\n       protocol: \"RTP/AVP\",\n       title: \"Sample media title\",\n       type: :audio\n     },\n     %ExSDP.Media{\n       attributes: [\n         %ExSDP.Attribute.RTPMapping{\n           clock_rate: 90000,\n           encoding: \"h263-1998\",\n           params: nil,\n           payload_type: 99\n         }\n       ],\n       bandwidth: [%ExSDP.Bandwidth{bandwidth: 256, type: :AS}],\n       connection_data: %ExSDP.ConnectionData{\n         address: {224, 2, 17, 12},\n         address_count: nil,\n         network_type: \"IN\",\n         ttl: 127\n       },\n       encryption: %ExSDP.Encryption{key: \"key\", method: :clear},\n       fmt: 'c',\n       port: 51372,\n       port_count: 1,\n       protocol: \"RTP/AVP\",\n       title: nil,\n       type: :video\n     }\n   ],\n   origin: %ExSDP.Origin{\n     address: {10, 47, 16, 5},\n     network_type: \"IN\",\n     session_id: 2890844526,\n     session_version: 2890842807,\n     username: \"jdoe\"\n   },\n   phone_number: \"111 111 111\",\n   session_information: \"A Seminar on the session description protocol\",\n   session_name: \"Very fancy session name\",\n   time_repeats: [\n     %ExSDP.RepeatTimes{\n       active_duration: 3600,\n       offsets: [0, 90000],\n       repeat_interval: 604800\n     },\n     %ExSDP.RepeatTimes{\n       active_duration: 3600,\n       offsets: [0, 90000],\n       repeat_interval: 604800\n     }\n   ],\n   time_zones_adjustments: %ExSDP.Timezone{\n     corrections: [\n       %ExSDP.Timezone.Correction{adjustment_time: 2882844526, offset: -1},\n       %ExSDP.Timezone.Correction{adjustment_time: 2898848070, offset: 0}\n     ]\n   },\n   timing: %ExSDP.Timing{start_time: 2873397496, stop_time: 2873404696},\n   uri: \"http://www.example.com/seminars/sdp.pdf\",\n   version: 0\n }}\n```\n\n### Serializer\n\nSerializer serializes `ExSDP` struct to a string with `\\r\\n` terminated lines.\n\n```elixir\n%ExSDP{\n   attributes: [{\"key\", \"value\"}, :recvonly],\n   bandwidth: [%ExSDP.Bandwidth{bandwidth: 256, type: :AS}],\n   connection_data: %ExSDP.ConnectionData{\n     address: {224, 2, 17, 12},\n     network_type: \"IN\",\n     ttl: 127\n   },\n   email: \"j.doe@example.com (Jane Doe)\",\n   encryption: %ExSDP.Encryption{key: \"key\", method: :clear},\n   media: [\n     %ExSDP.Media{\n       attributes: [],\n       bandwidth: [%ExSDP.Bandwidth{bandwidth: 256, type: :AS}],\n       connection_data: %ExSDP.ConnectionData{\n         address: {224, 2, 17, 12},\n         network_type: \"IN\",\n         ttl: 127\n       },\n       encryption: %ExSDP.Encryption{method: :prompt},\n       fmt: [0],\n       port: 49170,\n       port_count: 1,\n       protocol: \"RTP/AVP\",\n       title: \"Sample media title\",\n       type: :audio\n     },\n     %ExSDP.Media{\n       attributes: [\n         %ExSDP.Attribute.RTPMapping{\n           clock_rate: 90000,\n           encoding: \"h263-1998\",\n           payload_type: 99\n         }\n       ],\n       bandwidth: [%ExSDP.Bandwidth{bandwidth: 256, type: :AS}],\n       connection_data: %ExSDP.ConnectionData{\n         address: {224, 2, 17, 12},\n         network_type: \"IN\",\n         ttl: 127\n       },\n       encryption: %ExSDP.Encryption{key: \"key\", method: :clear},\n       fmt: 'c',\n       port: 51372,\n       port_count: 1,\n       protocol: \"RTP/AVP\",\n       type: :video\n     }\n   ],\n   origin: %ExSDP.Origin{\n     address: {10, 47, 16, 5},\n     network_type: \"IN\",\n     session_id: 2890844526,\n     session_version: 2890842807,\n     username: \"jdoe\"\n   },\n   phone_number: \"111 111 111\",\n   session_information: \"A Seminar on the session description protocol\",\n   session_name: \"Very fancy session name\",\n   time_repeats: [\n     %ExSDP.RepeatTimes{\n       active_duration: 3600,\n       offsets: [0, 90000],\n       repeat_interval: 604800\n     },\n     %ExSDP.RepeatTimes{\n       active_duration: 3600,\n       offsets: [0, 90000],\n       repeat_interval: 604800\n     }\n   ],\n   time_zones_adjustments: %ExSDP.Timezone{\n     corrections: [\n       %ExSDP.Timezone.Correction{adjustment_time: 2882844526, offset: -1},\n       %ExSDP.Timezone.Correction{adjustment_time: 2898848070, offset: 0}\n     ]\n   },\n   timing: %ExSDP.Timing{start_time: 2873397496, stop_time: 2873404696},\n   uri: \"http://www.example.com/seminars/sdp.pdf\",\n   version: 0\n}\n|\u003e to_string()\n\n# =\u003e\n\"\"\"\nv=0\no=jdoe 2890844526 2890842807 IN IP4 10.47.16.5\ns=Very fancy session name\ni=A Seminar on the session description protocol\nu=http://www.example.com/seminars/sdp.pdf\ne=j.doe@example.com (Jane Doe)\np=111 111 111\nc=IN IP4 224.2.17.12/127\nb=AS:256\nt=2873397496 2873404696\nr=604800 3600 0 90000\nr=604800 3600 0 90000\nz=2882844526 -1h 2898848070 0\nk=clear:key\na=key:value\na=recvonly\nm=audio 49170 RTP/AVP 0\ni=Sample media title\nc=IN IP4 224.2.17.12/127\nb=AS:256\nk=prompt\nm=video 51372 RTP/AVP 99\nc=IN IP4 224.2.17.12/127\nb=AS:256\nk=clear:key\na=rtpmap:99 h263-1998/90000\n\"\"\"\n```\n\n## Copyright and License\n\nCopyright 2020, [Software Mansion](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane)\n\n[![Software Mansion](https://logo.swmansion.com/logo?color=white\u0026variant=desktop\u0026width=200\u0026tag=membrane-github)](https://swmansion.com/?utm_source=git\u0026utm_medium=readme\u0026utm_campaign=membrane)\n\nLicensed under the [Apache License, Version 2.0](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fex_sdp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmembraneframework%2Fex_sdp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmembraneframework%2Fex_sdp/lists"}