Asterisk-13-Function_PRESENCE_STATE_29394691.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Asterisk Project : Asterisk 13 Function_PRESENCE_STATE</title>
  5. <link rel="stylesheet" href="styles/site.css" type="text/css" />
  6. <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
  7. </head>
  8. <body class="theme-default aui-theme-default">
  9. <div id="page">
  10. <div id="main" class="aui-page-panel">
  11. <div id="main-header">
  12. <div id="breadcrumb-section">
  13. <ol id="breadcrumbs">
  14. <li class="first">
  15. <span><a href="index.html">Asterisk Project</a></span>
  16. </li>
  17. <li>
  18. <span><a href="Asterisk-13-Command-Reference_29394274.html">Asterisk 13 Command Reference</a></span>
  19. </li>
  20. <li>
  21. <span><a href="Asterisk-13-Dialplan-Functions_29394287.html">Asterisk 13 Dialplan Functions</a></span>
  22. </li>
  23. </ol>
  24. </div>
  25. <h1 id="title-heading" class="pagetitle">
  26. <span id="title-text">
  27. Asterisk Project : Asterisk 13 Function_PRESENCE_STATE
  28. </span>
  29. </h1>
  30. </div>
  31. <div id="content" class="view">
  32. <div class="page-metadata">
  33. Created by <span class='author'> wikibot</span> on Aug 08, 2014
  34. </div>
  35. <div id="main-content" class="wiki-content group">
  36. <h1 id="Asterisk13Function_PRESENCE_STATE-PRESENCE_STATE()">PRESENCE_STATE()</h1>
  37. <h3 id="Asterisk13Function_PRESENCE_STATE-Synopsis">Synopsis</h3>
  38. <p>Get or Set a presence state.</p>
  39. <h3 id="Asterisk13Function_PRESENCE_STATE-Description">Description</h3>
  40. <p>The PRESENCE_STATE function can be used to retrieve the presence from any presence provider. For example:</p>
  41. <p>NoOp(SIP/mypeer has presence ${PRESENCE_STATE(SIP/mypeer,value)})</p>
  42. <p>NoOp(Conference number 1234 has presence message ${PRESENCE_STATE(MeetMe:1234,message)})</p>
  43. <p>The PRESENCE_STATE function can also be used to set custom presence state from the dialplan. The <code>CustomPresence:</code> prefix must be used. For example:</p>
  44. <p>Set(PRESENCE_STATE(CustomPresence:lamp1)=away,temporary,Out to lunch)</p>
  45. <p>Set(PRESENCE_STATE(CustomPresence:lamp2)=dnd,,Trying to get work done)</p>
  46. <p>Set(PRESENCE_STATE(CustomPresence:lamp3)=xa,T24gdmFjYXRpb24=,,e)</p>
  47. <p>Set(BASE64_LAMP3_PRESENCE=${PRESENCE_STATE(CustomPresence:lamp3,subtype,e)})</p>
  48. <p>You can subscribe to the status of a custom presence state using a hint in the dialplan:</p>
  49. <p>exten =&gt; 1234,hint,,CustomPresence:lamp1</p>
  50. <p>The possible values for both uses of this function are:</p>
  51. <p>not_set | unavailable | available | away | xa | chat | dnd</p>
  52. <h3 id="Asterisk13Function_PRESENCE_STATE-Syntax">Syntax</h3>
  53. <div class="preformatted panel" style="border-width: 1px;"><div class="preformattedContent panelContent">
  54. <pre>PRESENCE_STATE(provider,field[,options])</pre>
  55. </div></div>
  56. <h5 id="Asterisk13Function_PRESENCE_STATE-Arguments">Arguments</h5>
  57. <ul>
  58. <li><code>provider</code> - The provider of the presence, such as <code>CustomPresence</code></li>
  59. <li><code>field</code> - Which field of the presence state information is wanted.
  60. <ul>
  61. <li><code>value</code> - The current presence, such as <code>away</code></li>
  62. <li><code>subtype</code> - Further information about the current presence</li>
  63. <li><code>message</code> - A custom message that may indicate further details about the presence</li>
  64. </ul>
  65. </li>
  66. <li><code>options</code>
  67. <ul>
  68. <li><code>e</code> - On Write - Use this option when the subtype and message provided are Base64 encoded. The values will be stored encoded within Asterisk, but all consumers of the presence state (e.g. the SIP presence event package) will receive decoded values.<br />
  69. On Read - Retrieves unencoded message/subtype in Base64 encoded form.</li>
  70. </ul>
  71. </li>
  72. </ul>
  73. <h3 id="Asterisk13Function_PRESENCE_STATE-SeeAlso">See Also</h3>
  74. <h3 id="Asterisk13Function_PRESENCE_STATE-ImportVersion">Import Version</h3>
  75. <p>This documentation was imported from Asterisk Version SVN-branch-13-r420538</p>
  76. </div>
  77. </div> </div>
  78. <div id="footer">
  79. <section class="footer-body">
  80. <p>Document generated by Confluence on Aug 11, 2014 13:47</p>
  81. </section>
  82. </div>
  83. </div> </body>
  84. </html>