Sip publish presence

Version 22 (Tijmen de Mes, 04/19/2012 09:23 pm)

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