Re: [SR-Users] MWI notification through pua.publish

2019-01-23 Thread Володимир Іванець
Hello!

Sorry for my confusion. Now I get it. There are two different IDs. One for
pua.publish and second that I was missing for jsonrpcs.

Thanks everyone for help!

ср, 23 січ. 2019 о 10:05 Daniel-Constantin Mierla  пише:

> Hello,
>
> the rpc interface is not matching parameters by name, but by possition.
> You can add them with name, but must be at the right/expected possition.
>
> In your last example, body field is out of parameters structure. And as it
> was pointed out before, you need an id in the root jsonrpc structure.
>
> See some examples at:
>
>   -
> https://www.kamailio.org/docs/modules/stable/modules/jsonrpcs.html#idm1028042236
>
> Cheers,
> Daniel
> On 22.01.19 17:58, Володимир Іванець wrote:
>
> Hello Serge,
>
> Thank you for clarifying this for me. But there is different issue when I
> change format. It appears that Kamailio indeed expects *body* under
> parameters
> https://www.kamailio.org/docs/modules/5.2.x/modules/pua_rpc.html#pua_rpc.r.pua.publish
> .
>
> I run:
>
> *# curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc": "2.0",
> "method": "pua.publish", "params": {"presentity_uri":
> "sip:j...@test.tutpro.com ", "expires": "600",
> "event package": "message-summary", "content type":
> "application/simple-message-summary", "id": "4ce8c647a7b947c@172.16.30.151
> <4ce8c647a7b947c@172.16.30.151>", "ETag": ".", "outbound proxy":
> "sip:127.0.0.1:5060;transport=udp", "extra_headers": "P-Flags: 0"}, "body":
> 1}' http://172.16.30.151:5060/JSON_RPC *
>
> Result:
>
> *{*
> *"jsonrpc":  "2.0",*
> *"error":{*
> *"code": 400,*
> *"message":  "Body is missing"*
> *}*
> *}*
>
>
> Debug:
>
> *Jan 22 18:41:36 test kamailio: 14(27146) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2019-01-23 Thread Daniel-Constantin Mierla
Hello,

the rpc interface is not matching parameters by name, but by possition.
You can add them with name, but must be at the right/expected possition.

In your last example, body field is out of parameters structure. And as
it was pointed out before, you need an id in the root jsonrpc structure.

See some examples at:

  -
https://www.kamailio.org/docs/modules/stable/modules/jsonrpcs.html#idm1028042236

Cheers,
Daniel

On 22.01.19 17:58, Володимир Іванець wrote:
> Hello Serge,
>
> Thank you for clarifying this for me. But there is different issue
> when I change format. It appears that Kamailio indeed expects
> *body* under
> parameters 
> https://www.kamailio.org/docs/modules/5.2.x/modules/pua_rpc.html#pua_rpc.r.pua.publish.
>
> I run:
>
> /# curl -H "Content-Type: application/json" -X POST -d
> '{"jsonrpc": "2.0", "method": "pua.publish", "params":
> {"presentity_uri": "sip:j...@test.tutpro.com
> ", "expires": "600", "event
> package": "message-summary", "content type":
> "application/simple-message-summary", "id":
> "4ce8c647a7b947c@172.16.30.151
> ", "ETag": ".", "outbound
> proxy": "sip:127.0.0.1:5060;transport=udp", "extra_headers":
> "P-Flags: 0"}, "body": 1}' http://172.16.30.151:5060/JSON_RPC/
>
> Result:
>
> /{/
> /        "jsonrpc":      "2.0",/
> /        "error":        {/
> /                "code": 400,/
> /                "message":      "Body is missing"/
> /        }/
> /}/
>
>
> Debug:
>
> /Jan 22 18:41:36 test kamailio: 14(27146) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2019-01-22 Thread Володимир Іванець
Hello Serge,

Thank you for clarifying this for me. But there is different issue when I
change format. It appears that Kamailio indeed expects *body* under
parameters
https://www.kamailio.org/docs/modules/5.2.x/modules/pua_rpc.html#pua_rpc.r.pua.publish
.

I run:

*# curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc": "2.0",
"method": "pua.publish", "params": {"presentity_uri":
"sip:j...@test.tutpro.com ", "expires": "600",
"event package": "message-summary", "content type":
"application/simple-message-summary", "id": "4ce8c647a7b947c@172.16.30.151
<4ce8c647a7b947c@172.16.30.151>", "ETag": ".", "outbound proxy":
"sip:127.0.0.1:5060;transport=udp", "extra_headers": "P-Flags: 0"}, "body":
1}' http://172.16.30.151:5060/JSON_RPC *

Result:

*{*
*"jsonrpc":  "2.0",*
*"error":{*
*"code": 400,*
*"message":  "Body is missing"*
*}*
*}*


Debug:

*Jan 22 18:41:36 test kamailio: 14(27146) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2019-01-22 Thread Serge S. Yuriev

Hi

id is not inside params but must to be at top-level.

You have to read JSONRPC specs %)
https://www.jsonrpc.org/specification

On 22/01/2019 13:47, Володимир Іванець wrote:

Hello Henning,

Thank you for your message. I tried setting *id* too but got same result.

/# curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc":
"2.0", "method": "pua.publish", "params": {"presentity_uri":
"sip:h...@test.tutpro.com ", "expires":
"600", "event package": "message-summary", "content type":
"application/simple-message-summary", "id":
"NmU0MjI0NWM4ZjI3MWI3NTNlMTJhOWNlZWJlMWE0Yzg.", "ETag": ".",
"outbound proxy": "sip:127.0.0.1:5060;transport=udp",
"extra_headers": "P-Flags: 0", "body": "."}}'
http://172.16.30.151:5060/JSON_RPC/
/{/
/        "jsonrpc":      "2.0",/
/        "error":        {/
/                "code": 500,/
/                "message":      "Internal error: failed to create
context"/
/        }/
/}/



/Jan 22 12:40:54 test kamailio: 16(26145) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2019-01-22 Thread Володимир Іванець
Hello Henning,

Thank you for your message. I tried setting *id* too but got same result.

*# curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc": "2.0",
"method": "pua.publish", "params": {"presentity_uri":
"sip:h...@test.tutpro.com ", "expires": "600", "event
package": "message-summary", "content type":
"application/simple-message-summary", "id":
"NmU0MjI0NWM4ZjI3MWI3NTNlMTJhOWNlZWJlMWE0Yzg.", "ETag": ".", "outbound
proxy": "sip:127.0.0.1:5060;transport=udp", "extra_headers": "P-Flags: 0",
"body": "."}}' http://172.16.30.151:5060/JSON_RPC
*
*{*
*"jsonrpc":  "2.0",*
*"error":{*
*"code": 500,*
*"message":  "Internal error: failed to create context"*
*}*
*}*



*Jan 22 12:40:54 test kamailio: 16(26145) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2019-01-21 Thread Henning Westerholt
Am Montag, 21. Januar 2019, 19:10:11 CET schrieb Володимир Іванець:
> Are you able to generate PUBLISH message with jsonrpcs? I can only do it
> with xmlrpc. Kamailio version is 5.2.1.
> 
> When I use jsonrpc:

Hello,

not looked that deep into it, but have you tried to set an id (as reported 
from this error message?

Jan 21 19:37:58 test kamailio: 13(25583) ERROR: jsonrpcs [jsonrpcs_mod.c:
1010]: jsonrpc_delayed_ctx_new(): id attribute is missing

Best regards,

Henning

 
> *# curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc": "2.0",
> "method": "pua.publish", "params": {"presentity_uri":
> "sip:j...@test.tutpro.com ", "expires": "600",
> "event package": "message-summary", "content type":
> "application/simple-message-summary", "id": ".", "ETag": ".", "outbound
> proxy": "sip:127.0.0.1:5060;transport=udp", "extra_headers": "P-Flags: 0",
> "body": "."}}' http://172.16.30.151:5060/JSON_RPC
> *
> 
> I get:
> 
> *{*
> *"jsonrpc":  "2.0",*
> *"error":{*
> *"code": 500,*
> *"message":  "Internal error: failed to create context"*
> *}*
> 
> 
> Debug output:
> 
> *Jan 21 19:37:58 test kamailio: 13(25583) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2019-01-21 Thread Володимир Іванець
Hello!

Are you able to generate PUBLISH message with jsonrpcs? I can only do it
with xmlrpc. Kamailio version is 5.2.1.

When I use jsonrpc:

*# curl -H "Content-Type: application/json" -X POST -d '{"jsonrpc": "2.0",
"method": "pua.publish", "params": {"presentity_uri":
"sip:j...@test.tutpro.com ", "expires": "600",
"event package": "message-summary", "content type":
"application/simple-message-summary", "id": ".", "ETag": ".", "outbound
proxy": "sip:127.0.0.1:5060;transport=udp", "extra_headers": "P-Flags: 0",
"body": "."}}' http://172.16.30.151:5060/JSON_RPC
*

I get:

*{*
*"jsonrpc":  "2.0",*
*"error":{*
*"code": 500,*
*"message":  "Internal error: failed to create context"*
*}*


Debug output:

*Jan 21 19:37:58 test kamailio: 13(25583) DEBUG: 

Re: [SR-Users] MWI notification through pua.publish

2018-09-18 Thread willy

Hello Juha.

Thank you for reply.

It was my fault. Message content was invalid.

Lines must be ended with '\r\n'. Content must be ended by empty line.

Thank you,

willy


On 17/09/2018 10:18, Juha Heinanen wrote:

willy writes:


Have anyone tried to use pua.publish to send MWI notification? Can it
work at all?

I'm sending request through jsonrpc server, but it is not dispatched by
handle_publish.

It works fine here.  Last week I noticed an issue with pua.publish over
jsonrpc and it was fixed.  Even before the fix, pua.publish worked, but
an error message was issued.

-- Juha

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] MWI notification through pua.publish

2018-09-17 Thread Juha Heinanen
willy writes:

> Have anyone tried to use pua.publish to send MWI notification? Can it 
> work at all?
> 
> I'm sending request through jsonrpc server, but it is not dispatched by 
> handle_publish.

It works fine here.  Last week I noticed an issue with pua.publish over
jsonrpc and it was fixed.  Even before the fix, pua.publish worked, but
an error message was issued.

-- Juha

___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] MWI notification through pua.publish

2018-09-17 Thread willy

Hello.

Have anyone tried to use pua.publish to send MWI notification? Can it 
work at all?


I'm sending request through jsonrpc server, but it is not dispatched by 
handle_publish.


Thank you,

Kirill




___
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users