170 likes | 327 Views
AMI3 Monthly Report 2010.12. HTTP over SCTP. How to build Apache over SCTP streams Original httpd-2.0.55 sources SCTP Patch How to build SCTP Firefox 3.0.11 Firefox (1.6a1) + SCTP Patch. Protocol Stacks & APIs. C. Java. XML. XML. SIP. SIP. PHP/ Apache. eXosip.
E N D
HTTP over SCTP How to build Apache over SCTP streams Original httpd-2.0.55 sources SCTP Patch How to build SCTP Firefox 3.0.11 Firefox (1.6a1) + SCTP Patch
Protocol Stacks & APIs C Java XML XML SIP SIP PHP/ Apache eXosip jSIP ZigBee APS SCTP SCTP ZigBee NWK IPv6 IPv6 802.15.4 802.3 802.3 3 End-Device In-Building Controller Server (ARM9)
Java • jSIP • http://jSIP.sourceforge.net/ • SCTP in Java • http://blogs.sun.com/chegar/entry/sctp_in_java • Using IPv6 in Java is easy … • http://download.oracle.com/javase/1.5.0/docs/guide/net/ipv6_guide/index.html#using
C • GNU oSIP Library • http://www.gnu.org/software/osip/ • eXosip2 - the eXtended osip Library • http://savannah.gnu.org/projects/exosip • http://www.antisip.com/doc/exosip2/index.html • SCTP – Stream Control Transmission Protocol • Native support after Linux kernel 2.6.35 • Linux Kernel SCTP • http://lksctp.sourceforge.net/ • OpenSS7 SCTP • http://www.openss7.org/sctp.html • IPv6 is natively supported in Socket API.
SIP Registration • Registration • Contact: (for future SIP message transmission) • Expires: • TTL (Time to live) • 0, un-register • Multiple UAs can register under the same username.
Subscriber Notifier a SUBSCRIBE b 200 OK Current stateinformation c NOTIFY d 200 OK Updated stateinformation e NOTIFY f 200 OK SIP Event Notification • Several SIP-based applications have been devised based on the concept of a user being informed of some event. • E.g., Presence • RFC 3265 has addressed the issue of event notification. • SUBSCRIBE and NOTIFY • The Event header
Arguments for the utility of SUBSCRIBE and NOTIFY “Why do we keep reinventing new specialized methods like PING and INCALL and PRESENCE and so on… all these functions can be handled by simple, reusable message primitives. “The proposed SUBSCRIBE and NOTIFY methods… could be used to support presence, messaging, state change detection, etc. Very powerful idea.” -Dean Willis, SIP WG Chair, Feb 1999 • Columbia University used SOAP (Simple Object Access Protocol) within the NOTIFY message body to automate fire alert process.
SUBSCRIBE sip:presentity@example.com SIP/2.0 Via: SIP/2.0/UDP host.example.com;branch=z9hG4bKnashds7 To: <sip:presentity@example.com> From: <sip:watcher@example.com>;tag=12341234 Call-ID: 12345678@host.example.com CSeq: 1 SUBSCRIBE Max-Forwards: 70 Expires: 3600 Event: presence Contact: sip:user@host.example.com Content-Length: 0
SIP/2.0 200 OK Via: SIP/2.0/UDP host.example.com;branch=z9hG4bKnashds7 ;received=192.0.2.1 To: <sip:presentity@example.com>;tag=abcd1234 From: <sip:watcher@example.com>;tag=12341234 Call-ID: 12345678@host.example.com CSeq: 1 SUBSCRIBE Contact: sip:pa.example.com Expires: 3600 Content-Length: 0
NOTIFY sip:user@host.example.com SIP/2.0 Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK8sdf2 To: <sip:watcher@example.com>;tag=12341234 From: <sip:presentity@example.com>;tag=abcd1234 Call-ID: 12345678@host.example.com CSeq: 1 NOTIFY Max-Forwards: 70 Event: presence Subscription-State: active; expires=3599 Contact: sip:pa.example.com Content-Type: application/pidf+xml Content-Length: ...
SIP/2.0 200 OK Via: SIP/2.0/UDP pa.example.com;branch=z9hG4bK8sdf2 ;received=192.0.2.2 To: <sip:watcher@example.com>;tag=12341234 From: <sip:presentity@example.com>;tag=abcd1234 Call-ID: 12345678@host.example.com CSeq: 1 NOTIFY
eXosip2 API for Event Notification • eXosip2 REGISTER and Registration Management • eXosip2 SUBSCRIBE and outgoing subscriptions • eXosip2 SUBSCRIBE and incoming subscriptions
eXosip_subscribe_build_initial_request() • int eXosip_subscribe_build_initial_request (osip_message_t ** subscribe, const char * to, const char * from, const char * route, const char * event, int expires ) • Parameters: • subscribe Pointer for the SIP request to build. • to SIP url for callee. • from SIP url for caller. • route Route header for SUBSCRIBE. (optional) • event Event header for SUBSCRIBE. • expires Expires header for SUBSCRIBE.
eXosip_insubscription_build_notify() • int eXosip_insubscription_build_notify (int did, int subscription_status, int subscription_reason, osip_message_t ** request ) • Parameters: • did • id of incoming subscription. • subscription_status • subscription status (pending, active, terminated) • subscription_reason • subscription reason • request • The SIP request to build.
jSIP API for Event Notification • SipRegister • SubscribeMessage • NotifyMessage
TODO • Linux kernel version of In-Building Controller • jSIP / SCTP / IPv6 • Sample code for SIP Event Notification