Skip to content

Event Notifications and Subscriptions (rfc3995) #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SoulDancer27
Copy link

These changes allow to create Printers and Jobs subscriptions in compliance with rfc3995. Which is an optional extension to ipp1.1.
I've also added an example script for printer subscription.
I have not checked compliance thoroughly, but tested it for printer and job subscriptions.

I'm currently working on a public printing system and have a lot of printers registered in CUPS server. This feature allows to send specified events to the designated api server and is useful to me.

I would be grateful for any response according this PR.

@andreashuetter
Copy link

andreashuetter commented Apr 2, 2025

This works, thanks a lot, but what still is not possible is to cancel a subscription:

    const printer = ipp.Printer(CUPS_URI);
    const response = await new Promise((resolve, reject) => {
      printer.execute('Cancel-Subscription', {
        "operation-attributes-tag": {
          "attributes-charset": "utf-8",
          "attributes-natural-language": "en",
          "printer-uri": CUPS_URI,
          "notify-subscription-id": subscriptionId
        }
      }, (err, res) => {
        if (err) {
          reject(err);
        } else {
          resolve(res);
        }
      });

Error removing subscription 56: Unknown attribute: notify-subscription-id
Error removing subscription : Unknown attribute: notify-subscription-id

Even though the attribute notify-subscription-id is defined in attributes.js:

attributes["Subscription Description"] = {
"notify-job-id": integer(1,MAX),
"notify-lease-expiration-time": integer(0,MAX),
"notify-printer-up-time": integer(1,MAX),
"notify-printer-uri": uri,
"notify-sequence-number": integer(0,MAX),
"notify-subscriber-user-name": name,
"notify-subscriber-user-uri": uri,
"notify-subscription-id": integer(1,MAX),
"subscription-uuid": uri
};

But for some reason serializer.js refuses to serialize it...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants