Sip publish presence

Version 1 (Adrian Georgescu, 10/26/2008 10:38 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 1 Adrian Georgescu
{{{
8 1 Adrian Georgescu
adigeo@ag-imac3:~$sip_publish_presence -h
9 1 Adrian Georgescu
Usage: sip_publish_presence [options]
10 1 Adrian Georgescu
11 1 Adrian Georgescu
This script will publish rich presence state of the specified SIP account to a
12 1 Adrian Georgescu
SIP Presence Agent, the presence information can be changed using a menu-
13 1 Adrian Georgescu
driven interface.
14 1 Adrian Georgescu
15 1 Adrian Georgescu
Options:
16 1 Adrian Georgescu
  -h, --help            show this help message and exit
17 1 Adrian Georgescu
  -a NAME, --account-name=NAME
18 1 Adrian Georgescu
                        The account name from which to read account settings.
19 1 Adrian Georgescu
                        Corresponds to section Account_NAME in the
20 1 Adrian Georgescu
                        configuration file. If not supplied, the section
21 1 Adrian Georgescu
                        Account will be read.
22 1 Adrian Georgescu
  --sip-address=SIP_ADDRESS
23 1 Adrian Georgescu
                        SIP address of the user in the form user@domain
24 1 Adrian Georgescu
  -e EXPIRES, --expires=EXPIRES
25 1 Adrian Georgescu
                        "Expires" value to set in PUBLISH. Default is 300
26 1 Adrian Georgescu
                        seconds.
27 1 Adrian Georgescu
  -o IP[:PORT], --outbound-proxy=IP[:PORT]
28 1 Adrian Georgescu
                        Outbound SIP proxy to use. By default a lookup of the
29 1 Adrian Georgescu
                        domain is performed based on SRV and A records. This
30 1 Adrian Georgescu
                        overrides the setting from the config file.
31 1 Adrian Georgescu
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
32 1 Adrian Georgescu
                        messages (disabled by default).
33 1 Adrian Georgescu
  -l, --log-pjsip       Print PJSIP logging output (disabled by default).
34 1 Adrian Georgescu
}}}
35 1 Adrian Georgescu
36 1 Adrian Georgescu
=== Example ===
37 1 Adrian Georgescu
38 1 Adrian Georgescu
{{{
39 1 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 1 Adrian Georgescu
}}}