Call transfers, hold and conference calls - sip

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.

Related

Check when user calls a certain number Call Kit

I am trying to use call kit or another library to check when a user calls a certain number. I want to know when this happens so that I can send the user a notification. I know that you can detect incoming calls but not sure if outgoing calls are allowed. Is there any way for me to do this?
Thanks in advance

How can the recipient be informed that someone has blocked them on ejabberd?

We are building a chat app using latest ejabberd and there is a use case where user A blocks user B. the requirement is to hide last seen or user's presence from each other. if A blocks B then its easy to hide these information from user A but how can user B be informed that user A has blocked them ? whats the best approach to tell user B the someone has blocked them on realtime while both are in a conversation , like whatsapp does now.
For presence, you do not have to use block, you can simply remove contacts from roster. That way, the other user is notified and can also stop sharing his presence.
There is XEP-0191: Simple Communications Blocking:
https://xmpp.org/extensions/xep-0191.html
https://xmpp.org/extensions/attic/xep-0191-0.2.html
I think it will give you the answers you need. Now it depends how will you implement this functionality using chosen client library like Smack.

How can I make outbound calls with a Twilio number?

I have registered a phone number within twilio to use as "my" phone number.
I set up a simple twiml bin do handle call forwarding to whatever phone SIM/handset I am using right now. So people call my (twilio) number and it forwards to my phone.
However, if I make an outbound call from my phone, of course the callerID is from my SIM, not my twilio number. This confuses people and is inconvenient.
What is the best (easiest) way for me to place calls, using my current phone/SIM/number, but have the call come from my twilio number ?
(I am currently using an iphone, FWIW)
Thanks.
Twilio developer evangelist here.
There are a few options here. You can implement the Twilio Programmable Voice SDK for iOS into an iPhone app that you can then use to make calls from. There are quickstarts and example applications available here: https://github.com/twilio/voice-quickstart-swift#quickstart
Alternatively, you could update your incoming webhook to point at some code that works out if it is your number dialling or not. If it is not, then carry on with the current forwarding behaviour. If it is your number, then ask what number you want to dial and take the digits using <Gather>, then use a <Dial> to make the outbound call.
You could also install a SIP phone app to your device and set up SIP registration. You would then need to set up some TwiML to make outgoing calls from the SIP endpoint.
Just some ideas there. Let me know if that helps at all.
Now there is a Twilio mobile app for iOS and Android called TwiConnect https://twiconnect.com
You can login through your Twilio Account SID, choose one of your Twilio Voice or SMS numbers as a default one, then you will be able to make outgoing calls or send/receive SMS messages usi

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.

Push Notification Alternatives

I heard that push notification is not reliable. What could be the alternative for this?
The use case I am trying to handle is:
1. I have a app which will be shared by three kind of groups. Each group contains certain set of persons.
2. A request is submitted by first kind of group and it will be serviced by second kind of group. So, all persons who are part of second group should be notified and no one apart from them should get the notification.
3. Similarly, A request is submitted by first kind of group and it will be serviced by third kind of group. So, all persons who are part of third group should be notified and no one apart from them should get the notification.
4. Even second group persons can submit a request to third group.
Please provide your thoughts as how should I handle these scenarios.
Push notifications rely on the network (3G/WiFi) presence to deliver the notification. Also, there is no response back from the Apple Push Notification Server which guarantee the delivery of the notification. Having said all these things... iPod touch is higly unreliable for delivery of notification because one, it do not have 3G; second, for saving battery its notifications are internally turned off for some time....
One Alternative to this is to keep polling the server in a background thread for any modification. But this will work only when app is running.
Another Alternative can be writing our own APNS kinda infrastructure.
you're right to say Push Notifications are not reliable.
For one thing, if the device is not connected to the internet, APNs only keeps one push notification to be sent when the device connects again (the last notification sent from the provider). Since there's no way to determine if a notification has been already sent or not after your servers sent them to APNS, you can't even try to queue the notifications on your end.
Other than that if your app depends on PN the user can easily break it's functionality by turning notifications off.
So you're absolutely right, if the data you want to send is critical, then you shouldn't use Push Notification. But I believe there's really no solution to your problem. you simply can't rely on them for your app to work.
I think the best approach would be like the email app for example, where you can download your emails when you start the app wether you have PN turned on or not, and the PN just notify you of new email, even though it's not guaranteed you'll get it at all.
There is no alternative, since Apple does some very low level communication. You would need to work together with the mobile providers to build something like the notification services.
That said, I don't think the service is not reliable. Maybe you should check your implementation.
You are right that APNs does not guarantee delivery: From their docs, they say that:
Important: Because delivery is not guaranteed, you should not depend
on the remote-notifications facility for delivering critical data to
an application via the payload. And never include sensitive data in
the payload. You should use it only to notify the user that new data
is available.