From volodyaivanets@gmail.com Wed Jan 23 12:39:57 2019 From: =?utf-8?b?0JLQvtC70L7QtNC40LzQuNGAINCG0LLQsNC90LXRhtGM?= To: sr-users@lists.kamailio.org Subject: Re: [SR-Users] MWI notification through pua.publish Date: Wed, 23 Jan 2019 13:39:36 +0200 Message-ID: In-Reply-To: <79e78813-18eb-3c43-24d0-81a021814b87@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1429030431==" --===============1429030431== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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! =D1=81=D1=80, 23 =D1=81=D1=96=D1=87. 2019 =D0=BE 10:05 Daniel-Constantin Mier= la =D0=BF=D0=B8=D1=88=D0=B5: > 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#idm10280= 42236 > > Cheers, > Daniel > On 22.01.19 17:58, =D0=92=D0=BE=D0=BB=D0=BE=D0=B4=D0=B8=D0=BC=D0=B8=D1=80 = =D0=86=D0=B2=D0=B0=D0=BD=D0=B5=D1=86=D1=8C 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:jh(a)test.tutpro.com ", "expires": "600", > "event package": "message-summary", "content type": > "application/simple-message-summary", "id": "4ce8c647a7b947c(a)172.16.30.151 > <4ce8c647a7b947c(a)172.16.30.151>", "ETag": ".", "outbound proxy": > "sip:127.0.0.1:5060;transport=3Dudp", "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: