Sip publish presence

Version 21 (Adrian Georgescu, 01/24/2010 03:43 pm)

1 1 Adrian Georgescu
2 21 Adrian Georgescu
h2. sip-publish-presence
3 1 Adrian Georgescu
4 1 Adrian Georgescu
5 21 Adrian Georgescu
6 21 Adrian Georgescu
7 21 Adrian Georgescu
8 21 Adrian Georgescu
h3. Description
9 21 Adrian Georgescu
10 21 Adrian Georgescu
11 1 Adrian Georgescu
This script implements SIP PUBLISH method, for publishing event state.  PUBLISH is similar to REGISTER in that it allows a user to create, modify, and remove state in another entity which manages this state on behalf of the user.  Addressing a PUBLISH request is identical to addressing a SUBSCRIBE request.  The Request-URI of a PUBLISH request is populated with the address of the resource for which the user wishes to publish event state.  The user may in turn have multiple User Agents or endpoints that publish event state. Each endpoint may publish its own unique state, out of which the event state compositor generates the composite event state of the resource.  In addition to a particular resource, all published event state is associated with a specific event package.  Through a subscription to that event package, the user is able to discover the composite event state of all of the active publications.
12 16 Adrian Georgescu
13 21 Adrian Georgescu
> This script is available in _sipclients_ package that must be installed separately from SIP SIMPLe client SDK package.
14 18 Adrian Georgescu
15 21 Adrian Georgescu
!{}http://www.openxcap.org/chrome/site/SIMPLE-Server.png!
16 2 Adrian Georgescu
17 21 Adrian Georgescu
<pre>
18 18 Adrian Georgescu
adigeo@ag-imac3:~$sip-publish-presence -h  
19 18 Adrian Georgescu
Usage: sip-publish-presence [options]
20 1 Adrian Georgescu
21 1 Adrian Georgescu
This script will publish rich presence state of the specified SIP account to a
22 1 Adrian Georgescu
SIP Presence Agent, the presence information can be changed using a menu-
23 1 Adrian Georgescu
driven interface.
24 15 Adrian Georgescu
25 1 Adrian Georgescu
Options:
26 1 Adrian Georgescu
  -h, --help            show this help message and exit
27 1 Adrian Georgescu
  -a ACCOUNT_NAME, --account-name=ACCOUNT_NAME
28 1 Adrian Georgescu
                        The name of the account to use.
29 1 Adrian Georgescu
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
30 15 Adrian Georgescu
                        messages (disabled by default).
31 1 Adrian Georgescu
  -j, --trace-pjsip     Print PJSIP logging output (disabled by default).
32 21 Adrian Georgescu
</pre>
33 15 Adrian Georgescu
34 1 Adrian Georgescu
35 21 Adrian Georgescu
h3. Example
36 21 Adrian Georgescu
37 21 Adrian Georgescu
38 21 Adrian Georgescu
<pre>
39 18 Adrian Georgescu
adigeo@ag-imac3:~$sip-publish-presence 
40 1 Adrian Georgescu
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
41 1 Adrian Georgescu
Using default account: 31208005169@ag-projects.com
42 1 Adrian Georgescu
Resolved DNS SRV record "_sip._udp.ag-projects.com" --> proxy.sipthor.net:5060
43 1 Adrian Georgescu
Resolved DNS A record "proxy.sipthor.net" --> 85.17.186.7, 81.23.228.150, 81.23.228.129
44 1 Adrian Georgescu
45 1 Adrian Georgescu
Commands:
46 1 Adrian Georgescu
  a: set activities information
47 1 Adrian Georgescu
  b: toggle basic status
48 1 Adrian Georgescu
  m: set mood information
49 1 Adrian Georgescu
  n: set note
50 1 Adrian Georgescu
  q: quit program
51 1 Adrian Georgescu
  s: show PIDF
52 1 Adrian Georgescu
53 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
54 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">
55 1 Adrian Georgescu
  <tuple id="apgjjwtz">
56 1 Adrian Georgescu
    <status>
