JAIN SIP - between requests - jain-sip

How can I link two or more RequestEvent's to know that it comes from the same user?
ServerTransaction cannot be used, as it can be more during the same connection.

The Dialog links multiple requests if you opt for Dialog-stateful mode. Otherwise you can just link them yourself based on the Call-ID and tags.

Related

Sendgrid: how to use different tracking settings for different sets of messages

My application needs to send some messages with tracking activated and other messages without tracking.
When using Sendgrid, many settings, among them tracking settings, can be set using the admin web interface, and these settings will be used for all subsequent messages sent.
But is it possible to have different settings for different sets (or categories ?) of messages, and have the application define which settings to use when sending a given message through API ?
Or maybe define the tracking settings as part of the send API parameters ?
Yes. When sending via the v3 API, there's a tracking_settings field, where you can dynamically enable/disable settings for just that message.
There's a similar option when using the SMTPAPI JSON header.
I have similar problem.
After some investigation found two satisfactory solutions.
The fist one - integrate with google analytic.
The second - we moved all dynamic templates into application (also due to sg limitation for dynamic content) and added specific utm tags (UTM_SOURCE, UTM_CONTENT, UTM_MEDIUM, UTM_CAMPAIGN, UTM_TERM;) to each letter. And after user click on emails content FE process this tags.

XMPP whitelists?

We have an enterprise installation of QuickBlox (which implements XMPP), and would like to create mirrored accounts for all of our users on our QuickBlox server install. We also want to sync the networks our system's users have created using relationships (eg, "client and provider") that have been built on our system.
In a nutshell, we want to export whitelists that limit chat "opponents" to only those users with whom each of our users already have relationships. If User1 has an existing relationship in our system with User2 and User3 but not User4 through User40, we want to be able to use the QuickBlox API to enforce that within chat by creating a whitelist through the QuickBlox API.
EDIT: We can't use an "honor system" whitelist. That is, the enforcement must be server-side using a method the client cannot circumvent. There must be a hard, unavoidable block between users for privacy concerns.
Use case:
A QuickBlox (or XMPP) server has User1 through User40, inclusive.
User1's whitelist is comprised of [User2, User3] only.
If User1 attempts to contact User15, we want QuickBlox/XMPP to note that User15 is not on User1's whitelist and block that communication as if User1 had bidirectionally blocked that user.
Privacy lists, aka blacklists
I have found places in QB's docs that refer to the XMPP specification docs, and have found the concept of privacy lists, which seem to operate as blacklists:
https://quickblox.com/developers/Web_XMPP_Chat_Sample#Privacy_lists
https://xmpp.org/extensions/xep-0016.html#protocol-syntax
These only provide two styles of blacklist privacy:
You can choose a type of blocked logic (Privacy List). There are 2
types:
Block in one way. You are blocked, but you can write to
blocked user.
Block in two ways. You are blocked and you also can't
write to blocked user.
Server Whitelist (dialog-level, not user)
I've also found documentation on whitelists for servers, which appear to operate at a dialog/jid, not user, level:
https://xmpp.org/extensions/xep-0133.html#edit-whitelist
An entity added to a whitelist MAY be a JID of any form as specified in RFC 6120... a whitelist may prevent inbound communications, outbound communications, or both...
Rosters -- "presence" detail only?
There are also rosters, which are close to whitelists, but they do not seem in my testing to restrict communication between any two users that might not be on each other's roster.
https://quickblox.com/developers/Web_XMPP_Chat_Sample#Get_the_roster
That is to say, I haven't set up a roster in my testing application, and users are able to create group and 1-on-1 chat dialogs in spite of not having explicitly accepted any roster requests. In the Android docs, I found the following on rosters: "[A roster] is the collection of users a person receives presence updates for." That's not blocking in any way outside of presence alerts, I don't believe.
Question
Is there a suggested way to create a pessimistic whitelist for each user, which only contain those users with whom communication is allowed? Or are we forced to create and maintain "inverse blacklists", where we automate the creation of privacy lists for every new user blocking every other user and then use the API to remove those with which each user should be able to communicate?
If we do have to use "inverse blacklists", is there a way to have a default blacklist apply to every new user that initially blocks communication with every other user already in our QuickBlox system?
(Again, we can't use "honor system" lists. If the client must request a whitelist to be active before it can be used, can freely discover and then change active whitelists, or if the client can decline to use a list, that's not secure enough.)
XMPP Clients
XMPP clients will need a way to ask another clients if they support receiving pushes via a relay. Since pushes can be sent from anywhere, clients will also be able to send pushes directly to other clients through the relay as long as they have their friend’s whitelist token. They will also need to respond to XMPP server inquiries for whitelist tokens to allow pushes to be sent by the server if a message is sent by a client not supporting direct push.
XMPP Servers
XMPP servers can ask their connected clients if they support push relays and, if so, forward messages they receive to the push relay server when the client is offline. This will require the XMPP server to obtain a whitelist token from the user as well.
Help:see this link
If we are talking about XMPP protocol - there is an ability to block any communications from/to (see example 48)
So, by default, you can set it for each user for example.
Then, if we need to allow to communicate with someone specific,
then you can add this user to your privacy list with action=allow and order greater than 'full block'. Here is actually a good example of whitelist implementation via Privacy Lists, see example 8:
and (3) 'special', which allows communications only with three
specific entities.

