Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
presence:module-exports [2011/09/07 14:25] – 92.112.156.8 | presence:module-exports [2012/03/22 12:38] (current) – removed spam 80.250.1.245 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Presence Module - Parameters and Functions ====== | ||
+ | |||
+ | |||
+ | ===== Exported Functions ===== | ||
+ | |||
+ | * **handle_publish()** | ||
+ | * **handle_subscribe()** | ||
+ | |||
+ | |||
+ | |||
+ | ==== handle_publish() ==== | ||
+ | |||
+ | * function which handles PUBLISH requests. It stores and updates presence information in database and calls functions to send NOTIFY messages when changes in presence information occur; | ||
+ | * it does not take any parameter. | ||
+ | |||
+ | __ Actions: | ||
+ | |||
+ | - verifies if the PUBLISH message is correct: | ||
+ | - check its structure; | ||
+ | - if it has a SIP-if-Match header, checks is there is a previous storage for the same presentity; | ||
+ | - if not present checks if a body is present | ||
+ | - if the conditions are not complied with it sends an adequate error message | ||
+ | - if a correct message: | ||
+ | - sends a 200Ok message with 2 extra header fields : Expires and SIP-if-Match | ||
+ | - if a new PUBLISH without a Sip-if-Match header field | ||
+ | - it generates one | ||
+ | - inserts a new row in database | ||
+ | - calls a function which sends Notify with presence to all the watchers which have subscribed to the presentity | ||
+ | - if the PUBLISH message is inside a dialog | ||
+ | - updates the expires value | ||
+ | - if body present | ||
+ | - updates body (replace with the new one) | ||
+ | - calls a function which sends Notify with presence to all watchers | ||
+ | | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== handle_subscribe() ==== | ||
+ | |||
+ | |||
+ | * function which handles SUBSCRIBE requests. It stores or updates information in database and calls functions to send Notify messages when a Subscribe which initiate a dialog is received | ||
+ | * it does not take any parameter. | ||
+ | |||
+ | __Actions__ | ||
+ | | ||
+ | - check its structure; | ||
+ | - if inside a dialog checks is a record of that dialog is present | ||
+ | -if the conditions are not complied with it sends an adequate error message | ||
+ | -if a correct message | ||
+ | - sends 200OK for SUBSCRIBE messages for event " | ||
+ | - if a new SUBSCRIBE: | ||
+ | -it inserts a new row in database | ||
+ | -if SUBSCRIBE for " | ||
+ | -calls a function to send Notify with presence.winfo to the presentity with a partial state informing only about the subscription status of the new watcher | ||
+ | -calls a function to send Notify with the presence information of the person he has subscribed to | ||
+ | | ||
+ | -if SUBSCRIBE for " | ||
+ | | ||
+ | - if a Subscribe inside a dialog | ||
+ | -if the Expires header field value is 0 | ||
+ | -deletes the registration from the database | ||
+ | -if event is " | ||
+ | -if update, it updates the stored expires value | ||
+ | |||
+ | |||
+ | ===== Exported parameters ===== | ||
+ | |||
+ | |||
+ | * [b]db_url[/ | ||
+ | * [b]clean_period[/ | ||
+ | * [b]to_tag_pref[/ | ||
+ | * [b]totag_avpid[/ | ||
+ | * [b]lock_set_size[/ | ||
+ | * [b]expires_offset[/ | ||
+ | * [b]force_active[/ | ||
+ | * [b]max_expires[/ | ||
+ | * [b]server_address[/ | ||
+ | |||
+ | ===== Presence-Related Stuff ===== | ||
+ | |||
+ | {{indexmenu> | ||