Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread mrsanvicente
Hi Ovidiu,

Thanks for taking the time for explaining.  I am sure some of us can take 
advantage of
It!

Mario San Vicente
Best regards

> El 3 nov 2020, a la(s) 22:51, Ovidiu Sas  escribió:
> 
> Hello Mario,
> 
> If you have CP working fine, you don't really need mi_html.
> If you want to have it as an alternative, load the module and set a
> new root path:
> modparam("mi_html", "root", "opensips_mi")
> Then you should be able to access the embedded management interface
> via http://[OPENSIPS_HTTPD_IP]:[OPENSIPS_HTTPD_PORT]/opensips_mi
> 
> This interface has nothing to do with CP. It's an alternative to
> opensipsctl, opensips-cli or CP (for dispatching management commands
> to opensips). The module was written to provide easy access to mi
> commands using a web browser (using the embedded web server from
> opensips - no need to use a dedicated web server).
> 
> The old name of the module was mi_http and was renamed to mi_html.
> The old mi_json was renamed to mi_http.
> No more mi_json, welcome mi_html and mi_http was "rebranded":
> mi_json [v<=2.4.x] -> mi_http [v>=3.0.x]
> mi_http [v<=2.4.x] -> mi_html [v>=3.0.x]
> This created some confusion when migrating from pre 2.4.x to post
> 3.0.x opensips versions.
> Clear as mud? :)
> 
> Hope this helps,
> Ovidiu
> 
>> On Tue, Nov 3, 2020 at 4:59 PM Mario San Vicente  
>> wrote:
>> 
>> Hello Răzvan /  Ovidiu,
>> 
>> After disabling mi_html, my CP is working fine, i will be enabling more 
>> modules on it.   Thanks for your help!
>> 
>> Ovidiu,   It would be good to have both portals running,but  i am not 
>> getting to work the following comment:
>> "If you want to keep mi_html, then set a different root path: 
>> #modparam("mi_html", "root", "osips_mi")  ", any other hint?
>> 
>> Thank you!
>> 
>> 
>> 
>> 
>> 
>>> On Tue, Nov 3, 2020 at 8:22 AM Ovidiu Sas  wrote:
>>> 
>>> Hello Mario,
>>> 
>>> It seems that you have both mi_http and mi_html modules loaded.
>>> By default, both modules have the root path set to mi and one of the
>>> modules is stealing the root path from the other.
>>> In your case, when you hit http://x.x.x.x:/mi , you are hitting a
>>> standalone management interface that is not part of opensips-cp. It's
>>> an alternative way to run mi commands through a web interface.
>>> 
>>> If you want to have only opensips-cp, then umload mi_html.
>>> If you want to keep mi_html, then set a different root path:
>>> #modparam("mi_html", "root", "osips_mi")
>>> 
>>> Hope this helps,
>>> Ovidiu
>>> 
>>> On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
>>>  wrote:
 
 Hello  Răzvan ,
 I was wrong with my diagnosis, cause i stopped receiving the http / 400 
 error.  But when trying to monitor calls i see that the portal is not 
 reflecting the real info, i tested dialogs and rtpproxy.
 I do see the json reply on a trace, but it is not updated on the portal:
 
 T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
  POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
 application/json..Content-Length: 
 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
  show"}"id..._";i#4
 #
 T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
  ..._..k#)...
 #
 T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
  HTTP/1.1 200 OK..Content-Length: 136..Content-Type: 
 application/json..Date: Sat, 31 Oct 2020 17:34:22 
 GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
  
 ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
 
 T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
  POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
 application/json..Content-Length: 
 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
  ,"params":{"index":0,"counter":20}}._J.
 #
 T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
  @.._
 #
 T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
  HTTP/1.1 200 OK..Content-Length: 58..Content-Type: 
 application/json..Date: Sat, 31 Oct 2020 17:42:14 
 GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
  gs":[]},"id":1}._4...4.
 
 Aside notes:
 When enabling this line #modparam("mi_http", "root", "opensips_mi") , i 
 can see the mi portal.  http://x.x.x.x:/mi , which has lots of 
 aditional info,  but i have to disable it to get the json response and 
 just get an http response pointing to the mi interface:
 T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
  HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: 
 Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management 
 Interface
  >>> type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
  grande",verdana,geneva,aria
  
 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Ovidiu Sas
Hello Mario,

If you have CP working fine, you don't really need mi_html.
If you want to have it as an alternative, load the module and set a
new root path:
modparam("mi_html", "root", "opensips_mi")
Then you should be able to access the embedded management interface
via http://[OPENSIPS_HTTPD_IP]:[OPENSIPS_HTTPD_PORT]/opensips_mi

This interface has nothing to do with CP. It's an alternative to
opensipsctl, opensips-cli or CP (for dispatching management commands
to opensips). The module was written to provide easy access to mi
commands using a web browser (using the embedded web server from
opensips - no need to use a dedicated web server).

The old name of the module was mi_http and was renamed to mi_html.
The old mi_json was renamed to mi_http.
No more mi_json, welcome mi_html and mi_http was "rebranded":
mi_json [v<=2.4.x] -> mi_http [v>=3.0.x]
mi_http [v<=2.4.x] -> mi_html [v>=3.0.x]
This created some confusion when migrating from pre 2.4.x to post
3.0.x opensips versions.
Clear as mud? :)

Hope this helps,
Ovidiu

On Tue, Nov 3, 2020 at 4:59 PM Mario San Vicente  wrote:
>
> Hello Răzvan /  Ovidiu,
>
> After disabling mi_html, my CP is working fine, i will be enabling more 
> modules on it.   Thanks for your help!
>
> Ovidiu,   It would be good to have both portals running,but  i am not getting 
> to work the following comment:
> "If you want to keep mi_html, then set a different root path: 
> #modparam("mi_html", "root", "osips_mi")  ", any other hint?
>
> Thank you!
>
>
>
>
>
> On Tue, Nov 3, 2020 at 8:22 AM Ovidiu Sas  wrote:
>>
>> Hello Mario,
>>
>> It seems that you have both mi_http and mi_html modules loaded.
>> By default, both modules have the root path set to mi and one of the
>> modules is stealing the root path from the other.
>> In your case, when you hit http://x.x.x.x:/mi , you are hitting a
>> standalone management interface that is not part of opensips-cp. It's
>> an alternative way to run mi commands through a web interface.
>>
>> If you want to have only opensips-cp, then umload mi_html.
>> If you want to keep mi_html, then set a different root path:
>> #modparam("mi_html", "root", "osips_mi")
>>
>> Hope this helps,
>> Ovidiu
>>
>> On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
>>  wrote:
>> >
>> > Hello  Răzvan ,
>> > I was wrong with my diagnosis, cause i stopped receiving the http / 400 
>> > error.  But when trying to monitor calls i see that the portal is not 
>> > reflecting the real info, i tested dialogs and rtpproxy.
>> > I do see the json reply on a trace, but it is not updated on the portal:
>> >
>> > T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
>> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
>> > application/json..Content-Length: 
>> > 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
>> >   show"}"id..._";i#4
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
>> >   ..._..k#)...
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
>> >   HTTP/1.1 200 OK..Content-Length: 136..Content-Type: 
>> > application/json..Date: Sat, 31 Oct 2020 17:34:22 
>> > GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
>> >   
>> > ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
>> > 
>> > T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
>> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
>> > application/json..Content-Length: 
>> > 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
>> >   ,"params":{"index":0,"counter":20}}._J.
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
>> >   @.._
>> > #
>> > T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
>> >   HTTP/1.1 200 OK..Content-Length: 58..Content-Type: 
>> > application/json..Date: Sat, 31 Oct 2020 17:42:14 
>> > GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
>> >   gs":[]},"id":1}._4...4.
>> >
>> > Aside notes:
>> > When enabling this line #modparam("mi_http", "root", "opensips_mi") , i 
>> > can see the mi portal.  http://x.x.x.x:/mi , which has lots of 
>> > aditional info,  but i have to disable it to get the json response and 
>> > just get an http response pointing to the mi interface:
>> > T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
>> >   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: 
>> > Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management 
>> > Interface
>> >   > > type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
>> >  grande",verdana,geneva,aria
>> >   
>> > l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
>> >   .foot 
>> > a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}> >  http-equiv="Expires" content="0">> >   "Pragma" content="no-cache">> > href="https://opensips.org/favicon.png;>.> > 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Mario San Vicente
Hello Răzvan /  Ovidiu,

After disabling mi_html, my CP is working fine, i will be enabling more
modules on it.   Thanks for your help!

Ovidiu,   It would be good to have both portals running,but  i am not
getting to work the following comment:
"If you want to keep mi_html, then set a different root
path: #modparam("mi_html", "root", "osips_mi")  ", any other hint?

Thank you!





On Tue, Nov 3, 2020 at 8:22 AM Ovidiu Sas  wrote:

> Hello Mario,
>
> It seems that you have both mi_http and mi_html modules loaded.
> By default, both modules have the root path set to mi and one of the
> modules is stealing the root path from the other.
> In your case, when you hit http://x.x.x.x:/mi , you are hitting a
> standalone management interface that is not part of opensips-cp. It's
> an alternative way to run mi commands through a web interface.
>
> If you want to have only opensips-cp, then umload mi_html.
> If you want to keep mi_html, then set a different root path:
> #modparam("mi_html", "root", "osips_mi")
>
> Hope this helps,
> Ovidiu
>
> On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
>  wrote:
> >
> > Hello  Răzvan ,
> > I was wrong with my diagnosis, cause i stopped receiving the http / 400
> error.  But when trying to monitor calls i see that the portal is not
> reflecting the real info, i tested dialogs and rtpproxy.
> > I do see the json reply on a trace, but it is not updated on the portal:
> >
> > T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
> application/json..Content-Length:
> 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
> >   show"}"id..._";i#4
> > #
> > T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
> >   ..._..k#)...
> > #
> > T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
> >   HTTP/1.1 200 OK..Content-Length: 136..Content-Type:
> application/json..Date: Sat, 31 Oct 2020 17:34:22
> GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
> >
>  
> ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
> > 
> > T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
> >   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
> application/json..Content-Length:
> 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
> >   ,"params":{"index":0,"counter":20}}._J.
> > #
> > T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
> >   @.._
> > #
> > T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
> >   HTTP/1.1 200 OK..Content-Length: 58..Content-Type:
> application/json..Date: Sat, 31 Oct 2020 17:42:14
> GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
> >   gs":[]},"id":1}._4...4.
> >
> > Aside notes:
> > When enabling this line #modparam("mi_http", "root", "opensips_mi") , i
> can see the mi portal.  http://x.x.x.x:/mi , which has lots of
> aditional info,  but i have to disable it to get the json response and just
> get an http response pointing to the mi interface:
> > T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
> >   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date:
> Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management
> Interface
> >type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
> grande",verdana,geneva,aria
> >
>  
> l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
> >   .foot
> a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;} http-equiv="Expires" content="0"> >   "Pragma" content="no-cache">https://opensips.org/favicon.png;>. bgcolor="#ff" l
> >   ink="#00" text="#00" vlink="#00"> cellpadding="5" width="100%%" border="0"> colspan=2 valign
> >   ="top" align="left" bgcolor="#EFF7FF" width="100%%"> align="center">OpenSIPS MI HTML InterfaceOpenSIPS
> (3.1.0-dev (x86_6
> >   4/linux)) is running since Sat Oct 31 11:55:35
> 2020.. cellpadding="3" cellspacing="0"> >   >.statistics. href='/mi/core'>core. href='/mi/blacklists'>blacklists.httpd.tm. href='/mi/usrloc'>usrloc. href='/mi/dialog'>dialog.nathelper. href='/mi/rtpproxy'>rtpproxy. href='/mi/db_text'>db_text.drouti
> >   ng class="foot" style="margin:20px auto"> style='margin-left:5px;'>OpenSIPS web siteCopyright 
> 2011-2015 http://www.voipembedded.com/;>VoIP Embedded, Inc..
> All rights res
> >   erved!.._X.t.4
> >
> > Thank in advace.
> >
> >
> > On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente <
> mrsanvice...@gmail.com> wrote:
> >>
> >> Hello  Răzvan ,
> >>
> >> Thanks alot, that made the trick.
> >>
> >> I will check if something is not matching with the monit page cause
> that is not working ,  but that's another story.
> >>
> >> Best regards.
> >> Mario
> >>
> >>
> >>
> >>
> >>
> >> On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea 
> wrote:
> >>>
> >>> As I see in your logs, OpenSIPS CP uses the 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Ovidiu Sas
Hello Mario,