Skype for Business - Response group SIP headers

We are running Skype For Business 2015 with EnterpriseVoice and want to allow calls coming through response group queues to be forwarded to mobile phones.
We have developed a small app / service to facilitate that through replacement of SIP header names and values according to documentation in
http://blog.greenl.ee/2011/12/30/modifying-sip-headers-managed-sip-application-api/
http://blog.greenl.ee/2013/12/16/response-groups-call-forwarding/.
The replacement seems to work flawlessly, but Skype server still identifies the call as a ‘Team call’ and doesn’t perform simultaneous ring or forward.
Our suspicion is that we replace wrong header details or just one of several needed for S4B to identify the call as a personal call.
Can anyone shed some light on Skype logic regarding this?
Which headers control the Personal / Team call identification?
What are correct Name / Value pairs to replace and with what?
There is already a similar post regarding this, but is't about Lync
Enabling call forwarding for Lync response group
You are talking about 2 different concepts here:
Call forwarding control
As said by the linked question, Ms-Sensitivity or Ms-Target-Class headers are controll if call forwarding is disabled.
So if you want to disable call forwarding to any call, you can add either:
request.AllHeaders.Add(new Header(Header.StandardHeaderType.MSTargetClass, "Secondary"));
or
request.AllHeaders.Add(new Header("ms-sensitivity", "Private-no-diversion"));
and you will disable the call forwarding.
If you want to enable call forwarding, remove the headers (as per the Greenlee blog post).
Lync Client Call presentation
This is controlled by the ms-retarget-reason parameter in the History-Info header.
For response group calls uses a value of acd.
Values that display Call For can be:
acd - Displays Call For and excepts the call to be transferred after call establised.
delegation - Displays Call For.
If you want to remove the Call For display you need to remove the History-Info headers.
The Transferred By display is controlled by the Referred-By header.
If you want to control the names display in the Call For or Transferred By display, you can't from the SIP message. The lync client looks up and displays the information from a lync contact from the sip address. If there is no lync contact, it will only display the sip address only.

How do I implement Google "Off the Record" with Smack API

I have a functioning XMPP chat client that is working with gtalk. I can not figure out how to implement some of the google custom extensions using the Smack API.
Specifically, I want to set the google talk user settings such that archivingenabled = false as described in the following link.
https://developers.google.com/talk/jep_extensions/usersettings
Additionally, if I decide to leave archivingenabled= true and try to control the google off the record setting individually I would need help monitoring and setting the google:nosave state as described in the following link:
https://developers.google.com/talk/jep_extensions/otr
My problem is that I can't figure out how to implement either of these things in code. The igniteRealtime documentation describes the approach in the following link:
www.igniterealtime.org/builds/smack/docs/latest/documentation/providers.html
(note: http:// was removed because I was over my limit on links)
I would appreciate any examples on how to code these 2 google talk extensions.
Thanks!
Matt
Start by creating a packet that extends IQ to send your requests. This can then be sent using SynchPacketSend(). Each individual command is an extension to be added to this IQ packet.
Then create a provider, as shown in the link you provided to convert the reply into your custom packet type.
You can look at the LeafNode.getItems() request as an example. Just follow the code and it will show you how to create and send the appropriate IQ packet. Check the providers package for how to receive replies.

What the "Channel" mean in facebook chat application?

Facebook uses publish/subscribe pattern for their chat app. I used Firebug to catch request in facebook site and I saw that every request to receive message from facebook server almost link to an address with pattern : http://[number].[number].chanel.facebook.com. There is about 0->20 channels which mean number in address pattern will range in [0-20].
I don't know why they need to use channel as subdomain ? Does it relate to divide processing chat message to multiple service (server) to increase server performance ? or just a subdomain name ?
What is your opinion ? I'd like to hear your interesting idea on this.
I believe they use sub-somains because there's a limit on how many connections per domain a browser can keep open.
See How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?
So, those sub-domains are not "channels".
These are special servers which handle only chat messages and notifications. Source: Rodrigo Schmidt's lecture (https://www.facebook.com/rodrigo)