Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

How to Query online user from client?

huyours
2012-04-10
2013-05-09
  • huyours
    huyours
    2012-04-10

    I am learning develop on Opensips.  Now I want to develop on interface so that client software can get online user list.  I know of "opensipsctl show online ", but I do not know where is its source code. So could any one tell me sth on this.
    1, let me know the opensips show online souce code f ile
    2, Could I query the status from database ?

     
  • Why not using the MI interface (which can be reached via FIFO, UDP, XMLRPC) with the ul_dump function (http://www.opensips.org/html/docs/modules/1.7.x/usrloc.html#id293412)

    If you want to look into DB, check the "location" table, but the info may not be accurate, depending on what db_mode are you using.

     
  • huyours
    huyours
    2012-04-11

    Thanks Bogdan,
                   I am fresh man on sip developing. really no idea on the existing interface. could you show some samples how to use ud_dump?  what I want to do is client side could get the online status of personal contacts. My client is android project Csipsimple.
                 

     
  • huyours
    huyours
    2012-04-11

    Or is there socket interface on Opensips for client to get online user information ?

     
  • what interfacing do you want to use ? FIFO file ? UDP packages ? XMLRPC ?

     
  • huyours
    huyours
    2012-04-12

    I have not clear understanding on the difference of the three ways.
    It seems that all of them are used on server''s side, I must  develop a service to read the imformation, then the client connect to my service , right ?  If so, I wnat to try FIFO and UDP interfaces. Please help.
    And Could I connect the interface from other computer or client ? I think this because I hope run Opensips and my Webservice seperatly.
    Thanks.

     
  • huyours
    huyours
    2012-04-13

    hello, dear , help me please. (-_-)

     
  • huyours
    huyours
    2012-04-16

    hello, anybody home?

     
  • FIFO is used for local access only (if you want to query opensips from the same machine). For remote querying , better use UDP or XMLRPC for accessing the Management Interface.

     
  • huyours
    huyours
    2012-04-18

    Dear bogdan,
    Happy to see you again.
    Could you show some samples about how to use UDP interface?  I will develop client on Java. If C progam is neccesary to access the interface, I think I can do that.
    Thanks.

     
  • You can simply send an UDP package with ":ps:" to list opensips processes:
          echo ":ps:" | nc -u 127.0.0.1 4343