Features/Action URL/XmlSubTags

From Snom User Wiki

< Features | Action URL
Revision as of 17:38, 2 November 2011 by Sn@snom.de (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Action Url definitions using subtrees were created in order to understand the xml causing the action prior to calling the right action url. It is currently only used for action_received_subscr_notify_url. Basically these definitions consist of one or more subtrees named NotifyParsingRules (from now on refered as NPR) and ActionUrl trees. The NPR's describe how to extract the relavant information of the xml, while the ActionUrl trees defined the url's to be fetched. Since 8.7.3 the syntax has changed is now a common Xml description

The NPR's are described here.

ActionUrl trees:

  • may have an attribute named state. When this is set, the given action url will only be loaded when state determined by the NPR of type state matches the value of this attribute.
  • have as contents the action url to be called. Additional to the normal syntax of these url's it may contain placeholders for the variables set through the NPR's of type variable, e.g. $(myVariable).

Here an example of how an dialog-notify could be parsed. It doesn't really do anything usefull, but it gives an idea on how Action Url Tree could look like:

 <NotifyParsingRules type="applies">     
   <level1 translates_to='OK'>/dialog-info</level1>   
 <NotifyParsingRules type="state">     
   <level1 translates_to="frei">/dialog-info/dialog/state[.="terminated"]</level1>     
   <level2 translates_to="klingelt">/dialog-info/dialog/state[.="proceeding"]</level2>     
   <level3 translates_to="verbunden">/dialog-info/dialog/state[.="confirmed"]</level3>     
   <level4 fetch_content='true'>/dialog-info/dialog/state</level4>     
   <default translates_to='unbekannt'/>   
 <NotifyParsingRules type="variable" id="ever_param">     
   <level1 fetch_content='true'>/dialog-info/dialog/state</level1>     
   <default translates_to='unknown_ever_param'/>   
 <NotifyParsingRules type="variable" id="ever_param2">     
   <level1 fetch_content='true'>/dialog-info/dialog/state</level1>     
   <default translates_to='unknown_ever_param'/>   
 <NotifyParsingRules type="variable" id="ring_param" state="klingelt">     
   <level1 fetch_content='true'>/dialog-info/dialog/state[.="proceeding"]</level1>   
   <default translates_to='not ringing'/>   
 <NotifyParsingRules type="variable" id="con_param" state="verbunden">     
   <level1 fetch_content='true'>/dialog-info/dialog/state[.="confirmed"]</level1>   
   <default translates_to='not connected'/>   
 <NotifyParsingRules type="variable" id="free_param" state="frei">     
   <level1 fetch_content='true'>/dialog-info/dialog/state[.="terminated"]</level1>   
   <default translates_to='not free'/>   
 <ActionUrl state="frei">http://www.$(ever_param).de/$(free_param)</ActionUrl> 
 <ActionUrl state="klingelt">http://www.$(ever_param).de/$(ring_param)</ActionUrl> 
 <ActionUrl state="verbunden">http://www.$(ever_param).de/$(con_param)</ActionUrl>
Personal tools