Module active_subscriber

SUBSCRIBE to some event package from a presenter, and store any data we receive in NOTIFYs as event data.

Introduced in: 10 May 2006 by Fredrik Thulin <ft@it.su.se>

Behaviours: gen_server.

Authors: Fredrik Thulin (ft@it.su.se).

Description

SUBSCRIBE to some event package from a presenter, and store any data we receive in NOTIFYs as event data. This is for use with event packages where the UAs don't use PUBLISH, and possibly for user agents that are edge presence servers and don't PUBLISH their state.

How this works :

active_subscriber sends out a SUBSCRIBE. This subscribe might result in zero or more subscriptions.

One of the established subscriptions will, according to the specs (RFC3265), be established by a 2xx response to the SUBSCRIBE, and the rest (if the SUBSCRIBE forked) will be established by the NOTIFY requests sent from the other endpoints towards the Contact: we placed in the SUBSCRIBE.

To make the dialog establishing code a bit more uniform, we don't set up a full dialog on the 2xx response to SUBSCRIBE, but instead set up one full dialog for every NOTIFY we receive. These dialogs are handled by one active_subscription process started for each dialog.

Finally, after at least 32 seconds has passed since we received the 2xx response to SUBSCRIBE, we unregister the half dialog the active_subscriber process had, and just hang around until all active_subscription processes has terminated. The reason to hang around is to enable whoever started us in the first place to call our stop/1 function. When stop/1 is called we tell all the active_subscription processes to stop.

NOTE : This module isn't used by the event server for now, it was just usable during development, possibly usable as an example and possibly also needed for some future event package.

Data Types

state()

state() = #state{}

no description

Function Index

shared_line/4 Initiates a shared line (bridged line appearance).
start/14 Starts the active_subscriber gen_server.
stop/1 Shuts down an active subscription.

Function Details

shared_line/4

shared_line(Resource, SIPuser, URI, Params) -> term()

returns: return value of start()

Initiates a shared line (bridged line appearance).

start/14

start(PackageM, PackageS, Presenter, RequestURI, From, To, Dst, SInterval, Accept, ExtraH, EventSuffix, LogTag, Parent, Presentity) -> Pid

Starts the active_subscriber gen_server.

stop/1

stop(Pid) -> ok | {error, already_stopped}

Shuts down an active subscription.


Generated by EDoc, Oct 17 2007, 16:48:11.