Resources.PresenceModule History

Hide minor edits - Show changes to markup

April 24, 2013, at 07:12 PM by 109.99.235.212 -
Changed lines 1-88 from:

Resources -> Documentation -> Presence -> Presence Server -> Presence Module - Parameters and Functions

  1. Exported Functions
  2. Exported Parameters
  3. Developer's Guide
  4. Module Readme

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 takes one optional parameter - the URI of the sender, used by the BLA feature( event dialog;sla ).

Actions:

  • verifies if the PUBLISH message is correct:
    • check its structure - calls an event specific function defined in a presence_ev module (presence_xml or presence_mwi);
    • if it has a SIP-if-Match header, checks is there is a previous record 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 a sequential one
    • updates the expires value
    • generates a new E-Tag and sends it in the Sip-Etag header of the 200OK reply
  • 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 dialog information in and calls functions to send Notify messages to teh watcher and to the presentity (if a subscription for event presence.winfo exists for the presentity and the event)
  • it does not take any parameter.

Actions

  • checks if the SUBSCRIBE message is correct:
    • check its structure;
    • if inside a dialog tries to match the dialogs with the records stored
  • if the conditions are not complied with it sends an adequate error message
  • if a correct message sends 2XX reply
    • the reply contains an Expires header
    • for SUBSCRIBE messages for event "presence.winfo" the status of the reply is 202OK and for all the other 200OK
  • if a new SUBSCRIBE, saves the dialog information in cache
  • if a Subscribe inside a dialog
    • if the Expires header field value is 0
      • deletes the registration from cache and database
      • if event is a PUBLISH event - sends a Notify for winfo to the presentity with full state
    • if update
      • updates the expires value
      • sends Notifies
  • if a SUBSCRIBE for a PUBLISH event( 'presence', 'dialog.sla', 'message-summary'):
    • sends Notify with presence.winfo to the presentity(if a winfo subscription from the presentity exists) with a partial state informing only about the subscription status of the new watcher
    • sends Notify with the presence information
  • if a SUBSCRIBE for a winfo(watcher info) event
    • sends Notify with presence.winfo to the subscriber with full state informing about all the watchers

Exported Paramters

  • db_url : database url
  • presentity_table: the name of the database table used for storing published info
  • active_watchers_table: the name of the database table used for storing Subscribe dialog info
  • watchers_table: the name of the database table used for storing subscription status for watchers
  • clean_period : time period for cleaning expired PUBLISH or SUBSCRIBE messages from database
  • to_tag_pref : prefix used when generating to_tag when sending replies for SUBSCRIBE requests
  • expires_offset' : the value that should be substracted from the expires value when sending a 200OK for a publish or subscribe to force the client cu send an update before the old request expires
  • max_expires : reduce validity of PUBLISH/SUBSCRIBE to this value if the Expires in request is greater.
  • server_address': presence server address to be included in Contact header field for Subscribe and Publish replies and in Notify messages.
  • fallback2db: parameter which enables a fallback to db mode of operation. In this mode, in case a searched record is not found in cache, the search is continued in database. Useful for an architecture in which processing and memory load might be divided on more machines using the same database.
  • subs_htable_size: the size of the hash table storing subscription dialogs(used as the power of 2 when computing table size)
  • pres_htable_size: the size of the hash table storing published info (used as the power of 2 when computing table size)
  • enable_sphere_check: a flag that should be set if privacy rules include sphere checking. The sphere information is expected to be present in the RPID body published by the presentity. The flag is introduced as this check requires extra processing that should be avoided if this feature is not supported by the clients.

Developer's Guide

Module Readme

You can read the module's documentation here .

to:

(:redirect Documentation.Tutorials-Presence-PresenceModule quiet=1:)

July 21, 2008, at 07:43 PM by 81.180.102.217 -
Added line 5:
Added lines 83-85:

Developer's Guide

Changed line 88 from:

You can read the module's documentation here .

to:

You can read the module's documentation here .

