Project

General

Profile

Sip subscribe winfo » History » Version 2

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

1 1 Adrian Georgescu
== sip_subscribe_winfo ==
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_subscribe_winfo.py scripts/sip_subscribe_winfo.py]
8
9 1 Adrian Georgescu
{{{
10
adigeo@ag-imac3:~$sip_subscribe_winfo -h
11
Usage: sip_subscribe_winfo [options]
12
13
This example script will use the specified SIP account to SUBSCRIBE to the
14
presence.winfo event of itself and request action to be taken when a new
15
watcher is in 'pending'/'waiting' state. The program will un-SUBSCRIBE and
16
quit when CTRL+D is pressed.
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
  -p PASSWORD, --password=PASSWORD
28
                        Password to use to authenticate the local account.
29
                        This overrides the setting from the config file.
30
  -n DISPLAY_NAME, --display-name=DISPLAY_NAME
31
                        Display name to use for the local account. This
32
                        overrides the setting from the config file.
33
  -e EXPIRES, --expires=EXPIRES
34
                        "Expires" value to set in SUBSCRIBE. Default is 300
35
                        seconds.
36
  -o IP[:PORT], --outbound-proxy=IP[:PORT]
37
                        Outbound SIP proxy to use. By default a lookup of the
38
                        domain is performed based on SRV and A records. This
39
                        overrides the setting from the config file.
40
  -x XCAP_ROOT, --xcap-root=XCAP_ROOT
41
                        The XCAP root to use to access the pres-rules document
42
                        for authorizing subscriptions to presence.
43
  -s, --trace-sip       Dump the raw contents of incoming and outgoing SIP
44
                        messages (disabled by default).
45
  -l, --log-pjsip       Print PJSIP logging output (disabled by default).
46
}}}
47
48
=== Example ===
49
50
{{{
51
adigeo@ag-imac3:~/work/pypjua$sip_subscribe_winfo
52
Accounts available: 'alice', 'bob', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default
53
Using default account: 31208005169@ag-projects.com
54
Resolved DNS SRV record "_sip._udp.ag-projects.com" --> proxy.sipthor.net:5060
55
Resolved DNS A record "proxy.sipthor.net" --> 85.17.186.7, 81.23.228.150, 81.23.228.129
56
Retrieving current presence rules from https://xcap.sipthor.net/xcap-root/
57
Allowed list:
58
	sip:2233350608@sip2sip.info
59
	sip:31208005163@ag-projects.com
60
	sip:31208005166@ag-projects.com
61
	sip:31208005167@ag-projects.com
62
	sip:adi@umts.ro
63
	sip:alice@example.com
64
	sip:ruud@umts.ro
65
	sip:317105169@eurovoice.ro
66
Blocked list:
67
Polite-blocked list:
68
Subscribing to "31208005169@ag-projects.com" for the presence.winfo event, at 81.23.228.129:5060
69
Received NOTIFY:
70
----
71
Active watchers:
72
Terminated watchers:
73
Pending watchers:
74
  sip:bob@example.com
75
Waiting watchers:
76
----
77
pending watcher sip:bob@example.com wants to subscribe to your presence information. Press (a) to allow, (d) to deny, (p) to polite block:
78
Watcher sip:bob@example.com is now allowed
79
80
}}}