« Previous - Version 2/22 (diff) - Next » - Current version
Adrian Georgescu, 10/26/2008 11:16 am


sip_publish_presence

To use this script you must to have a valid [wiki:configuration_file configuration file].

=== Description ===

Source code: [source:scripts/sip_publish_presence.py scripts/sip_publish_presence.py]

{{{
adigeo@ag-imac3:~$sip_publish_presence -h
Usage: sip_publish_presence [options]

This script will publish rich presence state of the specified SIP account to a
SIP Presence Agent, the presence information can be changed using a menu-
driven interface.

Options:
-h, --help show this help message and exit
-a NAME, --account-name=NAME
The account name from which to read account settings.
Corresponds to section Account_NAME in the
configuration file. If not supplied, the section
Account will be read.
--sip-address=SIP_ADDRESS
SIP address of the user in the form user@domain
-e EXPIRES, --expires=EXPIRES
"Expires" value to set in PUBLISH. Default is 300
seconds.
-o IP[:PORT], --outbound-proxy=IP[:PORT]
Outbound SIP proxy to use. By default a lookup of the
domain is performed based on SRV and A records. This
overrides the setting from the config file.
-s, --trace-sip Dump the raw contents of incoming and outgoing SIP
messages (disabled by default).
-l, --log-pjsip Print PJSIP logging output (disabled by default).
}}}

=== Example ===

{{{
adigeo@ag-imac3:~$sip_publish_presence
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
Using default account:
Resolved DNS SRV record "_sip._udp.ag-projects.com" --> proxy.sipthor.net:5060
Resolved DNS A record "proxy.sipthor.net" --> 85.17.186.7, 81.23.228.150, 81.23.228.129

Commands:
a: set activities information
b: toggle basic status
m: set mood information
n: set note
q: quit program
s: show PIDF


  <tuple id="apgjjwtz">
    <status>
      <basic>open</basic>
    </status>
    <timestamp>2008-10-26T10:37:16+01:00</timestamp>
  </tuple>
  <dm:person id="yipgulqr">
    <rpid:time-offset>60</rpid:time-offset>
    <dm:timestamp>2008-10-26T10:37:16+01:00</dm:timestamp>
  </dm:person>
</presence>

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF

Commands:
  a: set activity
  c: clear all activity data
  d: delete activity
  n: set activity note
  q: quit program
  s: show current activity
  r: set random activity
  x: exit to upper level menu

Set note> I am working

Note set

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF

Commands:
  a: add a mood
  c: clear all mood data
  d: delete a mood
  n: set mood note
  q: quit program
  s: show current moods
  r: set random mood
  x: exit to upper level menu

You are now contended, sad, mean

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF

<?xml version='1.0' encoding='UTF-8'?>
<presence xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns="urn:ietf:params:xml:ns:pidf" entity="31208005169@ag-projects.com">
  <tuple id="apgjjwtz">
    <status>
      <basic>open</basic>
    </status>
    <timestamp>2008-10-26T10:37:16+01:00</timestamp>
  </tuple>
  <dm:person id="yipgulqr">
    <rpid:mood>
      <rpid:mean/>
      <rpid:contended/>
      <rpid:sad/>
    </rpid:mood>
    <rpid:activities>
      <rpid:note xml:lang="en">I am working</rpid:note>
    </rpid:activities>
    <rpid:time-offset>60</rpid:time-offset>
    <dm:timestamp>2008-10-26T10:37:32+01:00</dm:timestamp>
  </dm:person>
</presence>

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF

Your basic status is now 'closed'

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF

Your basic status is now 'open'

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF

<?xml version='1.0' encoding='UTF-8'?>
<presence xmlns:rpid="urn:ietf:params:xml:ns:pidf:rpid" xmlns:dm="urn:ietf:params:xml:ns:pidf:data-model" xmlns="urn:ietf:params:xml:ns:pidf" entity="31208005169@ag-projects.com">
  <tuple id="apgjjwtz">
    <status>
      <basic>open</basic>
    </status>
    <timestamp>2008-10-26T10:37:42+01:00</timestamp>
  </tuple>
  <dm:person id="yipgulqr">
    <rpid:mood>
      <rpid:mean/>
      <rpid:contended/>
      <rpid:sad/>
    </rpid:mood>
    <rpid:activities>
      <rpid:note xml:lang="en">I am working</rpid:note>
    </rpid:activities>
    <rpid:time-offset>60</rpid:time-offset>
    <dm:timestamp>2008-10-26T10:37:32+01:00</dm:timestamp>
  </dm:person>
</presence>

Commands:
  a: set activities information
  b: toggle basic status
  m: set mood information
  n: set note
  q: quit program
  s: show PIDF
}}}

{{fnlist}}

SIMPLE-Server.png (54 kB) Tijmen de Mes, 04/19/2012 09:23 pm