Skype for Business - Response group SIP headers - sip

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.

Related

kamailio Privacy header and CANCEL

I am dealing with a Private caller case where the Privacy header is only passed in the initial INVITE but not in the subsequent mid-dialog requests (e.g. CANCEL).
When the Privacy header is present, my downstream expects me to send them another header.
For the most part, I was able to deal with this by using dlg module to keep track of state within dialog so that the mid-dialog requests will know about the Privacy header's presence in initial INVITE.
However, a problem i have is that just for the CANCEL request, I am unable to add any headers to the SIP request relayed to downstream.
I've read in other posts (dated years back) that an option would be to use stateless CANCELs downstream. Another potential option would be to start a new transaction at my level.
I am wondering if there are other alterantives to this. I would've recommended my downstream to use $avp but it seems like even though initial INVITE and the CANCEL are supposed to be in same transaction, the $avp value stored in initial INVITE is not accessible by the CANCEL.
There are other tricks that can work. Such as using the Record-Route as a data store (that can be security issue) or asking downstream to use dlg module, which can be a big performance cost to the,.
I am wonder if any of you have solved this problem already.
Instead of dialog module , i prefer that using htable to store transaction until get ACK. It is faster than it . After getting ACK , stored transaction can be removed.
In addition , You can look at TM module and TMX module that has features about Cancel.

IMS Clearwater configuring Application Server

I want to configure application server (in this case Restcomm) to ims clearwater so I added IFC line to /usr/share/clearwater/ellis/web-content/js/app-servers.json. Notice REGISTER SPT method.
"Restcomm" : "<InitialFilterCriteria><Priority>1</Priority><TriggerPoint><ConditionTypeCNF></ConditionTypeCNF><SPT><ConditionNegated>0</ConditionNegated><Group>0</Group><Method>REGISTER</Method><Extension></Extension></SPT><SPT><ConditionNegated>0</ConditionNegated><Group>0</Group><Method>INVITE</Method><Extension></Extension></SPT></TriggerPoint><ApplicationServer><ServerName>sip:192.168.56.101:5080</ServerName><DefaultHandling>0</DefaultHandling></ApplicationServer></InitialFilterCriteria>"
I want to do scenario
ims registration
but red circled flow is not done.
User created in Ellis Gui is registering fine in IMS but in trace I don't see REGISTER request to application server. What I have to do to achieve that flow except adding IFC line? Based on above flow, should Sprout component send independently REGISTER to AS?
Settings in zoiper for Ellis user. zoiper
[EDIT]
After testing I have some observations, i.a.:
1.When I removed INVITE SPT, and set only REGISTER SPT then flow works as I wanted and described above. So how to set few SPT?
"Restcomm-Register" : "<InitialFilterCriteria><Priority>1</Priority><TriggerPoint><ConditionTypeCNF></ConditionTypeCNF><SPT><ConditionNegated>0</ConditionNegated><Group>0</Group><Method>REGISTER</Method><Extension></Extension></SPT></TriggerPoint><ApplicationServer><ServerName>sip:192.168.56.101:5080</ServerName><DefaultHandling>0</DefaultHandling></ApplicationServer></InitialFilterCriteria>"
2.Not clear behaviour I noticed, when I created second server (with INVITE only), then provisioned two numbers via ellis gui, first number set to Restcomm-Register (above), second to Restcomm-Invite (below). On the Restcomm AS I have simple sip servlet app which is triggered on Invite and Register requests. I assumed that first number would only trigger simple app only on Register request but NOT! This number can also trigger Invite method... Why is this happennig if Register iFC only is added for first number? I thought that Invite should be send to build-in MMTel AS). On the other hand second number triggers only Invite method as I want.
"Restcomm-Invite" : "<InitialFilterCriteria><Priority>1</Priority><TriggerPoint><ConditionTypeCNF></ConditionTypeCNF><SPT><ConditionNegated>0</ConditionNegated><Group>0</Group><Method>INVITE</Method><Extension></Extension></SPT></TriggerPoint><ApplicationServer><ServerName>sip:192.168.56.101:5080</ServerName><DefaultHandling>0</DefaultHandling></ApplicationServer></InitialFilterCriteria>"
Both servers Restcomm-Register and Restcomm-Invite are the same server (the same IP) but with different SPT.

How to redirect a website according to country's IP address

I'm working on a messenger app whose server side code is developed in Erlang.
The problem which I'm facing is regarding redirection of website according to country specific domain.
For example: when user's types google.co in message box, it automatically displays google.co.uk, how can I redirect it to google.co.in if I'm in India?
For finding country's location, I found this library on github: https://github.com/mochi/egeoip
How can I use this geoLocation for redirecting to particular country specific website?
ScreenShot, when I entered facebook.com, it automatically displays preview in my local language.
But in case of my app, it shows preview in some foreign language, russian maybe.
I've read the comments, and since you are not considering having datasets as an option, I think what you may want to do is something like this:
First thing to understand is how those previews work. In any (popular) messaging app, if you type in a URL, the app will send a request to the URL and get the website metadata. Then it will be displayed in the UI.
The country detection, is a bit more complicated and done in a variety of ways. But thankfully, you (almost) don't have to do anything. This is a rather long topic, but I'll try to shorten it out.
Text Localization
In some websites (might be the case of Facebook's in your example), they do country detection on the application layer, and then based on that country, it will use a specific language for the website's text. This all usually happens before the website renders it's content, so you do not have to worry about it.
GeoDNS
This one occurs on the DNS layer, and probably the most popular. Domain names can be assigned a handful of IP addresses. These IPs can point to different versions of the website, and in the case of GeoDNS it will be up to the DNS manager to assign a country to an IP. So when a DNS query came from Russia, the requesting IP's country will be resolved and then the IP assigned to it (if any) will be returned. This is used by websites especially for country-specific features or content. Best example is Netflix.
Redirects
In case of Google redirecting you to a different domain, this might be how they do it. Country is being resolved via the IP address in the application (HTTP) layer, and then does a 301/302 redirect, pointing to the new domain name. This one, you may need to do something on. So given that your application needs to do an HTTP request to the URL the user has entered, if it returns a redirect, you must follow it. Many HTTP libs/clients already does this, but on some you might have to explicitly turn on the option to follow redirects.
One important thing to note is to do the HTTP request on the client side. Otherwise, you will be resolving to the same country (where your server resides) regardless of where your user is.

rest api design -> email notification

Is it bad practice to do automatic notification (email/sms/etc) as part of an api call? Or should that be separated from the core functionality.
Say I update a project status and want to send notification to all users watching the project.
Can I do that from the update call or should I break it out into some other notification mechanism? Any thoughts? If doing it from the call I guess each relevant method would need an option of skipping sending notifications.
I would add to a response by Rafael Mueller that there is a difference between RESTful interface and implementation mechanics.
As far as RESTful interface is concerned here are my thoughts. Let's say you update a project status with "PUT /project/123/status". Whether email is going to be send or not it's up to a value proposition of your app. May be that's how you want to differentiate yourself from your competitors.
Let's say you support sending of emails but you want to give control to a client on a call-by-call basis. I would go with an optional HTTP Header or an optional attribute of the request body be it JSON or XML or anything else.
Once you allowed variability in emailing project status, I would advice to design a designated end-point to trigger email update on demand. Something like "POST /project/123/status/send-email". This way your client won't shoot itself in a foot: if they forgot to send email during a project status update, or simply changed their mind, they can always call "send-email".
I would rise an event, ProjectUpdated, you can add it to your messaging system (a database could solve, or rabbitmq, msmq...) and the consumer of this event, will send the email.

Call transfers, hold and conference calls

In the process of building an operator application in C# I have encountered some problems. They all stem from the fact that the operator isn't actually a phone. So doing things like transfer a call (a BYE then REFER), or placing a call on hold (send another INVITE as a=recvonly) are easy for phones to do because they already hold state information about the call dialog from the initial handshake.
Is it possible to send INVITEs on behalf of another phone to get them into conference? Is it possible to send INVITEs on behalf of another phone to get them into hold?
Well, if you are using Asterisk I'd recommend looking into Asterisk Manager Interface and not deal with SIP protocol directly. It provides methods to create/transfer/hangup calls,monitor,etc, and everything else you might need.