[OpenSIPS-Users] xmlrpc_ng opensis 2.1 / 400 Bad request

Alain Bieuzent alain.bieuzent at free.fr
Wed Sep 2 14:53:23 CEST 2015


Hi Bogdan,

I found the issue, in opensips 1.11.5, default root path is "xmlrpc" and
in opensips 2.1 the default is "RPC2"

If you ask an opensips 2.1 with wrong root path, the response is 400 Bad
request.

After modify my script, it's ok,

thanks for your help.

Le 01/09/2015 21:21, Bogdan-Andrei Iancu a écrit :
> Hi Alan,
>
> Just tested with a simple Python script (with xmlrpclib class) like:
>
>     import xmlrpclib
>     opensips = xmlrpclib.ServerProxy('http://127.0.0.1:8888/RPC2')
>     print opensips.get_statistics('tm:')
>
>
> And here is the successful output:
>
> T 2015/09/01 22:18:59.709381 127.0.0.1:41540 -> 127.0.0.1:8888 [AP]
> POST /RPC2 HTTP/1.1.
> Host: 127.0.0.1:8888.
> Accept-Encoding: gzip.
> User-Agent: xmlrpclib.py/1.0.1 (by www.pythonware.com).
> Content-Type: text/xml.
> Content-Length: 161.
> .
> <?xml version='1.0'?>
> <methodCall>
> <methodName>get_statistics</methodName>
> <params>
> <param>
> <value><string>tm:</string></value>
> </param>
> </params>
> </methodCall>
>
>
> T 2015/09/01 22:18:59.710212 127.0.0.1:8888 -> 127.0.0.1:41540 [AP]
> HTTP/1.1 200 OK.
> Content-Length: 409.
> Content-Type: text/xml; charset=utf-8.
> Date: Tue, 01 Sep 2015 19:18:59 GMT.
> .
> <?xml version="1.0" encoding="UTF-8"?>.
> <methodResponse>.
> <params>.
> <param><value><string>tm:received_replies:: 0
> tm:relayed_replies:: 0
> tm:local_replies:: 0
> tm:UAS_transactions:: 0
> tm:UAC_transactions:: 0
> tm:2xx_transactions:: 0
> tm:3xx_transactions:: 0
> tm:4xx_transactions:: 0
> tm:5xx_transactions:: 0
> tm:6xx_transactions:: 0
> tm:inuse_transactions:: 0
> </string></value></param>.
> </params>.
> </methodResponse>.
>
> Regards,
> Bogdan-Andrei Iancu
> OpenSIPS Founder and Developer
> http://www.opensips-solutions.com
> On 01.09.2015 12:33, Alain Bieuzent wrote:
>> Hi all,
>>
>> I'trying to migrate my opensisps 1.11.5 to 2.1 and i have a probleme
>> with xmlrpc_ng
>>
>> When i post a request to my opensips 1.11.5, it work :
>>
>>     HTTP/1.1 200 OK   
>>     Content-Length: 452
>>     Content-Type: text/xml; charset=utf-8
>>     Date: Tue, 01 Sep 2015 09:23:31 GMT
>>
>>     <?xml version="1.0" encoding="UTF-8"?>
>>     <methodResponse>
>>     <params>
>>     <param><value><string>tm:received_replies:: 1331345
>>     tm:relayed_replies:: 902120
>>     tm:local_replies:: 422824
>>     tm:UAS_transactions:: 587390
>>     tm:UAC_transactions:: 41524
>>     tm:2xx_transactions:: 482865
>>     tm:3xx_transactions:: 0
>>     tm:4xx_transactions:: 137567
>>     tm:5xx_transactions:: 7074
>>     tm:6xx_transactions:: 171
>>     tm:inuse_transactions:: 2077
>>     </string></value></param>
>>     </params>
>>     </methodResponse>
>>
>> but when i run the same request on my opensips 2.1, the module return
>> a 400 Bad Request.
>>     HTTP/1.1 400 Bad Request
>>     Content-Length: 46
>>     Content-Type: text/xml; charset=utf-8
>>     Date: Tue, 01 Sep 2015 09:23:42 GMT
>>
>> Is there a change in opensips 2.1 ?
>>
>> my request :
>>
>> <?xml version='1.0'?>
>> <methodCall>
>> <methodName>get_statistics</methodName>
>> <params>
>>  <param><value><string>tm:</string></value></param>
>> </params>
>> </methodCall>
>>
>> thanks
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20150902/93119cbd/attachment.htm>


More information about the Users mailing list