Project

General

Profile

Sip publish presence » History » Version 2

Adrian Georgescu, 10/26/2008 11:16 AM

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