Idendifying caller number. What is the easiest way?
I have PC and VOIP phone. When someone calls to my account and I answer it using VOIP phone, I want the phone numb开发者_运维百科er to be stored on my PC.
What is the easiest way to receive caller number? Is finding a VOIP Java/C# SDK and developing my application (just to get a caller number) the only way or are there some clever shortcuts?
Note: I am familiar that softphones are displaying the callerID but there is no (reasonble, non hack'ish) way I can read it from softphone.
Depending on your softphone you might be able to configure it to save a calls log. Alternatively you could obtain CDRs (call detail records) from your VOIP server.
Another route to go would be to monitor incoming VOIP TCP connections and extract caller data from sniffed packets.
Or you could write a small program that will run in background and check periodically which is the active window. If the active window is your softphone, then it will take a screenshot and dump it to a folder.
What Vlad said. Providing the hardphone model details will get you more details :-) If the PC is sure to be on all the time you want to operate the phone, you can install a simple SIP proxy on the PC that does nothing but logging.
If a softphone is an option, many of them can be scripted, I love twinkle for example.
Using wireshark (or more to the point tshark, the command-line version) you can build a capture spec that will only capture incoming SIP packets on UDP port 5060, and then only if the SIP msg is INVITE. Then you just have to look at the "From" line to see who called you (if it's filled in; it should at least have a number).
精彩评论