Association.ConnectedIP return 0.0.0.0

  • Hi Marcel


    I am adding a "push" button on the nh_queryseries.lua page which push images only to current client computer. I have a dcmtk storescp service running on the client. I tried Association.ConnectedIP and it returns 0.0.0.0 to me. Is there a way to get the web client ip address which I am using it to find the AE title in the amap and send the series using mode=moveseries.


    Many thanks,
    Lucy

  • Hi Lucy,


    you have the standard CGI variables:


    lua_setvar(&globalPDU, "query_string", getenv( "QUERY_STRING"));
    lua_setvar(&globalPDU, "server_name", getenv( "SERVER_NAME" ));
    lua_setvar(&globalPDU, "script_name", getenv( "SCRIPT_NAME" ));
    lua_setvar(&globalPDU, "path_translated", getenv( "PATH_TRANSLATED" ));


    That should suffice. The Association object relates to DICOM communication not web communication.


    Marcel

  • Hi Marcel


    Thanks for the code. I added these lines in a function of nh_queryseries.lua and I got lua run error: unexpected symbol near '&'. So I removed '&' and then error says: attempt to call global getenv(a nil value). And finally I changed to os.genenv and now it says: attempt to call global lua_setvar (a nil value).


    I tried getpeername() with different combination like server:getpeername() and conn:getpeername() but all of them give me similar errors. Maybe my LUA environment was not set correctly?


    Lucy


  • Sorry I misunderstood. Now I got all information from these four variables but I can't find the client IP address in them? I need the IP to match the AET in the acrnema map in order to send it to this specific client computer.


    by the way, the variable "path_translated" is NULL in my page.


    thanks,
    Lucy


    Quote from marcelvanherk

    Sorry I meant that these variables are defined:


    query_string
    server_name
    script_name
    path_translated


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!