Sip publish presence

Version 2 (Adrian Georgescu, 10/26/2008 11:16 am)

1 1 Adrian Georgescu
== sip_publish_presence ==
2 1 Adrian Georgescu
3 1 Adrian Georgescu
To use this script you must to have a valid [wiki:configuration_file configuration file].
4 1 Adrian Georgescu
5 1 Adrian Georgescu
=== Description ===
6 1 Adrian Georgescu
7 2 Adrian Georgescu
Source code: [source:scripts/sip_publish_presence.py scripts/sip_publish_presence.py]
8 2 Adrian Georgescu
9 2 Adrian Georgescu
10 1 Adrian Georgescu
{{{
11 1 Adrian Georgescu
adigeo@ag-imac3:~$sip_publish_presence -h
12 1 Adrian Georgescu
Usage: sip_publish_presence [options]
13 1 Adrian Georgescu
14 1 Adrian Georgescu
This script will publish rich presence state of the specified SIP account to a
15 1 Adrian Georgescu
SIP Presence Agent, the presence information can be changed using a menu-
16 1 Adrian Georgescu
driven interface.
17 1 Adrian Georgescu
18 1 Adrian Georgescu
Options:
19 1 Adrian Georgescu
  -h, --help            show this help message and exit
20 1 Adrian Georgescu
  -a NAME, --account-name=NAME
21 1 Adrian Georgescu
                        The account name from which to read account settings.
22 1 Adrian Georgescu
                        Corresponds to section Account_NAME in the
23 1 Adrian Georgescu
                        configuration file. If not supplied, the section
24 1 Adrian Georgescu
                        Account will be read.
25 1 Adrian Georgescu
  --sip-address=SIP_ADDRESS
26 1 Adrian Georgescu
                        SIP address of the user in the form user@domain
27 1 Adrian Georgescu
  -e EXPIRES, --expires=EXPIRES
28 1 Adrian Georgescu
                        "Expires" value to set in PUBLISH. Default is 300
29 1 Adrian Georgescu
                        seconds.
30 1 Adrian Georgescu
  -o IP[:PORT], --outbound-proxy=IP[:PORT]
31 1 Adrian Georgescu
                        Outbound SIP proxy to use. By default a lookup of the
32 1 Adrian Georgescu
                        domain is performed based on SRV and A records. This
33 1 Adrian Georgescu
                        overrides the setting from the config file.
34 1 Adrian Georgescu
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
35 1 Adrian Georgescu
                        messages (disabled by default).
36 1 Adrian Georgescu
  -l, --log-pjsip       Print PJSIP logging output (disabled by default).
37 1 Adrian Georgescu
}}}
38 1 Adrian Georgescu
39 1 Adrian Georgescu
=== Example ===
40 1 Adrian Georgescu
41 1 Adrian Georgescu
{{{
42 1 Adrian Georgescu
adigeo@ag-imac3:~$sip_publish_presence 
43 1 Adrian Georgescu
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
44 1 Adrian Georgescu
Using default account: 31208005169@ag-projects.com
45 1 Adrian Georgescu
Resolved DNS SRV record "_sip._udp.ag-projects.com" --> proxy.sipthor.net:5060
46 1 Adrian Georgescu
Resolved DNS A record "proxy.sipthor.net" --> 85.17.186.7, 81.23.228.150, 81.23.228.129
47 1 Adrian Georgescu
48 1 Adrian Georgescu
Commands:
49 1 Adrian Georgescu
  a: set activities information
50 1 Adrian Georgescu
  b: toggle basic status
51 1 Adrian Georgescu
  m: set mood information
52 1 Adrian Georgescu
  n: set note
53 1 Adrian Georgescu
  q: quit program
54 1 Adrian Georgescu
  s: show PIDF
55 1 Adrian Georgescu
56 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
57 1 Adrian Georgescu
<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">
58 1 Adrian Georgescu
  <tuple id="apgjjwtz">
59 1 Adrian Georgescu
    <status>
60 1 Adrian Georgescu
      <basic>open</basic>
61 1 Adrian Georgescu
    </status>
62 1 Adrian Georgescu
    <timestamp>2008-10-26T10:37:16+01:00</timestamp>
63 1 Adrian Georgescu
  </tuple>
64 1 Adrian Georgescu
  <dm:person id="yipgulqr">
65 1 Adrian Georgescu
    <rpid:time-offset>60</rpid:time-offset>
66 1 Adrian Georgescu
    <dm:timestamp>2008-10-26T10:37:16+01:00</dm:timestamp>
67 1 Adrian Georgescu
  </dm:person>
68 1 Adrian Georgescu
</presence>
69 1 Adrian Georgescu
70 1 Adrian Georgescu
Commands:
71 1 Adrian Georgescu
  a: set activities information
72 1 Adrian Georgescu
  b: toggle basic status
73 1 Adrian Georgescu
  m: set mood information
74 1 Adrian Georgescu
  n: set note
75 1 Adrian Georgescu
  q: quit program
76 1 Adrian Georgescu
  s: show PIDF
77 1 Adrian Georgescu
78 1 Adrian Georgescu
Commands:
79 1 Adrian Georgescu
  a: set activity
80 1 Adrian Georgescu
  c: clear all activity data
81 1 Adrian Georgescu
  d: delete activity
82 1 Adrian Georgescu
  n: set activity note
83 1 Adrian Georgescu
  q: quit program
84 1 Adrian Georgescu
  s: show current activity
85 1 Adrian Georgescu
  r: set random activity
86 1 Adrian Georgescu
  x: exit to upper level menu
87 1 Adrian Georgescu
88 1 Adrian Georgescu
Set note> I am working
89 1 Adrian Georgescu
90 1 Adrian Georgescu
Note set
91 1 Adrian Georgescu
92 1 Adrian Georgescu
Commands:
93 1 Adrian Georgescu
  a: set activities information
94 1 Adrian Georgescu
  b: toggle basic status
95 1 Adrian Georgescu
  m: set mood information
96 1 Adrian Georgescu
  n: set note
97 1 Adrian Georgescu
  q: quit program
98 1 Adrian Georgescu
  s: show PIDF
99 1 Adrian Georgescu
100 1 Adrian Georgescu
101 1 Adrian Georgescu
Commands:
102 1 Adrian Georgescu
  a: add a mood
103 1 Adrian Georgescu
  c: clear all mood data
104 1 Adrian Georgescu
  d: delete a mood
105 1 Adrian Georgescu
  n: set mood note
106 1 Adrian Georgescu
  q: quit program
107 1 Adrian Georgescu
  s: show current moods
108 1 Adrian Georgescu
  r: set random mood
109 1 Adrian Georgescu
  x: exit to upper level menu
110 1 Adrian Georgescu
111 1 Adrian Georgescu
You are now contended, sad, mean
112 1 Adrian Georgescu
113 1 Adrian Georgescu
Commands:
114 1 Adrian Georgescu
  a: set activities information
115 1 Adrian Georgescu
  b: toggle basic status
116 1 Adrian Georgescu
  m: set mood information
117 1 Adrian Georgescu
  n: set note
118 1 Adrian Georgescu
  q: quit program
119 1 Adrian Georgescu
  s: show PIDF
120 1 Adrian Georgescu
121 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
122 1 Adrian Georgescu
<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">
123 1 Adrian Georgescu
  <tuple id="apgjjwtz">
124 1 Adrian Georgescu
    <status>
125 1 Adrian Georgescu
      <basic>open</basic>
126 1 Adrian Georgescu
    </status>
127 1 Adrian Georgescu
    <timestamp>2008-10-26T10:37:16+01:00</timestamp>
128 1 Adrian Georgescu
  </tuple>
129 1 Adrian Georgescu
  <dm:person id="yipgulqr">
130 1 Adrian Georgescu
    <rpid:mood>
131 1 Adrian Georgescu
      <rpid:mean/>
132 1 Adrian Georgescu
      <rpid:contended/>
133 1 Adrian Georgescu
      <rpid:sad/>
134 1 Adrian Georgescu
    </rpid:mood>
135 1 Adrian Georgescu
    <rpid:activities>
136 1 Adrian Georgescu
      <rpid:note xml:lang="en">I am working</rpid:note>
137 1 Adrian Georgescu
    </rpid:activities>
138 1 Adrian Georgescu
    <rpid:time-offset>60</rpid:time-offset>
139 1 Adrian Georgescu
    <dm:timestamp>2008-10-26T10:37:32+01:00</dm:timestamp>
140 1 Adrian Georgescu
  </dm:person>
141 1 Adrian Georgescu
</presence>
142 1 Adrian Georgescu
143 1 Adrian Georgescu
Commands:
144 1 Adrian Georgescu
  a: set activities information
145 1 Adrian Georgescu
  b: toggle basic status
146 1 Adrian Georgescu
  m: set mood information
147 1 Adrian Georgescu
  n: set note
148 1 Adrian Georgescu
  q: quit program
149 1 Adrian Georgescu
  s: show PIDF
150 1 Adrian Georgescu
151 1 Adrian Georgescu
Your basic status is now 'closed'
152 1 Adrian Georgescu
153 1 Adrian Georgescu
Commands:
154 1 Adrian Georgescu
  a: set activities information
155 1 Adrian Georgescu
  b: toggle basic status
156 1 Adrian Georgescu
  m: set mood information
157 1 Adrian Georgescu
  n: set note
158 1 Adrian Georgescu
  q: quit program
159 1 Adrian Georgescu
  s: show PIDF
160 1 Adrian Georgescu
161 1 Adrian Georgescu
Your basic status is now 'open'
162 1 Adrian Georgescu
163 1 Adrian Georgescu
Commands:
164 1 Adrian Georgescu
  a: set activities information
165 1 Adrian Georgescu
  b: toggle basic status
166 1 Adrian Georgescu
  m: set mood information
167 1 Adrian Georgescu
  n: set note
168 1 Adrian Georgescu
  q: quit program
169 1 Adrian Georgescu
  s: show PIDF
170 1 Adrian Georgescu
171 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
172 1 Adrian Georgescu
<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">
173 1 Adrian Georgescu
  <tuple id="apgjjwtz">
174 1 Adrian Georgescu
    <status>
175 1 Adrian Georgescu
      <basic>open</basic>
176 1 Adrian Georgescu
    </status>
177 1 Adrian Georgescu
    <timestamp>2008-10-26T10:37:42+01:00</timestamp>
178 1 Adrian Georgescu
  </tuple>
179 1 Adrian Georgescu
  <dm:person id="yipgulqr">
180 1 Adrian Georgescu
    <rpid:mood>
181 1 Adrian Georgescu
      <rpid:mean/>
182 1 Adrian Georgescu
      <rpid:contended/>
183 1 Adrian Georgescu
      <rpid:sad/>
184 1 Adrian Georgescu
    </rpid:mood>
185 1 Adrian Georgescu
    <rpid:activities>
186 1 Adrian Georgescu
      <rpid:note xml:lang="en">I am working</rpid:note>
187 1 Adrian Georgescu
    </rpid:activities>
188 1 Adrian Georgescu
    <rpid:time-offset>60</rpid:time-offset>
189 1 Adrian Georgescu
    <dm:timestamp>2008-10-26T10:37:32+01:00</dm:timestamp>
190 1 Adrian Georgescu
  </dm:person>
191 1 Adrian Georgescu
</presence>
192 1 Adrian Georgescu
193 1 Adrian Georgescu
Commands:
194 1 Adrian Georgescu
  a: set activities information
195 1 Adrian Georgescu
  b: toggle basic status
196 1 Adrian Georgescu
  m: set mood information
197 1 Adrian Georgescu
  n: set note
198 1 Adrian Georgescu
  q: quit program
199 1 Adrian Georgescu
  s: show PIDF
200 1 Adrian Georgescu
}}}