Note that sdp is not completely order independent.
| 723 | |
| 724 | // Note that sdp is not completely order independent. |
| 725 | string SdpInfo::sdpValue() |
| 726 | { |
| 727 | string result; result.reserve(100); |
| 728 | char buf[302]; |
| 729 | result.append("v=0\r\n"); // SDP protocol version |
| 730 | // originator, session id, ip address. |
| 731 | snprintf(buf,300,"o=%s %s %s IN IP4 %s\r\n",sdpUsername.c_str(),sdpSessionId.c_str(),sdpVersionId.c_str(),sdpHost.c_str()); |
| 732 | result.append(buf); |
| 733 | // RFC3264 5: And I quote: |
| 734 | // "The SDP 's=' line conveys the subject of the session, which is reasonably defined for multicast, |
| 735 | // but ill defined for unicast. For unicast sessions, it is RECOMMENDED that it consist of a single space |
| 736 | // character (0x20) or a dash (-)." |
| 737 | // I dont know why we are setting it to 'Talk Time'. |
| 738 | result.append("s=Talk Time\r\n"); |
| 739 | result.append("t=0 0\r\n"); // time session is active; 0 means unbounded. |
| 740 | snprintf(buf,300,"m=audio %u RTP/AVP %s\r\n",sdpRtpPort,sdpCodecList.c_str()); // media name and transport address. |
| 741 | result.append(buf); // media name and transport address. |
| 742 | // Optional connection information. Redundant because we included in 'o='. |
| 743 | snprintf(buf,300,"c=IN IP4 %s\r\n",sdpHost.c_str()); |
| 744 | result.append(buf); |
| 745 | result.append(sdpAttrs); |
| 746 | return result; |
| 747 | } |
| 748 | |
| 749 | }; // namespace SIP |
no test coverage detected