It seems that you have both mi_http and mi_html modules loaded.
By default, both modules have the root path set to mi and one of the
modules is stealing the root path from the other.
In your case, when you hit http://x.x.x.x:/mi , you are hitting a
standalone management interface that is not part of opensips-cp. It's
an alternative way to run mi commands through a web interface.

If you want to have only opensips-cp, then umload mi_html.
If you want to keep mi_html, then set a different root path:
#modparam("mi_html", "root", "osips_mi")

Hope this helps,
Ovidiu

On Sat, Oct 31, 2020 at 1:58 PM Mario San Vicente
 wrote:
>
> Hello  Răzvan ,
> I was wrong with my diagnosis, cause i stopped receiving the http / 400 
> error.  But when trying to monitor calls i see that the portal is not 
> reflecting the real info, i tested dialogs and rtpproxy.
> I do see the json reply on a trace, but it is not updated on the portal:
>
> T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
>   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
> application/json..Content-Length: 
> 49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
>   show"}"id..._";i#4
> #
> T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
>   ..._..k#)...
> #
> T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
>   HTTP/1.1 200 OK..Content-Length: 136..Content-Type: application/json..Date: 
> Sat, 31 Oct 2020 17:34:22 GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
>   
> ":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4
> 
> T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
>   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
> application/json..Content-Length: 
> 78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
>   ,"params":{"index":0,"counter":20}}._J.
> #
> T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
>   @.._
> #
> T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
>   HTTP/1.1 200 OK..Content-Length: 58..Content-Type: application/json..Date: 
> Sat, 31 Oct 2020 17:42:14 GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
>   gs":[]},"id":1}._4...4.
>
> Aside notes:
> When enabling this line #modparam("mi_http", "root", "opensips_mi") , i can 
> see the mi portal.  http://x.x.x.x:/mi , which has lots of aditional 
> info,  but i have to disable it to get the json response and just get an http 
> response pointing to the mi interface:
> T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
>   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: Sat, 
> 31 Oct 2020 17:55:45 GMTOpenSIPS Management Interface
>type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
>  grande",verdana,geneva,aria
>   
> l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
>   .foot 
> a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}  http-equiv="Expires" content="0">   "Pragma" content="no-cache"> href="https://opensips.org/favicon.png;>. bgcolor="#ff" l
>   ink="#00" text="#00" vlink="#00"> cellpadding="5" width="100%%" border="0"> valign
>   ="top" align="left" bgcolor="#EFF7FF" width="100%%"> align="center">OpenSIPS MI HTML InterfaceOpenSIPS 
> (3.1.0-dev (x86_6
>   4/linux)) is running since Sat Oct 31 11:55:35 
> 2020.. cellpadding="3" cellspacing="0">   >.statistics. href='/mi/core'>core. href='/mi/blacklists'>blacklists.httpd.tm. href='/mi/usrloc'>usrloc. href='/mi/dialog'>dialog.nathelper. href='/mi/rtpproxy'>rtpproxy. href='/mi/db_text'>db_text.drouti
>   ng class="foot" style="margin:20px auto"> style='margin-left:5px;'>OpenSIPS web siteCopyright  2011-2015  href="http://www.voipembedded.com/;>VoIP Embedded, Inc.. All rights res
>   erved!.._X.t.4
>
> Thank in advace.
>
>
> On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente  
> wrote:
>>
>> Hello  Răzvan ,
>>
>> Thanks alot, that made the trick.
>>
>> I will check if something is not matching with the monit page cause that is 
>> not working ,  but that's another story.
>>
>> Best regards.
>> Mario
>>
>>
>>
>>
>>
>> On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea  wrote:
>>>
>>> As I see in your logs, OpenSIPS CP uses the `json` URL path for querying
>>> MI, whereas the default root path is `mi`[1]. Either change the `root`
>>> to `json`, or modify your OpenSIPS CP boxes config to `mi`.
>>>
>>> [1] https://opensips.org/docs/modules/3.1.x/mi_http.html#param_root
>>>
>>> Best regards,
>>>
>>> Răzvan Crainea
>>> OpenSIPS Core Developer
>>> http://www.opensips-solutions.com
>>>
>>> On 10/28/20 11:23 PM, Mario San Vicente wrote:
>>> >Thanks for the answer Johan,
>>> >
>>> > But i see that; the *mi_json* module has been renamed to
>>> > *mi_http* module.  and so: failed to load module mi_json.so
>>> > 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

