We are developing an application in that we are providing VOIP feature using pjsip.We done every thing well upto registration process and adding friends .But We are facing some problems regarding to friends online status.
I explain my problem indetail..For suppose 'user1' is login and has one friend 'user2' then user2 is offline it is correct(b'coz user2 still not login) when user2 login and has one friend user1 then user1 is online it is correct(b'coz user1 already logedin) but user2 is not shown online in user1's friends
can any one solve my problem ,i stuck here for last 3 days. thanks inadvance
Here's a simple exercise using PJSUA app which should help you solve your problem
Start PJSUA app (on default port). Call this pjsua-app1.
Start another instance of PJSUA on another port. Call this pjsua-app2.
To pjsua-app1 add account user1#a.b.c.d:p, to pjsua-app2 add account user2#a.b.c.d:q
To pjsua-app1 add buddy user2 and to pjsua-app2 add buddy user1
On both apps subscribe presence.
You should see them online if they are logged in
Related
I would like to create an app that a user goes to and is able to create a meetings where they are the host
looking through the api documentation, I have only been able to create a app where i go create a meeting and I am the host
I don't want to share my user/pass with other users so they can host through my site.
is this even possible,
this is less a code question, I know, but where else to ask?
-what i tried before, - creating an app, but i am the one that has to log in to host.
I have been struggling to configure a group chat using conversejs and ejabberd. From the documentation I've stumbled across, it seems like it is possible to have a persistent group chat that users can be subscribed to, which will allow them to receive messages from the group chat while not present in the group chat.
For example: I would like to be able to simply close the group chat on my conversejs client, but still get notifications from that group chat.
This is a fresh ejabberd 21.04 and conversejs 7.0.6 install (using websockets).
What I tried to do was create a room through the conversejs client, and then add a subscription through the ejabberd cli:
ejabberdctl subscribe_room user#my.example.com/muc user test_room#conference.my.example.com urn:xmpp:mucsub:nodes:messages
One of the things I'm most confused by is the field in the configuration panel of a group chat that is titled "XMPP URI of Associated Publish-Subscribe Node." I have no clue how to format this, but have found a few clues online... What I have tried is a number of different configurations of something like:
xmpp:my.example.com?;node=messages
but I'm really just grasping at straws here.
If anyone can help me figure out what I'm doing wrong with this URI, or can show me a working example of this, that would be amazing. If what I'm trying to do simply isn't possible with XMPP, please let me know as well.
Thanks!
it is possible to have a persistent group chat that users can be subscribed to, which will allow them to receive messages from the group chat while not present in the group chat.
Exactly.
ejabberdctl create_room room1 conf.localhost localhost
ejabberdctl change_room_option room1 conf.localhost persistent true
ejabberdctl change_room_option room1 conf.localhost allow_subscription true
ejabberdctl subscribe_room user1#localhost User1 room1#conf.localhost urn:xmpp:mucsub:nodes:messages
Now I'll use the send_message API call to send a message to the room. This requires the sender to be online, so for this example register and login to admin#localhost. And of course, login to user1#localhost to receive the notification from the room. Those clients do not need to join the room.
ejabberdctl send_message groupchat admin#localhost room1#conf.localhost Sub Body
I'm making a simple app in swift, and have users, photos, and friends table in Postgres and store photos in S3. The app functions with simple REST calls. I'm having an issue with the following:
User A sends a friend request to User B
Friend Table: sender_id: UserA_id, receiver_id: UserB_id, status: 'pending'
Now, on the device, UserB is added to UserA's pendingFromMe's friends. Now, how at the same time do I update UserB's pendingToMe's friends on a separate device?
A couple options I have thought of
Postgres Listen - This is bad as 500 connection limit means this won't work
APN would send a Push Notification to UserB and run a function to re-download friends list
Any other options? How would I go about doing this? There are NO tutorials outside of Parse/Firebase and I don't want to use BaaS since I've built my own REST server.
Thanks!
Will accept links to tutorials for this, github repos, etc
If you orchestrate, your facade should call your user service to update the status on both users then invoke the notification service to push to both devices.
If you're event-based, your user service should probably listen to status update events and update the other user's status then fire an event which your notification service should handle to push to the involved devices.
I tried that code: http://www.flynsarmy.com/2012/02/php-websocket-chat-application-2-0/
and it works very fine. But that's not really what I looked for.
That code creates a "room", with only one "instance" of websocket. I would like to have as much instances as "one-to-one conversations" like FB.
Someone has any idea how to make privates conversations websocket's chat?
tl;dr: if there are 3 conversations (6 people), I would like to create automatically 3 "rooms".
Thank you so much.
Regards
This could still be handled by one websocket server instance. You'll just have to store for each user1 the corresponding user2. Everytime user1 sends a message it will be forwarded only to user2 and vice versa. To avoid redundant data, you should store the relation between user1 and user2 only once, of course.
I need to include chat, in my application. People sign in the chat and create their user and chat to other users. However it needs to be like facebook chat or pingchat where you add friends you want to talk to.
Can anyone give me pointers to what i need to do? I've heard about xmpp servers but not sure if that is the right thing for my app. Any help would be much appreciated
Thanks
Is your app going to create new users, and add them in the chat list, or going to use existing users (like Gtalk, Y! Messenger etc) on existing protocols (like IRC, XMPP etc)...?
If you are going to implement your own chat system, where your users are registering in your website, then you are going to do these things:
Setup your website
Create a protocol (that's, how you pass messages)
Write and implement an API (in PHP, ASP etc)
Connect that API with your iPhone app.
How it works?
You keep a table of chat messages. The table include:
Chat_From
Chat_To
Chat_Message
Timestamp
All what you do is, when you start a Chat session from Alice to Bob, you just enter them in the table. Next, you fetch the row from the Web Server to your App, by calling your PHP file (say, http://mychatserver.com/getChat.php) based on the condition SELECT CHAT_MESSAGE FROM CHAT_TABLE WHERE CHAT_FROM="ALICE" AND CHAT_TO="BOB";. This message is displayed in your App.
This process should be performed repeatedly, with an interval of, say 1 sec.
I hope you got this idea.