July 21, 2008, at 07:39 PM by 81.180.102.217 -
Changed lines 68-81 from:
  • db_url : database url
  • presentity_table: the name of the database table used for storing published info
  • active_watchers_table: the name of the database table used for storing Subscribe dialog info
  • watchers_table: the name of the database table used for storing subscription status for watchers
  • clean_period : time period for cleaning expired PUBLISH or SUBSCRIBE messages from database
  • to_tag_pref : prefix used when generating to_tag when sending replies for SUBSCRIBE requests
  • expires_offset : the value that should be substracted from the expires value when sending a 200OK for a publish or subscribe to force the client cu send an update before the old request expires
  • max_expires : reduce validity of PUBLISH/SUBSCRIBE to this value if the Expires in request is greater.
  • server_address: presence server address to be included in Contact header field for Subscribe and Publish replies and in Notify messages.
  • fallback2db: parameter which enables a fallback to db mode of operation. In this mode, in case a searched record is not found in cache, the search is continued in database. Useful for an architecture in which processing and memory load might be divided on more machines using the same database.
  • subs_htable_size: the size of the hash table storing subscription dialogs(used as the power of 2 when computing table size)
  • pres_htable_size: the size of the hash table storing published info (used as the power of 2 when computing table size)
  • enable_sphere_check: a flag that should be set if privacy rules include sphere checking. The sphere information is expected to be present in the RPID body published by the presentity. The flag is introduced as this check requires extra processing that should be avoided if this feature is not supported by the clients.
to:
  • db_url : database url
  • presentity_table: the name of the database table used for storing published info
  • active_watchers_table: the name of the database table used for storing Subscribe dialog info
  • watchers_table: the name of the database table used for storing subscription status for watchers
  • clean_period : time period for cleaning expired PUBLISH or SUBSCRIBE messages from database
  • to_tag_pref : prefix used when generating to_tag when sending replies for SUBSCRIBE requests
  • expires_offset' : the value that should be substracted from the expires value when sending a 200OK for a publish or subscribe to force the client cu send an update before the old request expires
  • max_expires : reduce validity of PUBLISH/SUBSCRIBE to this value if the Expires in request is greater.
  • server_address': presence server address to be included in Contact header field for Subscribe and Publish replies and in Notify messages.
  • fallback2db: parameter which enables a fallback to db mode of operation. In this mode, in case a searched record is not found in cache, the search is continued in database. Useful for an architecture in which processing and memory load might be divided on more machines using the same database.
  • subs_htable_size: the size of the hash table storing subscription dialogs(used as the power of 2 when computing table size)
  • pres_htable_size: the size of the hash table storing published info (used as the power of 2 when computing table size)
  • enable_sphere_check: a flag that should be set if privacy rules include sphere checking. The sphere information is expected to be present in the RPID body published by the presentity. The flag is introduced as this check requires extra processing that should be avoided if this feature is not supported by the clients.
July 21, 2008, at 07:37 PM by 81.180.102.217 -
Changed lines 69-81 from:
  • presentity_table: the name of the database table used for storing published info
  • active_watchers_table: the name of the database table used for storing Subscribe dialog info
  • watchers_table: the name of the database table used for storing subscription status for watchers
  • clean_period : time period for cleaning expired PUBLISH or SUBSCRIBE messages from database
  • to_tag_pref : prefix used when generating to_tag when sending replies for SUBSCRIBE requests
  • expires_offset : the value that should be substracted from the expires value when sending a 200OK for a publish or subscribe to force the client cu send an update before the old request expires
  • max_expires : reduce validity of PUBLISH/SUBSCRIBE to this value if the Expires in request is greater.
  • server_address: presence server address to be included in Contact header field for Subscribe and Publish replies and in Notify messages.
  • fallback2db: parameter which enables a fallback to db mode of operation. In this mode, in case a searched record is not found in cache, the search is continued in database. Useful for an architecture in which processing and memory load might be divided on more machines using the same database.
  • subs_htable_size: the size of the hash table storing subscription dialogs(used as the power of 2 when computing table size)
  • pres_htable_size: the size of the hash table storing published info (used as the power of 2 when computing table size)
  • enable_sphere_check: a flag that should be set if privacy rules include sphere checking. The sphere information is expected to be present in the RPID body published by the presentity. The flag is introduced as this check requires extra processing that should be avoided if this feature is not supported by the clients.
to:
  • presentity_table: the name of the database table used for storing published info
  • active_watchers_table: the name of the database table used for storing Subscribe dialog info
  • watchers_table: the name of the database table used for storing subscription status for watchers
  • clean_period : time period for cleaning expired PUBLISH or SUBSCRIBE messages from database
  • to_tag_pref : prefix used when generating to_tag when sending replies for SUBSCRIBE requests
  • expires_offset : the value that should be substracted from the expires value when sending a 200OK for a publish or subscribe to force the client cu send an update before the old request expires
  • max_expires : reduce validity of PUBLISH/SUBSCRIBE to this value if the Expires in request is greater.
  • server_address: presence server address to be included in Contact header field for Subscribe and Publish replies and in Notify messages.
  • fallback2db: parameter which enables a fallback to db mode of operation. In this mode, in case a searched record is not found in cache, the search is continued in database. Useful for an architecture in which processing and memory load might be divided on more machines using the same database.
  • subs_htable_size: the size of the hash table storing subscription dialogs(used as the power of 2 when computing table size)
  • pres_htable_size: the size of the hash table storing published info (used as the power of 2 when computing table size)
  • enable_sphere_check: a flag that should be set if privacy rules include sphere checking. The sphere information is expected to be present in the RPID body published by the presentity. The flag is introduced as this check requires extra processing that should be avoided if this feature is not supported by the clients.
