cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
184
Views
0
Helpful
0
Replies

XML Application

TimEckert
Level 1
Level 1

Hello dear Community,

I'm working on a Cisco XML application for my Cisco 8851 phone with SIP firmware and I'm running into some persistent issues. My goal is to create a simple application that displays an "On" or "Off" status, and when selected, shows a confirmation as a banner. Ideally, after that, I'd like to jump directly to Key:Applications, but I'm having trouble with the phone's history.


 

My Current Setup and Problem

 

I'm using Flask as a backend to generate the XML objects. I want to create a list with two entries ("On" and "Off") that each display a suitable icon (e.g., On.png / Off.png) depending on the current active status.

When a user selects "On" or "Off", the following should happen:

  1. The setting is saved in the backend.

  2. A status banner (short message "Mode: On/Off") should be displayed as an overlay on the phone.

  3. Afterward, I ideally want to jump directly to the phone's main applications menu (Key:Applications).

The main problem is that I consistently receive an "XML Error [4]: Parse Error" on the phone whenever I try to send a banner (using CiscoIPPhoneStatus or CiscoIPPhoneStatusFile) in conjunction with a navigation command (CiscoIPPhoneExecute). Even if the XML looks well-formed in the browser, the phone doesn't seem to support this combination.

In addition, when I jump to Key:Applications, my application often remains in the phone's history, so pressing the hardkey "Back" brings me back to my application. I want the application to be completely removed from the history when I jump to Key:Applications, so that the next press of the hardkey "Back" returns me to the phone's idle screen.


Here is the relevant code I'm currently using (simplified):

# Route for the mode menu
@blueprint.route('/services/noise-reduction/mode')
def noise_reduction_mode():
    current_mode, _ = read_noise_reduction_config()
    on_icon_url = request.url_root + 'Ein.png'
    off_icon_url = request.url_root + 'Aus.png'

    xml = '<?xml version="1.0" encoding="UTF-8"?>' \
        '<CiscoIPPhoneIconFileMenu>' \
          '<Title>Mode</Title>' \
          '<IconItem>' \
            '<Index>0</Index>' \
            '<URL>' + on_icon_url + '</URL>' \
          '</IconItem>' \
          '<IconItem>' \
            '<Index>1</Index>' \
            '<URL>' + off_icon_url + '</URL>' \
          '</IconItem>' \
          '<MenuItem>' \
            '<Name>On</Name>' \
            '<URL>' + request.url_root + 'services/noise-reduction/process-mode-set?value=on</URL>'
    if current_mode == "on":
        xml += '<IconIndex>0</IconIndex>'
        xml += '<Selected>true</Selected>'
    else:
        xml += '<IconIndex>1</IconIndex>'
    xml += '</MenuItem>' \
          '<MenuItem>' \
            '<Name>Off</Name>' \
            '<URL>' + request.url_root + 'services/noise-reduction/process-mode-set?value=off</URL>'
    if current_mode == "off":
        xml += '<IconIndex>0</IconIndex>'
        xml += '<Selected>true</Selected>'
    else:
        xml += '<IconIndex>1</IconIndex>'
    xml += '</MenuItem>' \
          '<SoftKeyItem>' \
            '<Name>Back</Name>' \
            '<Position>' + ('3' if g.is_79xx else '1') + '</Position>' \
            '<URL>' + request.url_root + 'services/noise-reduction</URL>' \
          '</SoftKeyItem>' \
          '<SoftKeyItem>' \
            '<Name>Select</Name>' \
            '<Position>' + ('1' if g.is_79xx else '2') + '</Position>' \
            '<URL>SoftKey:Select</URL>' \
          '</SoftKeyItem>' \
        '</CiscoIPPhoneIconFileMenu>'
    return Response(xml, mimetype = 'text/xml'), 200

# Process route for saving and navigating (causes parse error)
@blueprint.route('/services/noise-reduction/process-mode-set')
def process_noise_reduction_mode_set():
    mode_value = request.args.get('value')
    if mode_value in ["on", "off"]:
        # ... (save logic) ...
        print(f"Noise reduction mode set to: {mode_value}.")

    # Attempt to display a banner and then navigate - leads to parse error
    # The combination of CiscoIPPhoneStatus/File and a navigation URL in a CiscoIPPhoneExecute
    # does not seem to be allowed ("only one URL and two URIs per CiscoIPPhoneExecute").
    # Even a nested solution with intermediate pages led to errors.
    xml = '<?xml version="1.0" encoding="UTF-8"?>' \
          '<CiscoIPPhoneExecute>' \
            '<ExecuteItem URL="SoftKey:Exit"/>' \
            '<ExecuteItem URL="Key:Applications"/>' \
          '</CiscoIPPhoneExecute>' # This specific code also triggered the "parse error" for me.
                                   # Even trying to send only Key:Applications resulted in an error.
                                   # Only SoftKey:Exit works, but that's not the goal.
    return Response(xml, mimetype = 'text/xml'), 200

My Questions for the Community

 

  1. Is there a reliable method to display a status banner (similar to the CiscoIPPhoneStatus / CiscoIPPhoneStatusFile object) on a Cisco 8851 phone with SIP firmware without getting an "XML Error [4]: Parse Error"? Do I need a specific firmware version for this, or should I use a different XML object?

  2. After saving the setting (and ideally displaying the banner), how can I jump directly to Key:Applications while ensuring that my application is completely removed from the phone's hardkey history? The goal is that the next press of the phone's physical "Back" button does not lead back to my application, but to the phone's idle screen. SoftKey:Exit followed by Key:Applications leads to errors or an uncleared history for me.

I'm grateful for any tips and experiences, especially from those who have successfully implemented complex XML interactions on Cisco 8851 phones!

Thank you in advance!

0 Replies 0