SIP & SDP – Session Description Protocol

Protokołu SIP jest protokołem sygnalizacyjnym używanym do inicjowania sesji multimedialnych. SIP umożliwiają realizacje negocjacji charakterystyki sesji oraz jej aktualizacje ale sam w sobie nie zawiera mechanizmów do opisu kształtu sesji, przenoszonej za pomocą protkołu RTP. W tym celu SIP wykorzystuje protokół SDP (Session Descriptions Protocol)
wchodzący bezpośrednio w skład komunikatu. SDP zawiera informacje o rodzaju
mediów, kodekach i ich parametrach, adresach IP, kierunku strumieniów, dostępnym pasmie itp.

Opis sesji:

  • v= (protocol version) – wersja protokołu -> “0”
  • o= (originator and session identifier) – zrodlo i identyfikator sesji -> “dowolna_nazwa id_sesji wersja_sesji IN (IP4|IP6) adresIP_zródła_sesji”
  • s= (session subject) – temat sesjii -> “-“
  • i=* (session information) – opis sesji -> nie używany
  • u=* (URI of description) – uri dodatkowe opisu sesji -> nie używany
  • e=* (email address) – adres email osoby odpowiedzialnej za sesje -> nie używany
  • p=* (phone number) – numer telefoniczny osoby odpowiedzialnej za sesje -> nie używany
  • c=* (connection information) – opis połaczenia, nie wymagany jeśli obecny dla każdego strumienia mediów -> “IN (IP4|IP6) adresIP”
  • b=* (zero or more bandwidth information lines) – sugerowane pasmo -> nie używany
  • One or more time descriptions
  • z=* (time zone adjustments)- definicja strefy czasu -> nie używany
  • k=* (encryption key) – klucz szyfrujący -> nie używane
  • a=* (zero or more session attribute lines) – atrybuty: sendonly – jeśli strona tylko chce wysyłać media, recvonly – jeśli strona chce tylko odbierać media, inactive – bez mediów, sendrecv – jeśli strona chce wysyłać i odbierać media
  • Zero or more media descriptions

Opis Czasu:

  • t= (time the session is active) – czas sesji -> “0 0”
  • r=* (zero or more repeat times) – cykliczność sesji -> nie używany

Opis Mediów:

  • m= (media name and transport address) – opis mediów -> “(audio|video|text) RTP/AVP opis danych medialnych”
  • i=* (media title) – opis mediów -> nie używany
  • c=* (connection information) – opis połaczenia, nie wymagany jeśli obecny w opisie sesji, nadpisuje wartość z opisu sesji -> “IN (IP4|IP6) AdresIP”
  • b=* (zero or more bandwidth information lines) – sugerowane pasmo -> nie używany
  • k=* (encryption key) – klucz szyfrujący -> nie używane
  • a=* (zero or more media attribute lines)  – atrybuty strumienia, nadpisują atrybuty zdefiniowane w opisie sesji: sendonly – jeśli strona tylko chce wysyłać media, recvonly
    – jeśli strona chce tylko odbierać media, inactive – bez mediów,
    sendrecv – jeśli strona chce wysyłać i odbierać media, rtcp – port dla rtcp jesli nie, ptime – dlugosc mediów w sekunadach w przesylanym pakiecie, rtpmap – mapuje numer typu zawartosci do konkretnego kodeka i jego czestotliwosci, fmtp – umożliwia mapowanie parametrow tak aby sdp nie musialo tego rozumiec
You May Also Like

Custom SonarQube rules for Unit Tests

It's a tutorial about creating new rules for SonarQube analysis to be applied to Unit Tests. It is not trivial and involves a few tricky database steps, so I want to share my tutorial about it.It's a tutorial about creating new rules for SonarQube analysis to be applied to Unit Tests. It is not trivial and involves a few tricky database steps, so I want to share my tutorial about it.

New HTTP Logger Grails plugin

I've wrote a new Grails plugin - httplogger. It logs:

  • request information (url, headers, cookies, method, body),
  • grails dispatch information (controller, action, parameters),
  • response information (elapsed time and body).

It is mostly useful for logging your REST traffic. Full HTTP web pages can be huge to log and generally waste your space. I suggest to map all of your REST controllers with the same path in UrlMappings, e.g. /rest/ and configure this plugin with this path.

Here is some simple output just to give you a taste of it.

17:16:00,331 INFO  filters.LogRawRequestInfoFilter  - 17:16:00,340 INFO  filters.LogRawRequestInfoFilter  - 17:16:00,342 INFO  filters.LogGrailsUrlsInfoFilter  - 17:16:00,731 INFO  filters.LogOutputResponseFilter  - >> #1 returned 200, took 405 ms.
17:16:00,745 INFO filters.LogOutputResponseFilter - >> #1 responded with '{count:0}'
17:18:55,799 INFO  filters.LogRawRequestInfoFilter  - 17:18:55,799 INFO  filters.LogRawRequestInfoFilter  - 17:18:55,800 INFO  filters.LogRawRequestInfoFilter  - 17:18:55,801 INFO  filters.LogOutputResponseFilter  - >> #2 returned 404, took 3 ms.
17:18:55,802 INFO filters.LogOutputResponseFilter - >> #2 responded with ''

Official plugin information can be found on Grails plugins website here: http://grails.org/plugins/httplogger or you can browse code on github: TouK/grails-httplogger.

Spring Security by example: securing methods

This is a part of a simple Spring Security tutorial:

1. Set up and form authentication
2. User in the backend (getting logged user, authentication, testing)
3. Securing web resources
4. Securing methods
5. OpenID (login via gmail)
6. OAuth2 (login via Facebook)
7. Writing on Facebook wall with Spring Social

Securing web resources is all nice and cool, but in a well designed application it's more natural to secure methods (for example on backend facade or even domain objects). While we may get away with role-based authorization in many intranet business applications, nobody will ever handle assigning roles to users in a public, free to use Internet service. We need authorization based on rules described in our domain.

For example: there is a service AlterStory, that allows cooperative writing of stories, where one user is a director (like a movie director), deciding which chapter proposed by other authors should make it to the final story.

The method for accepting chapters, looks like this:

Read more »