Sip subscribe presence » History » Version 2
Adrian Georgescu, 10/26/2008 10:41 AM
| 1 | 1 | Adrian Georgescu | == sip_subscribe_presence == |
|---|---|---|---|
| 2 | |||
| 3 | To use this script you must to have a valid [wiki:configuration_file configuration file]. |
||
| 4 | |||
| 5 | === Description === |
||
| 6 | |||
| 7 | {{{ |
||
| 8 | adigeo@ag-imac3:~$sip_subscribe_presence -h |
||
| 9 | Usage: sip_subscribe_presence [options] [presentity@presentity-domain.com] |
||
| 10 | |||
| 11 | This script will use SUBSCRIBE to the presence event published by the |
||
| 12 | specified SIP address. If a SIP address is not specified, it will subscribe to |
||
| 13 | its own presence. It will then interprete PIDF bodies contained in NOTIFYs and |
||
| 14 | display their meaning. The program will un-SUBSCRIBE and quit when CTRL+D is |
||
| 15 | pressed. |
||
| 16 | |||
| 17 | Options: |
||
| 18 | -h, --help show this help message and exit |
||
| 19 | -a NAME, --account-name=NAME |
||
| 20 | The account name from which to read account settings. |
||
| 21 | Corresponds to section Account_NAME in the |
||
| 22 | configuration file. If not supplied, the section |
||
| 23 | Account will be read. |
||
| 24 | --sip-address=SIP_ADDRESS |
||
| 25 | SIP address of the user in the form user@domain |
||
| 26 | -p PASSWORD, --password=PASSWORD |
||
| 27 | Password to use to authenticate the local account. |
||
| 28 | This overrides the setting from the config file. |
||
| 29 | -n DISPLAY_NAME, --display-name=DISPLAY_NAME |
||
| 30 | Display name to use for the local account. This |
||
| 31 | overrides the setting from the config file. |
||
| 32 | -e EXPIRES, --expires=EXPIRES |
||
| 33 | "Expires" value to set in SUBSCRIBE. Default is 300 |
||
| 34 | seconds. |
||
| 35 | -o IP[:PORT], --outbound-proxy=IP[:PORT] |
||
| 36 | Outbound SIP proxy to use. By default a lookup of the |
||
| 37 | domain is performed based on SRV and A records. This |
||
| 38 | overrides the setting from the config file. |
||
| 39 | -c CONTENT_TYPE, --content-type=CONTENT_TYPE |
||
| 40 | "Content-Type" the UA expects to receving in a NOTIFY |
||
| 41 | for this subscription. For the known events this does |
||
| 42 | not need to be specified, but may be overridden". |
||
| 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 | 2 | Adrian Georgescu | |
| 48 | === Example === |
||
| 49 | |||
| 50 | {{{ |
||
| 51 | adigeo@ag-imac3:~$sip_subscribe_presence -a umts ag@ag-projects.com |
||
| 52 | Accounts available: 'alice', 'ew', 'mrg', 'pbx', 'tf', 'umts', 'unet', default |
||
| 53 | Using account 'umts': adi@umts.ro |
||
| 54 | Resolved DNS SRV record "_sip._udp.umts.ro" --> proxy.sipthor.net:5060 |
||
| 55 | Resolved DNS A record "proxy.sipthor.net" --> 81.23.228.150, 81.23.228.129, 85.17.186.7 |
||
| 56 | Subscribing to "<sip:ag@ag-projects.com>" for the presence event, at 85.17.186.7:5060 |
||
| 57 | Received NOTIFY: |
||
| 58 | ---------------- |
||
| 59 | Presence for 31208005169@ag-projects.com: |
||
| 60 | Person id yipgulqr |
||
| 61 | Timestamp: 2008-10-26 10:37:32 |
||
| 62 | Activities |
||
| 63 | Note(en): I am working |
||
| 64 | Mood: sad, contended, mean |
||
| 65 | Time offset from UTC: 60 minutes |
||
| 66 | --- |
||
| 67 | Service id apgjjwtz |
||
| 68 | Timestamp: 2008-10-26 10:37:42 |
||
| 69 | Status: open |
||
| 70 | ---------------- |
||
| 71 | Received NOTIFY: |
||
| 72 | ---------------- |
||
| 73 | Presence for 31208005169@ag-projects.com: |
||
| 74 | Person id ksgxtgwo |
||
| 75 | Timestamp: 2008-10-26 10:41:04 |
||
| 76 | Mood: impressed, flirtatious, thirsty |
||
| 77 | Time offset from UTC: 60 minutes |
||
| 78 | Person id yipgulqr |
||
| 79 | Timestamp: 2008-10-26 10:37:32 |
||
| 80 | Activities |
||
| 81 | Note(en): I am working |
||
| 82 | Mood: sad, contended, mean |
||
| 83 | Time offset from UTC: 60 minutes |
||
| 84 | --- |
||
| 85 | Service id apgjjwtz |
||
| 86 | Timestamp: 2008-10-26 10:37:42 |
||
| 87 | Status: open |
||
| 88 | Service id hxpzsnfp |
||
| 89 | Timestamp: 2008-10-26 10:41:00 |
||
| 90 | Status: open |
||
| 91 | ---------------- |
||
| 92 | Received NOTIFY: |
||
| 93 | ---------------- |
||
| 94 | Presence for 31208005169@ag-projects.com: |
||
| 95 | Person id ksgxtgwo |
||
| 96 | Timestamp: 2008-10-26 10:41:04 |
||
| 97 | Mood: impressed, flirtatious, thirsty |
||
| 98 | Time offset from UTC: 60 minutes |
||
| 99 | Person id yipgulqr |
||
| 100 | Timestamp: 2008-10-26 10:37:32 |
||
| 101 | Activities |
||
| 102 | Note(en): I am working |
||
| 103 | Mood: sad, contended, mean |
||
| 104 | Time offset from UTC: 60 minutes |
||
| 105 | --- |
||
| 106 | Service id apgjjwtz |
||
| 107 | Timestamp: 2008-10-26 10:37:42 |
||
| 108 | Status: open |
||
| 109 | Service id hxpzsnfp |
||
| 110 | Timestamp: 2008-10-26 10:41:07 |
||
| 111 | Status: closed |
||
| 112 | ---------------- |
||
| 113 | |||
| 114 | }}} |