July 21, 2008, at 07:36 PM by 81.180.102.217 -
Changed line 68 from:
  • db_url : database url
to:
  • db_url : database url
July 21, 2008, at 06:47 PM by 81.180.102.217 -
Changed lines 4-6 from:
to:
July 21, 2008, at 06:47 PM by 81.180.102.217 -
Changed line 3 from:
to:
Added line 7:

Added line 66:

Changed lines 82-83 from:

Module Documentation

to:

Module Readme

July 21, 2008, at 06:45 PM by 81.180.102.217 -
Added lines 67-69:
  • presentity_table: the name of the database table used for storing published info
  • active_watchers_table: the name of the database table used for storing Subscribe dialog info
  • watchers_table: the name of the database table used for storing subscription status for watchers
Changed line 72 from:
  • expires_offset : the value that should be substracted from the expires value when sending a 200OK for a publish to force the client cu send an update before the old publish expires
to:
  • expires_offset : the value that should be substracted from the expires value when sending a 200OK for a publish or subscribe to force the client cu send an update before the old request expires
Changed lines 75-79 from:
to:
  • fallback2db: parameter which enables a fallback to db mode of operation. In this mode, in case a searched record is not found in cache, the search is continued in database. Useful for an architecture in which processing and memory load might be divided on more machines using the same database.
  • subs_htable_size: the size of the hash table storing subscription dialogs(used as the power of 2 when computing table size)
  • pres_htable_size: the size of the hash table storing published info (used as the power of 2 when computing table size)
  • enable_sphere_check: a flag that should be set if privacy rules include sphere checking. The sphere information is expected to be present in the RPID body published by the presentity. The flag is introduced as this check requires extra processing that should be avoided if this feature is not supported by the clients.
July 21, 2008, at 06:24 PM by 81.180.102.217 -
Added lines 3-6:
Changed lines 65-74 from:
to:

Exported Paramters

  • db_url : database url
  • clean_period : time period for cleaning expired PUBLISH or SUBSCRIBE messages from database
  • to_tag_pref : prefix used when generating to_tag when sending replies for SUBSCRIBE requests
  • expires_offset : the value that should be substracted from the expires value when sending a 200OK for a publish to force the client cu send an update before the old publish expires
  • max_expires : reduce validity of PUBLISH/SUBSCRIBE to this value if the Expires in request is greater.
  • server_address: presence server address to be included in Contact header field for Subscribe and Publish replies and in Notify messages.

Module Documentation

You can read the module's documentation here .

July 21, 2008, at 06:15 PM by 81.180.102.217 -
Changed lines 46-60 from:
  • for SUBSCRIBE messages for event "presence.winfo" the sta 202OK for Subscribe for "presence"; they both contain a Expires header field
                - if a new SUBSCRIBE: 
                           -it inserts a new row in database
                           -if SUBSCRIBE for "presence": 
                                  -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 "presence.winfo"
                                   -calls a function to send Notify with presence.winfo to the subscriber with full state informing only about all the watchers
                - if a Subscribe inside a dialog
                          -if the Expires header field value is 0 
                                    -deletes the registration fron database
                                    -if event is "presence" calls a function which sends Notify with presence.winfo to the presentity with full state
                          -if update, it updates the stored expires value
to:
  • for SUBSCRIBE messages for event "presence.winfo" the status of the reply is 202OK and for all the other 200OK
  • if a new SUBSCRIBE, saves the dialog information in cache
  • if a Subscribe inside a dialog
    • if the Expires header field value is 0
      • deletes the registration from cache and database
      • if event is a PUBLISH event - sends a Notify for winfo to the presentity with full state
    • if update
      • updates the expires value
      • sends Notifies
  • if a SUBSCRIBE for a PUBLISH event( 'presence', 'dialog.sla', 'message-summary'):
    • sends Notify with presence.winfo to the presentity(if a winfo subscription from the presentity exists) with a partial state informing only about the subscription status of the new watcher
    • sends Notify with the presence information
  • if a SUBSCRIBE for a winfo(watcher info) event
    • sends Notify with presence.winfo to the subscriber with full state informing about all the watchers
July 21, 2008, at 05:56 PM by 81.180.102.217 -
Changed lines 31-61 from:
  • calls a function which sends Notify with presence to all watchers
