Send a Sip-Message on key-press

Note: needs Version 2.4 or above

This key sends a Sip-Message (text of message is one of the parameters of the key) to the configured number after the configured amount of seconds have passed. The receiving phone will show the message as popup.

sip_message.xml
  1. <configuration>
  2. <templates>
  3. <template name="@string/silent_alert" prio="10" icon="@drawable/bluelight">
  4. <keyConfiguration>
  5. <lua>
  6. <code>
  7. local silentAlertNotifyId = 24242
  8. local function onClickedNotify()
  9. sip.sendMessage{line=identity, message=msg, target=url}
  10.  
  11. local notification = system.notifications.get{id=silentAlertNotifyId}
  12. if notification then
  13. notification:delete()
  14. end
  15. end
  16.  
  17. function onKeyUp()
  18. if url ~= nil and url ~= "" and delay ~= nil then
  19. if delay ~= "" and tonumber(delay) > 0 then
  20. system.notifications.add{tag="SilentAlertTag", id=silentAlertNotifyId, title="@string/silent_alert",
  21. message="@string/silent_alert_msg", autoClickDelay=tonumber(delay),
  22. alert=true, alertSound=false, alertOkText="@string/silent_alert_ok", alertCancelText="",
  23. onClicked=onClickedNotify}
  24. else
  25. sip.sendMessage{line=identity, message=msg, target=url}
  26. end
  27. end
  28. end
  29. </code>
  30. <params>
  31. <param name="url"/>
  32. <param name="msg"/>
  33. <param name="identity"/>
  34. <param name="delay">
  35. <value>10</value>
  36. </param>
  37. </params>
  38. </lua>
  39. </keyConfiguration>
  40. <parameters>
  41. <parameter name="@string/uri" type="sip_uri">
  42. <path>//param[@name="url"]/value</path>
  43. </parameter>
  44. <parameter name="@string/identity" type="identity">
  45. <path>//param[@name="identity"]/value</path>
  46. </parameter>
  47. <parameter optional="true" name="@string/silent_alert_delay" type="number" min="0" max="60">
  48. <path>//param[@name="delay"]/value</path>
  49. </parameter>
  50. <parameter optional="true" name="@string/param_message" type="text">
  51. <path>//param[@name="msg"]/value</path>
  52. </parameter>
  53. </parameters>
  54. </template>
  55. </templates>
  56. </configuration>
  • en/products/comfortel-d-series/developer/keys/templates/examples/send_sipmessage.txt
  • Last modified: 20.07.2022 12:09
  • by neubauers