57 1 Adrian Georgescu
      <basic>open</basic>
58 1 Adrian Georgescu
    </status>
59 1 Adrian Georgescu
    <timestamp>2008-10-26T10:37:16+01:00</timestamp>
60 1 Adrian Georgescu
  </tuple>
61 1 Adrian Georgescu
  <dm:person id="yipgulqr">
62 1 Adrian Georgescu
    <rpid:time-offset>60</rpid:time-offset>
63 1 Adrian Georgescu
    <dm:timestamp>2008-10-26T10:37:16+01:00</dm:timestamp>
64 1 Adrian Georgescu
  </dm:person>
65 1 Adrian Georgescu
</presence>
66 1 Adrian Georgescu
67 1 Adrian Georgescu
Commands:
68 1 Adrian Georgescu
  a: set activities information
69 1 Adrian Georgescu
  b: toggle basic status
70 1 Adrian Georgescu
  m: set mood information
71 1 Adrian Georgescu
  n: set note
72 1 Adrian Georgescu
  q: quit program
73 1 Adrian Georgescu
  s: show PIDF
74 1 Adrian Georgescu
75 1 Adrian Georgescu
Commands:
76 1 Adrian Georgescu
  a: set activity
77 1 Adrian Georgescu
  c: clear all activity data
78 1 Adrian Georgescu
  d: delete activity
79 1 Adrian Georgescu
  n: set activity note
80 1 Adrian Georgescu
  q: quit program
81 1 Adrian Georgescu
  s: show current activity
82 1 Adrian Georgescu
  r: set random activity
83 1 Adrian Georgescu
  x: exit to upper level menu
84 1 Adrian Georgescu
85 1 Adrian Georgescu
Set note> I am working
86 1 Adrian Georgescu
87 1 Adrian Georgescu
Note set
88 1 Adrian Georgescu
89 1 Adrian Georgescu
Commands:
90 1 Adrian Georgescu
  a: set activities information
91 1 Adrian Georgescu
  b: toggle basic status
92 1 Adrian Georgescu
  m: set mood information
93 1 Adrian Georgescu
  n: set note
94 1 Adrian Georgescu
  q: quit program
95 1 Adrian Georgescu
  s: show PIDF
96 1 Adrian Georgescu
97 1 Adrian Georgescu
98 1 Adrian Georgescu
Commands:
99 1 Adrian Georgescu
  a: add a mood
100 1 Adrian Georgescu
  c: clear all mood data
101 1 Adrian Georgescu
  d: delete a mood
102 1 Adrian Georgescu
  n: set mood note
103 1 Adrian Georgescu
  q: quit program
104 1 Adrian Georgescu
  s: show current moods
105 1 Adrian Georgescu
  r: set random mood
106 1 Adrian Georgescu
  x: exit to upper level menu
107 1 Adrian Georgescu
108 1 Adrian Georgescu
You are now contended, sad, mean
109 1 Adrian Georgescu
110 1 Adrian Georgescu
Commands:
111 1 Adrian Georgescu
  a: set activities information
112 1 Adrian Georgescu
  b: toggle basic status
113 1 Adrian Georgescu
  m: set mood information
114 1 Adrian Georgescu
  n: set note
115 1 Adrian Georgescu
  q: quit program
116 1 Adrian Georgescu
  s: show PIDF
117 1 Adrian Georgescu
118 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
119 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">
120 1 Adrian Georgescu
  <tuple id="apgjjwtz">
121 1 Adrian Georgescu
    <status>
122 1 Adrian Georgescu
      <basic>open</basic>
123 1 Adrian Georgescu
    </status>
124 1 Adrian Georgescu
    <timestamp>2008-10-26T10:37:16+01:00</timestamp>
125 1 Adrian Georgescu
  </tuple>
126 1 Adrian Georgescu
  <dm:person id="yipgulqr">
127 1 Adrian Georgescu
    <rpid:mood>
128 1 Adrian Georgescu
      <rpid:mean/>
129 1 Adrian Georgescu
      <rpid:contended/>
