Project

General

Profile

Sip subscribe presence » History » Version 16

Adrian Georgescu, 03/30/2009 11:25 AM

1 8 Adrian Georgescu
== sip_subscribe_presence ==
2 10 Adrian Georgescu
[[TOC(SipTesting*, sip_*, depth=2)]]
3 1 Adrian Georgescu
4 15 Adrian Georgescu
To use this script you must to have a valid [wiki:SipSettingsAPI configuration].
5 1 Adrian Georgescu
6 8 Adrian Georgescu
=== Description ===
7 1 Adrian Georgescu
8 11 Adrian Georgescu
[[Image(http://www.openxcap.org/chrome/site/SIMPLE-Server.png, nolink)]]
9 4 Adrian Georgescu
10 3 Adrian Georgescu
Source code: [source:scripts/sip_subscribe_presence.py scripts/sip_subscribe_presence.py]
11
12 1 Adrian Georgescu
{{{
13
adigeo@ag-imac3:~$sip_subscribe_presence -h
14 5 Adrian Georgescu
Usage: sip_subscribe_presence [options] [target-user@target-domain.com]
15 1 Adrian Georgescu
16 5 Adrian Georgescu
This script will SUBSCRIBE to the presence event published by the specified
17
SIP target. If a SIP target is not specified, it will subscribe to its own
18
address. It will then interprete PIDF bodies contained in NOTIFYs and display
19
their meaning. The program will un-SUBSCRIBE and quit when CTRL+D is pressed.
20 1 Adrian Georgescu
21
Options:
22
  -h, --help            show this help message and exit
23 16 Adrian Georgescu
  -a ACCOUNT_NAME, --account-name=ACCOUNT_NAME
24
                        The name of the account to use.
25 1 Adrian Georgescu
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
26
                        messages (disabled by default).
27 16 Adrian Georgescu
  -j, --trace-pjsip     Print PJSIP logging output (disabled by default).
28
29 1 Adrian Georgescu
}}}
30 2 Adrian Georgescu
31 8 Adrian Georgescu
=== Example ===
32 2 Adrian Georgescu
33
{{{
34
adigeo@ag-imac3:~$sip_subscribe_presence -a umts ag@ag-projects.com
35
Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
36
Using account 'umts': adi@umts.ro
37
Resolved DNS SRV record "_sip._udp.umts.ro" --> proxy.sipthor.net:5060
38
Resolved DNS A record "proxy.sipthor.net" --> 81.23.228.150, 81.23.228.129, 85.17.186.7
39
Subscribing to "<sip:ag@ag-projects.com>" for the presence event, at 85.17.186.7:5060
40
Received NOTIFY:
41
----------------
42
Presence for 31208005169@ag-projects.com:
43
  Person id yipgulqr
44
    Timestamp: 2008-10-26 10:37:32
45
    Activities
46
      Note(en): I am working
47
    Mood: sad, contended, mean
48
    Time offset from UTC: 60 minutes 
49
  ---
50
  Service id apgjjwtz
51
    Timestamp: 2008-10-26 10:37:42
52
    Status: open
53
----------------
54
Received NOTIFY:
55
----------------
56
Presence for 31208005169@ag-projects.com:
57
  Person id ksgxtgwo
58
    Timestamp: 2008-10-26 10:41:04
59
    Mood: impressed, flirtatious, thirsty
60
    Time offset from UTC: 60 minutes 
61
  Person id yipgulqr
62
    Timestamp: 2008-10-26 10:37:32
63
    Activities
64
      Note(en): I am working
65
    Mood: sad, contended, mean
66
    Time offset from UTC: 60 minutes 
67
  ---
68
  Service id apgjjwtz
69
    Timestamp: 2008-10-26 10:37:42
70
    Status: open
71
  Service id hxpzsnfp
72
    Timestamp: 2008-10-26 10:41:00
73
    Status: open
74
----------------
75
Received NOTIFY:
76
----------------
77
Presence for 31208005169@ag-projects.com:
78
  Person id ksgxtgwo
79
    Timestamp: 2008-10-26 10:41:04
80
    Mood: impressed, flirtatious, thirsty
81
    Time offset from UTC: 60 minutes 
82
  Person id yipgulqr
83
    Timestamp: 2008-10-26 10:37:32
84
    Activities
85
      Note(en): I am working
86
    Mood: sad, contended, mean
87
    Time offset from UTC: 60 minutes 
88
  ---
89
  Service id apgjjwtz
90
    Timestamp: 2008-10-26 10:37:42
91
    Status: open
92
  Service id hxpzsnfp
93
    Timestamp: 2008-10-26 10:41:07
94
    Status: closed
95
----------------
96
97
}}}