2020-11-03 Thread Răzvan Crainea
I am not sure why you're saying it is not reflecting the real info - I 
can see the MI returning data for rtpproxy, are you sure that's not 
correct? And you're probably not having any ongoing calls, that's why 
dlg_list returns 0.
Running MI HTTP is a completely different story, what you're showing us 
is probably the output of the `which` command, enclosed in HTTP tags; 
you should try to run the `which` command as well through the CP, to 
have a comparison ground.

But I believe your setup is OK now.

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 10/31/20 7:57 PM, Mario San Vicente wrote:

Hello Răzvan ,
I was wrong with my diagnosis, cause i stopped receiving the http / 400 
error.  But when trying to monitor calls i see that the portal is not 
reflecting the real info, i tested dialogs and rtpproxy.

I do see the json reply on a trace, but it is not updated on the portal:

T 127.0.0.1:47632  -> 127.0.0.1: 
 [AP] #137
   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
application/json..Content-Length: 
49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_

   show"}"id..._";i#4
#
T 127.0.0.1:  -> 127.0.0.1:47632 
 [A] #138

   ..._..k#)...
#
T 127.0.0.1:  -> 127.0.0.1:47632 
 [AP] #139
   HTTP/1.1 200 OK..Content-Length: 136..Content-Type: 
application/json..Date: Sat, 31 Oct 2020 17:34:22 
GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes
   
":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4


T 127.0.0.1:47644  -> 127.0.0.1: 
 [AP] #204
   POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
application/json..Content-Length: 
78{"jsonrpc":"2.0","id":1,"method":"dlg_list"

   ,"params":{"index":0,"counter":20}}._J.
#
T 127.0.0.1:  -> 127.0.0.1:47644 
 [A] #205

   @.._
#
T 127.0.0.1:  -> 127.0.0.1:47644 
 [AP] #206
   HTTP/1.1 200 OK..Content-Length: 58..Content-Type: 
application/json..Date: Sat, 31 Oct 2020 17:42:14 
GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo

   gs":[]},"id":1}._4...4.

Aside notes:
When enabling this line #modparam("mi_http", "root", "opensips_mi") , i 
can see the mi portal. http://x.x.x.x:/mi , which has lots of 
aditional info,  but i have to disable it to get the json response and 
just get an http response pointing to the mi interface:
T 127.0.0.1:  -> 127.0.0.1:47654 
 [AP] #256
   HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date: 
Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management 
Interface
   type="text/css">body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida 
grande",verdana,geneva,aria
   
l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
   .foot 
a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}http-equiv="Expires" content="0">   "Pragma" content="no-cache">href="https://opensips.org/favicon.png;>.bgcolor="#ff" l
   ink="#00" text="#00" vlink="#00">cellpadding="5" width="100%%" border="0">colspan=2 valign
   ="top" align="left" bgcolor="#EFF7FF" width="100%%">align="center">OpenSIPS MI HTML InterfaceOpenSIPS 
(3.1.0-dev (x86_6
   4/linux)) is running since Sat Oct 31 11:55:35 
2020..cellpadding="3" cellspacing="0">   >.statistics.href='/mi/core'>core.href='/mi/blacklists'>blacklists.httpd.tm.href='/mi/usrloc'>usrloc.href='/mi/dialog'>dialog.nathelper.href='/mi/rtpproxy'>rtpproxy.href='/mi/db_text'>db_text.drouti
   ngclass="foot" style="margin:20px auto">style='margin-left:5px;'>http://opensips.org>">OpenSIPS web 
siteCopyright  2011-2015 href="http://www.voipembedded.com/;>VoIP Embedded, Inc.. All rights res

   erved!.._X.t.4

Thank in advace.


On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente 
mailto:mrsanvice...@gmail.com>> wrote:


Hello Răzvan ,

Thanks alot, that made the trick.

I will check if something is not matching with the monit page cause
that is not working ,  but that's another story.

Best regards.
Mario




On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea mailto:raz...@opensips.org>> wrote:

As I see in your logs, OpenSIPS CP uses the `json` URL path for
querying
MI, whereas the default root path is `mi`[1]. Either change the
`root`
to `json`, or modify your OpenSIPS CP boxes config to `mi`.

[1] 

Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