130 1 Adrian Georgescu
      <rpid:sad/>
131 1 Adrian Georgescu
    </rpid:mood>
132 1 Adrian Georgescu
    <rpid:activities>
133 1 Adrian Georgescu
      <rpid:note xml:lang="en">I am working</rpid:note>
134 1 Adrian Georgescu
    </rpid:activities>
135 1 Adrian Georgescu
    <rpid:time-offset>60</rpid:time-offset>
136 1 Adrian Georgescu
    <dm:timestamp>2008-10-26T10:37:32+01:00</dm:timestamp>
137 1 Adrian Georgescu
  </dm:person>
138 1 Adrian Georgescu
</presence>
139 1 Adrian Georgescu
140 1 Adrian Georgescu
Commands:
141 1 Adrian Georgescu
  a: set activities information
142 1 Adrian Georgescu
  b: toggle basic status
143 1 Adrian Georgescu
  m: set mood information
144 1 Adrian Georgescu
  n: set note
145 1 Adrian Georgescu
  q: quit program
146 1 Adrian Georgescu
  s: show PIDF
147 1 Adrian Georgescu
148 1 Adrian Georgescu
Your basic status is now 'closed'
149 1 Adrian Georgescu
150 1 Adrian Georgescu
Commands:
151 1 Adrian Georgescu
  a: set activities information
152 1 Adrian Georgescu
  b: toggle basic status
153 1 Adrian Georgescu
  m: set mood information
154 1 Adrian Georgescu
  n: set note
155 1 Adrian Georgescu
  q: quit program
156 1 Adrian Georgescu
  s: show PIDF
157 1 Adrian Georgescu
158 1 Adrian Georgescu
Your basic status is now 'open'
159 1 Adrian Georgescu
160 1 Adrian Georgescu
Commands:
161 1 Adrian Georgescu
  a: set activities information
162 1 Adrian Georgescu
  b: toggle basic status
163 1 Adrian Georgescu
  m: set mood information
164 1 Adrian Georgescu
  n: set note
165 1 Adrian Georgescu
  q: quit program
166 1 Adrian Georgescu
  s: show PIDF
167 1 Adrian Georgescu
168 1 Adrian Georgescu
<?xml version='1.0' encoding='UTF-8'?>
169 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">
170 1 Adrian Georgescu
  <tuple id="apgjjwtz">
171 1 Adrian Georgescu
    <status>
172 1 Adrian Georgescu
      <basic>open</basic>
173 1 Adrian Georgescu
    </status>
174 1 Adrian Georgescu
    <timestamp>2008-10-26T10:37:42+01:00</timestamp>
175 1 Adrian Georgescu
  </tuple>
176 1 Adrian Georgescu
  <dm:person id="yipgulqr">
177 1 Adrian Georgescu
    <rpid:mood>
178 1 Adrian Georgescu
      <rpid:mean/>
179 1 Adrian Georgescu
      <rpid:contended/>
180 1 Adrian Georgescu
      <rpid:sad/>
181 1 Adrian Georgescu
    </rpid:mood>
182 1 Adrian Georgescu
    <rpid:activities>
183 1 Adrian Georgescu
      <rpid:note xml:lang="en">I am working</rpid:note>
184 1 Adrian Georgescu
    </rpid:activities>
185 1 Adrian Georgescu
    <rpid:time-offset>60</rpid:time-offset>
186 1 Adrian Georgescu
    <dm:timestamp>2008-10-26T10:37:32+01:00</dm:timestamp>
187 1 Adrian Georgescu
  </dm:person>
188 1 Adrian Georgescu
</presence>
189 1 Adrian Georgescu
190 1 Adrian Georgescu
Commands:
191 1 Adrian Georgescu
  a: set activities information
192 1 Adrian Georgescu
  b: toggle basic status
193 1 Adrian Georgescu
  m: set mood information
194 1 Adrian Georgescu
  n: set note
195 1 Adrian Georgescu
  q: quit program
196 1 Adrian Georgescu
  s: show PIDF
197 21 Adrian Georgescu
</pre>