to:
  • calls a function which sends Notify with presence to all watchers

handle_subscribe()

  • function which handles SUBSCRIBE requests. It stores or updates dialog information in and calls functions to send Notify messages to teh watcher and to the presentity (if a subscription for event presence.winfo exists for the presentity and the event)
  • it does not take any parameter.

Actions

  • checks if the SUBSCRIBE message is correct:
    • check its structure;
    • if inside a dialog tries to match the dialogs with the records stored
  • if the conditions are not complied with it sends an adequate error message
  • if a correct message sends 2XX reply
    • the reply contains an Expires header
    • for SUBSCRIBE messages for event "presence.winfo" the sta 202OK for Subscribe for "presence"; they both contain a Expires header field
                - if a new SUBSCRIBE: 
                           -it inserts a new row in database
                           -if SUBSCRIBE for "presence": 
                                  -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 "presence.winfo"
                                   -calls a function to send Notify with presence.winfo to the subscriber with full state informing only about all the watchers
                - if a Subscribe inside a dialog
                          -if the Expires header field value is 0 
                                    -deletes the registration fron database
                                    -if event is "presence" calls a function which sends Notify with presence.winfo to the presentity with full state
                          -if update, it updates the stored expires value
July 21, 2008, at 05:36 PM by 81.180.102.217 -
Changed lines 10-11 from:
  • 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.
to:
  • 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 takes one optional parameter - the URI of the sender, used by the BLA feature( event dialog;sla ).
July 21, 2008, at 05:33 PM by 81.180.102.217 -
Changed lines 13-14 from:

'''Actions:

to:

Actions:

July 21, 2008, at 05:33 PM by 81.180.102.217 -
Changed lines 8-9 from:

'''handle_publish()

to:

handle_publish()

Changed lines 13-14 from:

Actions:

to:

'''Actions:

July 21, 2008, at 05:32 PM by 81.180.102.217 -
Changed lines 16-17 from:
  • check its structure;
  • if it has a SIP-if-Match header, checks is there is a previous storage for the same presentity;
to:
  • check its structure - calls an event specific function defined in a presence_ev module (presence_xml or presence_mwi);
  • if it has a SIP-if-Match header, checks is there is a previous record for the same presentity;
July 21, 2008, at 05:30 PM by 81.180.102.217 -
Changed lines 1-4 from:

Resources -> Documentation -> Presence -> Presence Server -> Presence Module

Presence Module - Parameters and Functions

to:

Resources -> Documentation -> Presence -> Presence Server -> Presence Module - Parameters and Functions

Changed lines 15-31 from:
  • 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 a sequential one
    • updates the expires value
    • generates a new E-Tag and sends it in the Sip-Etag header of the 200OK reply
  • if body present
    • updates body (replace with the new one)
    • calls a function which sends Notify with presence to all watchers
to:
  • 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 a sequential one
    • updates the expires value
    • generates a new E-Tag and sends it in the Sip-Etag header of the 200OK reply
  • if body present
    • updates body (replace with the new one)
    • calls a function which sends Notify with presence to all watchers
July 21, 2008, at 05:27 PM by 81.180.102.217 -
Changed lines 8-34 from:
  • handle_subscribe()
to:
  • 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 a sequential one
    • updates the expires value
    • generates a new E-Tag and sends it in the Sip-Etag header of the 200OK reply
  • if body present
    • updates body (replace with the new one)
    • calls a function which sends Notify with presence to all watchers
July 21, 2008, at 05:21 PM by 81.180.102.217 -
Changed lines 7-8 from:
  * handle_publish()
  * handle_subscribe()
to:
  • handle_publish()
  • handle_subscribe()
July 21, 2008, at 05:21 PM by 81.180.102.217 -
Changed lines 7-8 from:
  '''* handle_publish()
  '''*handle_subscribe()
to:
  * handle_publish()
  * handle_subscribe()
July 21, 2008, at 05:21 PM by 81.180.102.217 -
Changed lines 7-8 from:
  * '''handle_publish()
  * '''handle_subscribe()
to:
  '''* handle_publish()
  '''*handle_subscribe()
July 21, 2008, at 05:20 PM by 81.180.102.217 -
Changed lines 3-8 from:

Presence Module - Parameters and Functions

to:

Presence Module - Parameters and Functions

Exported Functions

  * '''handle_publish()
  * '''handle_subscribe()
July 21, 2008, at 05:19 PM by 81.180.102.217 -
Added lines 1-3:

Resources -> Documentation -> Presence -> Presence Server -> Presence Module

Presence Module - Parameters and Functions


Page last modified on April 24, 2013, at 07:12 PM