Monitor phone call length? - windows-phone-7

I would like my sales staff to click a button, which makes a phonecall and registers the length of the call.
Is it possible to monitor the length of a phonecall?
Thanks

No, the PhoneCallTask does not provide this kind of information. But you could register the current time just before the call starts and get the current time when the app resumes.
However, this might be longer than the actual phone call when the user or phone decides to do something else in between.
EDIT
Apparently, after being corrected by #JaredBienz-MSFT and and testing it, the Show method of the PhoneCallTask is not blocking. So my 'trick' will not work.

Related

AppleScripts: display notification is too fast to display properly

I don't recall if this changed recently (I'm on 10.13), but when I call display notification in a fast loop, the notification changes to "N new notifications". Totally unhelpful for most of my scripts.
I've tried sporadically calling the notification with
if notificationCount / someDenom = (notificationCount / someDenom) as integer then display notification "etc."
which works if how long a loop will take is a known quantity. But half the time, I'm calling the scripts sometimes on a local drive, other times over a network, and the results are unpredictable. Either I don't get frequent enough notifications, or it collapses into the too many display sometimes.
Thinking it's entirely possible that this is baked into macOS and there's nothing I can do except the above, but thought someone might have a bright idea.
[Edited to add: just had one myself, a subroutine which notes the datestamp and elapsed time since the last call, then only calls the notification if N seconds have passed. I'll give that a try.]
[Edited again: well, that technically works, but it adds 0.68 seconds to every notification, which is a pretty high cost in a tight loop.]
Not sure if this is what you are looking for but it works for scripts:
delay 1
display notification "uno momento..."
delay 1
display notification "it works!"
Meaning, figure out a way to add a delay between notifications if they're not appearing / play with the delay time until it works for your purposes. I found using 1 sec is OK since users will read at that speed, and it allows the OS time to catch up and ensures all notifications are listed in order AND all of them show up / are displayed to user.
I found I also have to include a delay prior to the first notification, if sending notifications in a group...again ensuring first notify displays properly.

How to send "Is Typing" notifications until response task completed?

How to send Is Typing notification from bot application until bot process another response. I can see currently it is limited to 3 seconds, but I want to extend it until the next response come back from Bot.
Can anyone help me with this? I have seen a couple of approaches where they recommend showing recursively until your task finish its execution but not sure how to Implement this.
Currently, this is not a feature of bot framework. You cannot control the length of time of which the typing indicator is displayed for. Your best bet is to try to resend the typing indicator as many times as needed until you long-running task is completed. This will be a custom solution that there may already be examples of out there.
You can send the typing activity every couple seconds while your processing runs asynchronously. This uses a bit of extra bandwidth, so your call. e.g.
var search = searchclient.Documents.SearchAsync(query);
var typing = turnContext.Activity.CreateReply();
typing.Type = ActivityTypes.Typing;
do {
turnContext.SendActivityAsync(typing);
} while (!search.Wait(2000));
var results = search.Result.Results;
Or set the wait to 4 seconds, or a random number between 2 and 5 seconds, so it looks like the bot is typing a little, thinking, then typing more...
Virtually all chats employ forms of faking the "real time" presence of the typing indicator. You are best to not even try, instead letting it vary randomly at the client side, and heuristically altering to your own logic, and have any end event cancel it. Especially if your API footprint is part of your operating cost.

Mixpanel alias on multiple devices

I'm confused by the way that Mixpanel alias() is supposed to work, despite the fact that Mixpanel have multiple pages attempting to explain it.
According to this page, I should call alias() only once per user, because it will create a one-time mapping from their user ID to the device's generated ID. But shouldn't that mapping be the other way around? Let's say Bob starts my app on his phone and logs in, at which point I call alias() to map all his actions so far to his account. He then goes through the same process on his tablet - I would expect that I can then call alias() on that machine to do the same thing. But the page I mentioned specifically says not to do that, because it will map his user ID to that device's ID now.
I can call identify() on the multiple devices, but that does not link his previous events to his user ID.
I feel like I'm misunderstanding how this whole thing works, but I've now spent a few hours pondering this so I'm hoping it's confused someone else in the past too...
I always understood alias() as mapping the identifiers both ways. I've had a similar case as you. I'm almost sure that it does not matter how many times you alias and in which direction you alias the identifiers.
This is not authoritative though, but rather based on past usage and possibly-flawed understanding.
As they explain on their help documentation:
https://mixpanel.com/help/questions/articles/how-should-i-handle-my-user-identity-with-the-mixpanel-javascript-library
Ideal implementation
The ideal integration that will allow you to track users from anonymous browsing all the way through signup and subsequent logins:
When a new user signs up, call (once)
mixpanel.alias("YOUR_USER_ID")
When a user logs in, call
mixpanel.identify("YOUR_USER_ID")
Applying this to your question, you need to use identify when the user do login with the mobile and another time when he do it with the tablet.

how to do mixpanel.people.increment in Segment

I'm using Segment and have Mixpanel enabled. I used to track our user's life time revenue like this:
mixpanel.people.increment('Lifetime Revenue', 21.99);
The question is how do I do this in Segment?
Looked everywhere, it seems like they do have increment setting under advanced setting. However, I still don't know how to fire those events/trackers.
Thanks!
I too was wondering on how to do this, based on Mixpanel's article (https://mixpanel.com/blog/2014/07/21/revenue-best-practices). I did a lot of back and forth with Segment's tech support, and after a couple of days of repeatedly telling them to read the article, they finally got me to an engineer who actually read it, and was able to answer my question about this as well. Here's his answer:
It looks like a few things need to happen for this lifetime revenue value to be tracked.
First, track_charge needs to be called. Fortunately we're already firing a track_charge call when revenue is passed as a trait in track calls. You can see where that happens in the code here.
Secondly, a the people.increment() needs to be called. We also fire this on the page as you can see here, but it doesn't look like we currently have a way to pass through the revenue in that people.increment call.
Looks like your best bet here would be to fire off the increment and set calls directly. As you may know, we're loading the Mixpanel library on the page so all you have to do is execute the calls within an analytics.ready() method. Doing so ensures that the native calls only fire when the Mixpanel library has properly loaded on the page.
For reference, here are the calls you'd want to place within the ready() method.
mixpanel.people.increment("Lifetime Value", 27);
mixpanel.people.set("Last Item Purchase", new Date.toISOString());
To increment events, log into your account at Segment.com, select the Mixpanel integration, then select "Advanced Options". Within "Advanced Options", there's a text field labeled "Events to Increment in People" where you can specify events you'd like to be incremented.

How to trigger an action the moment a specific statement validates true?

In Xcode you can check when you hit a button, wether an integer is 9 (go to that page) or 7 (go to an other page). Is there a way to automatically trigger an action when the number becomes 60 for example? I know you can do this with a timer, that checks every second if the if statment is true. But is there an other way to achieve the same?
Most debuggers can watch a memory location and break the application when the content of that location changes. So if you want to find out why and where something changes, that's your way. If you want the user interface to respond to that change during normal (i.e. non-debug) operations, then you'd better add some code to the location where things change, to pass that event along.

Resources