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