Community discussions

MikroTik App
 
sajjadzare
just joined
Topic Author
Posts: 10
Joined: Sat Nov 09, 2013 2:44 pm

mikrotik.Send(.... for set queue

Tue Dec 24, 2013 3:15 pm

I use api for set queue for customer,but the result that return is :

Policy !trap=message=no such item.tag=username!done.tag=username

why ?
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: mikrotik.Send(.... for set queue

Fri Dec 27, 2013 3:56 pm

How does your request look and what is the RouterOS version you're using?
 
sajjadzare
just joined
Topic Author
Posts: 10
Joined: Sat Nov 09, 2013 2:44 pm

Re: mikrotik.Send(.... for set queue

Sat Dec 28, 2013 1:35 pm

How does your request look and what is the RouterOS version you're using?
on this router and with this code , every thing is correct but sometimes occur this error,not always
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: mikrotik.Send(.... for set queue

Sat Dec 28, 2013 5:47 pm

If you're targeting the queue by ID instead of a name, you should keep in mind that IDs may change as you add/remove/move queues, which could be the reason why it sometimes works, and sometimes not. Target queues by their name instead.
 
sajjadzare
just joined
Topic Author
Posts: 10
Joined: Sat Nov 09, 2013 2:44 pm

Re: mikrotik.Send(.... for set queue

Sun Dec 29, 2013 8:49 am

If you're targeting the queue by ID instead of a name, you should keep in mind that IDs may change as you add/remove/move queues, which could be the reason why it sometimes works, and sometimes not. Target queues by their name instead.
means that when i want to set queue for a customer, i should send username no id ? if yes, customer's id is unique and not change
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: mikrotik.Send(.... for set queue

Sun Dec 29, 2013 3:45 pm

I mean use the queue name. If the queue name is the customer's ID, then the customer ID it is.

So if the name of your queue is "CustomerID-1234", then make the request be something like:
/queue/simple/set
=numbers=CustomerID-1234
=max-limit=10M/10M

 
sajjadzare
just joined
Topic Author
Posts: 10
Joined: Sat Nov 09, 2013 2:44 pm

Re: mikrotik.Send(.... for set queue

Sun Dec 29, 2013 9:36 pm

I mean use the queue name. If the queue name is the customer's ID, then the customer ID it is.

So if the name of your queue is "CustomerID-1234", then make the request be something like:
/queue/simple/set
=numbers=CustomerID-1234
=max-limit=10M/10M

I use below codes
/queue/simple/set
=.id=<pppoe-CUSTOMERUSERNAME>
=max-limit=10M/10M
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: mikrotik.Send(.... for set queue

Sun Dec 29, 2013 10:44 pm

That should be equivalent to the above, so that's not the problem.

What RouterOS version are you using? There was a bug in recent versions about added/modified items (not just queues...) not being made available to scripts/API until a whole second after the fact. I don't remember the exact version, but it should certainly already be fixed in 6.7.
 
Bee05
just joined
Posts: 2
Joined: Mon Dec 30, 2013 7:00 am

Re: mikrotik.Send(.... for set queue

Mon Dec 30, 2013 7:16 am

Nice post!
 
sajjadzare
just joined
Topic Author
Posts: 10
Joined: Sat Nov 09, 2013 2:44 pm

Re: mikrotik.Send(.... for set queue

Mon Dec 30, 2013 7:31 am

That should be equivalent to the above, so that's not the problem.

What RouterOS version are you using? There was a bug in recent versions about added/modified items (not just queues...) not being made available to scripts/API until a whole second after the fact. I don't remember the exact version, but it should certainly already be fixed in 6.7.
our RouterOS version is 6.7