Hello  Răzvan ,
I was wrong with my diagnosis, cause i stopped receiving the http / 400
error.  But when trying to monitor calls i see that the portal is not
reflecting the real info, i tested dialogs and rtpproxy.
I do see the json reply on a trace, but it is not updated on the portal:

T 127.0.0.1:47632 -> 127.0.0.1: [AP] #137
  POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
application/json..Content-Length:
49{"jsonrpc":"2.0","id":1,"method":"rtpproxy_
  show"}"id..._";i#4
#
T 127.0.0.1: -> 127.0.0.1:47632 [A] #138
  ..._..k#)...
#
T 127.0.0.1: -> 127.0.0.1:47632 [AP] #139
  HTTP/1.1 200 OK..Content-Length: 136..Content-Type:
application/json..Date: Sat, 31 Oct 2020 17:34:22
GMT{"jsonrpc":"2.0","result":[{"Set":0,"Nodes

":[{"url":"udp:localhost:2123","index":0,"disabled":0,"weight":1,"recheck_ticks":0}]}],"id":1}.._..k#4

T 127.0.0.1:47644 -> 127.0.0.1: [AP] #204
  POST /mi HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
application/json..Content-Length:
78{"jsonrpc":"2.0","id":1,"method":"dlg_list"
  ,"params":{"index":0,"counter":20}}._J.
#
T 127.0.0.1: -> 127.0.0.1:47644 [A] #205
  @.._
#
T 127.0.0.1: -> 127.0.0.1:47644 [AP] #206
  HTTP/1.1 200 OK..Content-Length: 58..Content-Type:
application/json..Date: Sat, 31 Oct 2020 17:42:14
GMT{"jsonrpc":"2.0","result":{"count":0,"Dialo
  gs":[]},"id":1}._4...4.

Aside notes:
When enabling this line #modparam("mi_http", "root", "opensips_mi") , i can
see the mi portal.  http://x.x.x.x:/mi , which has lots of
aditional info,  but i have to disable it to get the json response and just
get an http response pointing to the mi interface:
T 127.0.0.1: -> 127.0.0.1:47654 [AP] #256
  HTTP/1.1 200 OK..Content-Length: 1886..Content-Type: text/html..Date:
Sat, 31 Oct 2020 17:55:45 GMTOpenSIPS Management
Interface
  body{margin:0;}body,p,div,td,th,tr,form,ol,ul,li,input,textarea,select,a{font-family:"lucida
grande",verdana,geneva,aria

l,helvetica,sans-serif;font-size:14px;}a:hover{text-decoration:none;}a{text-decoration:underline;}.foot{padding-top:40px;font-size:10px;color:#33;}
  .foot
a{font-size:10px;color:#00;}table.center{margin-left:auto;margin-right:auto;}https://opensips.org/favicon.png;>.OpenSIPS MI HTML InterfaceOpenSIPS
(3.1.0-dev (x86_6
  4/linux)) is running since Sat Oct 31 11:55:35
2020...statistics.core.blacklists.httpd.tm.usrloc.dialog.nathelper.rtpproxy.db_text.drouti
  ngOpenSIPS web siteCopyright  2011-2015
http://www.voipembedded.com/;>VoIP Embedded, Inc.. All rights
res
  erved!.._X.t.4

Thank in advace.


On Fri, Oct 30, 2020 at 8:45 PM Mario San Vicente 
wrote:

> Hello  Răzvan ,
>
> Thanks alot, that made the trick.
>
> I will check if something is not matching with the monit page cause that
> is not working ,  but that's another story.
>
> Best regards.
> Mario
>
>
>
>
>
> On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea 
> wrote:
>
>> As I see in your logs, OpenSIPS CP uses the `json` URL path for querying
>> MI, whereas the default root path is `mi`[1]. Either change the `root`
>> to `json`, or modify your OpenSIPS CP boxes config to `mi`.
>>
>> [1] https://opensips.org/docs/modules/3.1.x/mi_http.html#param_root
>>
>> Best regards,
>>
>> Răzvan Crainea
>> OpenSIPS Core Developer
>> http://www.opensips-solutions.com
>>
>> On 10/28/20 11:23 PM, Mario San Vicente wrote:
>> >Thanks for the answer Johan,
>> >
>> > But i see that; the *mi_json* module has been renamed to
>> > *mi_http* module.  and so: failed to load module mi_json.so
>> > https://www.opensips.org/Documentation/Migration-2-4-0-to-3-0-0
>> >
>> > I am using opensips 3.1
>> > I have this modules:
>> >
>> > loadmodule "httpd.so"
>> > modparam("httpd", "port", )
>> >  MI_HTTP module
>> > loadmodule "json.so"
>> > #loadmodule "mi_json.so"
>> > loadmodule "mi_http.so"
>> >
>> > Any other clue?
>> >
>> > Thank you
>> >
>> >
>> > ___
>> > Users mailing list
>> > Users@lists.opensips.org
>> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>> >
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>
>
> --
> Mario San Vicente
> Cheers!
>


-- 
Mario San Vicente
Cheers!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

Hello  Răzvan ,

Thanks alot, that made the trick.

I will check if something is not matching with the monit page cause that is
not working ,  but that's another story.

Best regards.
Mario





On Thu, Oct 29, 2020 at 3:49 AM Răzvan Crainea  wrote:

> As I see in your logs, OpenSIPS CP uses the `json` URL path for querying
> MI, whereas the default root path is `mi`[1]. Either change the `root`
> to `json`, or modify your OpenSIPS CP boxes config to `mi`.
>
> [1] https://opensips.org/docs/modules/3.1.x/mi_http.html#param_root
>
> Best regards,
>
> Răzvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
> On 10/28/20 11:23 PM, Mario San Vicente wrote:
> >Thanks for the answer Johan,
> >
> > But i see that; the *mi_json* module has been renamed to
> > *mi_http* module.  and so: failed to load module mi_json.so
> > https://www.opensips.org/Documentation/Migration-2-4-0-to-3-0-0
> >
> > I am using opensips 3.1
> > I have this modules:
> >
> > loadmodule "httpd.so"
> > modparam("httpd", "port", )
> >  MI_HTTP module
> > loadmodule "json.so"
> > #loadmodule "mi_json.so"
> > loadmodule "mi_http.so"
> >
> > Any other clue?
> >
> > Thank you
> >
> >
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>


-- 
Mario San Vicente
Cheers!
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

As I see in your logs, OpenSIPS CP uses the `json` URL path for querying 
MI, whereas the default root path is `mi`[1]. Either change the `root` 
to `json`, or modify your OpenSIPS CP boxes config to `mi`.


[1] https://opensips.org/docs/modules/3.1.x/mi_http.html#param_root

Best regards,

Răzvan Crainea
OpenSIPS Core Developer
http://www.opensips-solutions.com

On 10/28/20 11:23 PM, Mario San Vicente wrote:

   Thanks for the answer Johan,

But i see that; the *mi_json* module has been renamed to 
*mi_http* module.  and so: failed to load module mi_json.so

https://www.opensips.org/Documentation/Migration-2-4-0-to-3-0-0

I am using opensips 3.1
I have this modules:

loadmodule "httpd.so"
modparam("httpd", "port", )
 MI_HTTP module
loadmodule "json.so"
#loadmodule "mi_json.so"
loadmodule "mi_http.so"

Any other clue?

Thank you


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

  Thanks for the answer Johan,

But i see that; the *mi_json* module has been renamed to *mi_http* module.
and so:  failed to load module mi_json.so
 https://www.opensips.org/Documentation/Migration-2-4-0-to-3-0-0

I am using opensips 3.1

I have this modules:

loadmodule "httpd.so"
modparam("httpd", "port", )
 MI_HTTP module
loadmodule "json.so"
#loadmodule "mi_json.so"
loadmodule "mi_http.so"

Any other clue?

Thank you
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

You need to use mi_json

Outlook voor iOS<https://aka.ms/o0ukef> downloaden

Van: Users  namens Mario San Vicente 

Verzonden: Wednesday, October 28, 2020 8:06:09 PM
Aan: OpenSIPS users mailling list 
Onderwerp: [OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

Hello Everyone,

Here i have a quick question.

I installed opensips-cp 8.3.0 in a Centos installation from sources version: 
opensips 3.1.

I seems to me that  the configuration is fine, mysql DB, and users.

But Opensips-cp can't speak MI to opensips.

I get the following at trace level:

T 127.0.0.1:34550<http://127.0.0.1:34550> -> 
127.0.0.1:<http://127.0.0.1:> [AP] #144
  POST /json HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type: 
application/json..Content-Length: 
78{"jsonrpc":"2.0","id":1,"method":"dlg_lis
  t","params":{"index":0,"counter":20}}w.._
#
T 127.0.0.1:<http://127.0.0.1:> -> 
127.0.0.1:34550<http://127.0.0.1:34550> [A] #145
  8...w.._XZ..
#
T 127.0.0.1:<http://127.0.0.1:> -> 
127.0.0.1:34550<http://127.0.0.1:34550> [AP] #146
  HTTP/1.1 400 Bad Request..Content-Length: 46..Content-Type: text/html..Date: 
Wed, 28 Oct 2020 18:59:03 GMTUnable to parse URL!w.._C...
#

And at php level iget:

 [:error] [pid 17689] [client x.x.x.x:55303] PHP Warning:  Creating default 
object from empty value in 
/var/www/html/opensips-cp/config/tools/system/dialog/local.inc.php on line 27, 
referer: http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh
 [:error] [pid 17689] [client x.x.x.x:55303] PHP Notice:  Use of undefined 
constant CURLINFO_RESPONSE_CODE - assumed 'CURLINFO_RESPONSE_CODE' in 
/var/www/html/opensips-cp/web/common/mi_comm.php on line 50, referer: 
http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh
[:error] [pid 17689] [client x.x.x.x:55303] PHP Warning:  curl_getinfo() 
expects parameter 2 to be long, string given in 
/var/www/html/opensips-cp/web/common/mi_comm.php on line 50, referer: 
http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh
[:error] [pid 17689] [client x.x.x.x:55303] PHP Warning:  array_key_exists() 
expects parameter 2 to be array, null given in 
/var/www/html/opensips-cp/web/common/mi_comm.php on line 61, referer: 
http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh

 php -v
PHP 7.3.24 (cli)


Anyone have any idea why it fails??

Thank you very much
--
Mario SV
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] Opensips-cp 8.3.0 HTTP/1.1 400 Bad Request..

Hello Everyone,

Here i have a quick question.

I installed opensips-cp 8.3.0 in a Centos installation from
sources version: opensips 3.1.

I seems to me that  the configuration is fine, mysql DB, and users.

But Opensips-cp can't speak MI to opensips.

I get the following at trace level:

T 127.0.0.1:34550 -> 127.0.0.1: [AP] #144
  POST /json HTTP/1.1..Host: 127.0.0.1:..Accept: */*..Content-Type:
application/json..Content-Length:
78{"jsonrpc":"2.0","id":1,"method":"dlg_lis
  t","params":{"index":0,"counter":20}}w.._
#
T 127.0.0.1: -> 127.0.0.1:34550 [A] #145
  8...w.._XZ..
#
T 127.0.0.1: -> 127.0.0.1:34550 [AP] #146
  HTTP/1.1 400 Bad Request..Content-Length: 46..Content-Type:
text/html..Date: Wed, 28 Oct 2020 18:59:03 GMTUnable to
parse URL!w.._C...
#

And at php level iget:

 [:error] [pid 17689] [client x.x.x.x:55303] PHP Warning:  Creating default
object from empty value in
/var/www/html/opensips-cp/config/tools/system/dialog/local.inc.php on line
27, referer: http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh
 [:error] [pid 17689] [client x.x.x.x:55303] PHP Notice:  Use of undefined
constant CURLINFO_RESPONSE_CODE - assumed 'CURLINFO_RESPONSE_CODE' in
/var/www/html/opensips-cp/web/common/mi_comm.php on line 50, referer:
http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh
[:error] [pid 17689] [client x.x.x.x:55303] PHP Warning:  curl_getinfo()
expects parameter 2 to be long, string given in
/var/www/html/opensips-cp/web/common/mi_comm.php on line 50, referer:
http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh
[:error] [pid 17689] [client x.x.x.x:55303] PHP Warning:
 array_key_exists() expects parameter 2 to be array, null given in
/var/www/html/opensips-cp/web/common/mi_comm.php on line 61, referer:
http://x.x.x.x/cp/tools/system/dialog/dialog.php?action=refresh

 php -v
PHP 7.3.24 (cli)


Anyone have any idea why it fails??

Thank you very much
-- 
Mario SV
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users