Part of aculab View Source
SDP, aka Session Description Protocol, as described in RFC 2327.
Nicked from shtoom.
This is a quick example on how to parse an SDP and access various fields:>>> s = '''v=0 ... o=root 6194 6194 IN IP4 192.168.11.224 ... s=pyaculab ... c=IN IP4 192.168.11.224 ... t=0 0 ... m=audio 8092 RTP/AVP 0 8 101 ... a=rtpmap:0 PCMU/8000/1 ... a=rtpmap:8 PCMA/8000/1 ... a=rtpmap:101 telephone-event/8000 ... '''
>>> sdp = SDP(s) >>> sdp.getAddress('audio') ('192.168.11.224', 8092) >>> sdp.getMediaDescription('audio').rtpmap {0: ('0 PCMU/8000/1', <AudioPTMarker PCMU(0)/8000/1 at b715918c>), 8: ('8 PCMA/8000/1', <AudioPTMarker PCMA(8)/8000/1 at b715926c>), 101: ('101 telephone-event/8000', <PTMarker telephone-event(dynamic)/8000/None at b715954c>)}
| Class | PTMarker | A marker of a particular payload type |
| Class | AudioPTMarker | An audio payload type |
| Class | VideoPTMarker | A video payload type |
| Function | get | Undocumented |
| Function | getA | Undocumented |
| Function | parse_generic | Undocumented |
| Function | unparse_generic | Undocumented |
| Function | parse_singleton | Undocumented |
| Function | unparse_singleton | Undocumented |
| Function | parse_o | Undocumented |
| Function | unparse_o | Undocumented |
| Function | parse_a | Undocumented |
| Function | unparse_a | Undocumented |
| Function | parse_c | Undocumented |
| Function | unparse_c | Undocumented |
| Function | parse_m | Undocumented |
| Function | unparse_m | Undocumented |
| Class | MediaDescription | The MediaDescription encapsulates all of the SDP media descriptions |
| Class | SDP | An SDP body, parsed for easy access. |
| Function | ntp2delta | Undocumented |
| Function | rtpmap2canonical | Undocumented |