Subscribe to our RSS Feeds
Hello, this is a sample text to show how you can display a short information about you and or your blog. You can use this space to display text or image introduction or to display 468 x 60 ads and to maximize your earnings.

Telephony Application Programming Interface ( TAPI )

0 Comments »
The Telephony Application Programming Interface (TAPI) is a Microsoft Windows API, which provides computer telephony integration and enables PCs running Microsoft Windows to use telephone services. Different versions of TAPI are available on different versions of Windows.
The purpose of the TAPI specification is to provide control of telephony resources to applications. This is used primarily to control either Modems or, more recently, to control business telephone system (PBX) handsets. When controlling a PBX handset, the driver is provided by the manufacturer of the telephone system. Some manufacturers provide drivers that allow the control of multiple handsets. This is traditionally called "third-party control". Other manufacturers provide drivers that allow the control of a single handset. This is called "first-party control". Third-party drivers are designed to allow applications to see and/or control multiple extensions at the same time. Some telephone systems only permit one third-party connection at a time. First-party drivers are designed to allow applications to monitor and/or control one extension at a time. Telephone systems naturally permit many of these connections simultaneously. Modem connections are by nature first-party.
Tapi can also be used to control voice-enabled telephony devices, including voice modems and dedicated hardware such as Dialogic cards.


The Microsoft telephony application programming interfaces support the development of communications applications for Microsoft Windows or Windows NT. The telephony interfaces are listed in the following table.


InterfaceDescription
TAPI 2.xA C-programming language based API that enables you to implement communications applications ranging from basic modem control to call centers with multiple agents and switches.
TAPI 3.xA COM-based API that merges classic and IP telephony.
TSPIA telephony service provider (TSP) is a dynamic-link library (DLL) that supports communications device control through a set of exported service functions. A TAPI application uses standardized commands, TAPI passes information to the telephony service provider, and the TSP handles the specific commands that must be exchanged with the device.
MSPIA media service provider (MSP) allows an application considerable control over the media for a particular transport mechanism. An MSP is always paired with a telephony service provider (TSP).
1:04 AM

What is IVR(Interactive Voice Response)?

0 Comments »
Interactive Voice Response (IVR) is a technology that allows a computer to detect voice and dual-tone multi-frequency signaling (DTMF) keypad inputs. IVR technology is used extensively in telecommunication, but is also being introduced into automobile systems for hands-free operation. Current deployment in automobiles revolves around satellite navigation, audio and mobile phone systems. In telecommunications, IVR allows customers to access a company’s database via a telephone keypad or by speech recognition, after which they can service their own inquiries by following the instructions. IVR systems can respond with pre-recorded or dynamically generated audio to further direct users on how to proceed. IVR systems can be used to control almost any function where the interface can be broken down into a series of simple menu choices. In telecommunications applications, such as customer support lines, IVR systems generally scale well to handle large call volumes.
It has become common in industries that have recently entered the telecommunications industry to refer to an Automated Attendant as an IVR. The terms Automated Attendant and IVR are distinct and mean different things to traditional telecommunications professionals, whereas emerging telephony and VoIP professionals often use the term IVR as a catch-all to signify any kind of telephony menu, even a basic automated attendant. The term VRU, for Voice Response Unit, is sometimes used as well.
5:18 AM

What is PBX (Private Branch Exchange) ?

0 Comments »
Short for private branch exchange, a private telephone network used within an enterprise. Users of the PBX share a certain number of outside lines for making telephone calls external to the PBX.
Most medium-sized and larger companies use a PBX because it's much less expensive than connecting an external telephone line to every telephone in the organization. In addition, it's easier to call someone within a PBX because the number you need to dial is typically just 3 or 4 digits.

A new variation on the PBX theme is the centrex, which is a PBX with all switching occurring at a local telephone office instead of at the company's premises.
3:29 AM

How GPS Receivers Work

0 Comments »
Here is answer to how GPS WORKS
The Global Positioning System (GPS) is actually a constellation of 27 Earth-orbiting satellites (24 in operation and three extras in case one fails). The U.S. military developed and implemented this satellite network as a military navigation system, but soon opened it up to everybody else.

Each of these 3,000- to 4,000-pound solar-powered satellites circles the globe at about 12,000 miles (19,300 km), making two complete rotations every day. The orbits are arranged so that at any time, anywhere on Earth, there are at least four satellites "visible" in the sky.

A GPS receiver's job is to locate four or more of these satellites, figure out the distanc e to each, and use this information to deduce its own location. This operation is based on a simple mathematical principle called trilateration. Trilateration in three-dimensional space can be a little tricky, so we'll start with an explanation of simple two-dimensional trilateration.

What is trilateration?


Introduction

GPS receivers calculate the position of objects in two dimensional or three dimensional space using a mathematical process called trilaterlation. Trilateration can be either two dimensional or three dimensional. Let us examine how 2-D and 3-D trilateration work.

2-D Trilateration

The concept of trilateration is easy to understand through an example. Imagine that you are driving through an unfamiliar country and that you are lost. A road sign indicates that you are 500 km from city A. But this is not of much help, as you could be anywhere in a circle of 500 km radius from the city A. A person you stop by to ask for directions then volunteers that you are 450 km from city B. Now you are in a better position to locate yourself- you are at one of the two intersecting points of the two circles surrounding city A and city B. Now if you could also get your distance from another place say city C, you can locate yourself very precisely, as these three circles can intersect each other at just one point. This is the principle behind 2D trilateration.

3-D Trilateration

The fundamental principles are the same for 2D and 3D trilateration, but in 3D trilateration we are dealing with spheres instead of circles. It is a little tricky to visualize. Here, we have to imagine the radii from the previous example going in all directions, that is in three dimensional space, thus forming spheres around the predefined points. Therefore the location of an object has to be defined with reference to the intersecting point of three spheres.

Thus if you learn that the object is at a distance of 100 km from satellite A, it simply says that the object could be on surface of a huge imaginary sphere of 100 km radius around satellite A. Now you are also informed that the object is 150 km from satellite B. The imaginary spheres of 100km and 150 km around satellites A and B respectively intersect in a perfect circle. The position of the object defined from a third satellite C intersects this circle at just two points. The Earth acts as the fourth sphere, making us able to eliminate one of the two intersection points of the first three spheres. This makes it possible to identify the exact location of the object.

However GPS receivers take into account four or more satellites to improve accuracy and provide extra information like altitude of the object.

Thus the GPS receiver needs the following information for its calculations.

The location of a minimum of three satellites that lock in with the object to be located or tracked.
The distance between the object and each of these satellites.
The GPS receiver works this out by analyzing high-frequency radio signals from GPS satellites. The more sophisticated the GPS, the more its number of receivers, so that signals from a larger number of satellites are taken into account for the calculations.



How does a GPS receiver calculate its location?
(the simple answer)

A GPS receiver figures out how far away it is from each satellite based on how much time it takes a broadcast signal to travel from the satellite to the receiver. (A signal takes more time to reach you if you're farther away.)
Since the location of each GPS satellite is known, the receiver's location can be determined by "triangulating" the distances from several satellites
12:40 AM

SQL server Date Time Function

0 Comments »
Datetime functions allow manipulating columns with DATETIME/SMALLDATETIME data types. SQL server DateTime Function:

GETDATE and GETUTCDATE Functions

GETDATE and GETUTCDATE Functions are Nondeterministic function. Both functions returns the current date and time. GETDATE returns current system date and time of the computer where SQL Server is running.

GETUTCDATE returns current UTC time (Universal Time Coordinate or Greenwich Mean Time). The current UTC time is derived from the current local time and the time zone setting in the operating system of the computer on which the instance of Microsoft SQL Server is running.

DATEADD Functions

DATEADD function is Deterministic function. DATEADD Function adds a certain interval of time to the specified date and time value.

Syntax: DATEADD (datepart , number, date )

DATEADD returns a new date time value based on adding an interval to the specified date and time value.

DATEDIFF Function

DATEDIFF function is Deterministic function. DATEDIFF () gives the difference between the two date values.

Syntax: DATEDIFF ( datepart , startdate , enddate )

DATEDIFF returns number of date and time boundaries crossed between two specified dates. In DATEDIFF function start date is subtracted from end date. If start date is later than end date, a negative value is returned.

DATEPART Function

To retrieve any part of date and time use DATEPART function.

Syntax: DATEPART ( datepart , date )

DATEPART function takes two arguments 1)part of the date that you want to retrieve and 2)date itself. The DATEPART function returns an integer that represents date part of specified date.

DATEPART Output
SELECT DATEPART(year, '2009-02-13 18:35:06.523') 2009
SELECT DATEPART(quarter, '2009-02-13 18:35:06.523') 1
SELECT DATEPART(month, '2009-02-13 18:35:06.523') 2
SELECT DATEPART(dayofyear, '2009-02-13 18:35:06.523') 44
SELECT DATEPART(day, '2009-02-13 18:35:06.523') 13
SELECT DATEPART(week, '2009-02-13 18:35:06.523') 7
SELECT DATEPART(weekday, '2009-02-13 18:35:06.523') 6
SELECT DATEPART(hour, '2009-02-13 18:35:06.523') 18
SELECT DATEPART(minute, '2009-02-13 18:35:06.523') 35
SELECT DATEPART(second, '2009-02-1 18:35:06.523') 6
SELECT DATEPART(millisecond, '2009-02-1 18:35:06.523') 523
DATENAME Function

DATENAME Function returns a character string that represents date part of the specified date.

Syntax: DATENAME ( datepart , date )

DATENAME function takes two arguments same as DATEPART function 1) part of the date that you want to retrieve and 2) date itself.

If you want the name of month
SELECT DATENAME (month, '2009-02-13 18:35:06.523') => Output : February

If you want the name of week day
SELECT DATENAME (weekday, '2009-02-13 18:35:06.523') => Output : Friday

DAY, MONTH, and YEAR Functions

All of this DAY, MONTH, and YEAR functions takes a single date value as a argument. Each of this function returns an integer that represents respective portions of the date.

SELECT DAY('2009-02-1 18:35:06.523') as 'Day', MONTH('2009-02-1 18:35:06.523') as 'Month', YEAR('2009-02-1 18:35:06.523') as 'Year'

Each of this functions equivalent to DATEPART function. Like DAY is equivalent to DATEPART (dd, date), MONTH is equivalent to DATEPART (mm, date) and YEAR is equivalent to DATEPART (yy, date).
3:47 AM

Latitude, Longitude, Bearing, Cardinal Direction, Distance, and C#

0 Comments »
Latitude, Longitude, Bearing, Cardinal Direction, Distance, and C#
10:26 PM

Socket Programming C#

1 Comments »

windowsmobile socket programming

Server Code 



using System;
using System.Threading;
using System.Net.Sockets;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Data;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            TcpListener serverSocket = new TcpListener(8888);
            TcpClient clientSocket = default(TcpClient);
            int counter = 0;


            serverSocket.Start();
            Console.WriteLine(" >> " + "Server Started");


            counter = 0;
            while (true)
            {
                counter += 1;
                clientSocket = serverSocket.AcceptTcpClient();
                Console.WriteLine(" >> " + "Client No:" + Convert.ToString(counter) + " started!");
                handleClinet client = new handleClinet();
                client.startClient(clientSocket, Convert.ToString(counter));
            }


            clientSocket.Close();
            serverSocket.Stop();
            Console.WriteLine(" >> " + "exit");
            Console.ReadLine();
        }
    }


    //Class to handle each client request separatly
    public class handleClinet
    {
        TcpClient clientSocket;
        string clNo;
        public void startClient(TcpClient inClientSocket, string clineNo)
        {
            this.clientSocket = inClientSocket;
            this.clNo = clineNo;
            Thread ctThread = new Thread(doChat);
            ctThread.Start();
        }
        private void doChat()
        {
            int requestCount = 0;
            byte[] bytesFrom = new byte[10025];
            string dataFromClient = null;
            Byte[] sendBytes = null;
            string serverResponse = null;
            string rCount = null;
            requestCount = 0;


            while ((true))
            {
                try
                {
                    requestCount = requestCount + 1;
                    NetworkStream networkStream = clientSocket.GetStream();
                    networkStream.Read(bytesFrom, 0, (int)clientSocket.ReceiveBufferSize);
                    dataFromClient = System.Text.Encoding.ASCII.GetString(bytesFrom);
                    dataFromClient = dataFromClient.Substring(0, dataFromClient.IndexOf("$"));
                    Console.WriteLine(" >> " + "From client-" + clNo + dataFromClient);


                    rCount = Convert.ToString(requestCount);
                    serverResponse = "Server to clinet(" + clNo + ") " + rCount;
                    sendBytes = Encoding.ASCII.GetBytes(serverResponse);




                    System.Data.DataSet ds = new System.Data.DataSet();
                    DataTable dt = new DataTable("Test");
                    dt.Columns.Add("fname");
                    dt.Columns.Add("lname");
                    dt.Rows.Add("Vishal", "Pawar");
                    dt.Rows.Add("Vishal", "Pawar");
                    dt.Rows.Add("Vishal", "Pawar");


                    ds.Tables.Add(dt);
                    


                    BinaryFormatter bin = new BinaryFormatter();


                    MemoryStream mem = new MemoryStream();
                    bin.Serialize(mem, ds);
                    byte[] b = mem.ToArray();
                    
                    networkStream.Write(b, 0, b.Length);
                    networkStream.Flush();
                    Console.WriteLine(" >>>>>>>>>>>> " + serverResponse);
                }
                catch (Exception ex)
                {
                    Console.WriteLine(" >> " + ex.ToString());
                }
            }
        }
    }
}


Client Code


using System;
using System.Windows.Forms;
using System.Net.Sockets;
using System.Text;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
using System.Data;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        System.Net.Sockets.TcpClient clientSocket = new System.Net.Sockets.TcpClient();
        NetworkStream serverStream;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            msg("Client Started");
            clientSocket.Connect("localhost", 8888);
            label1.Text = "Client Socket Program - Server Connected ...";
        }

        private void button1_Click(object sender, EventArgs e)
        {
            NetworkStream serverStream = clientSocket.GetStream();
            byte[] outStream = System.Text.Encoding.ASCII.GetBytes("tttttttttttttttttt Message from Client$");
            serverStream.Write(outStream, 0, outStream.Length);
            serverStream.Flush();

            byte[] inStream = new byte[10025];
            serverStream.Read(inStream, 0, (int)clientSocket.ReceiveBufferSize);
            string returndata = System.Text.Encoding.ASCII.GetString(inStream);
            //System.Data.DataSet ds;
            BinaryFormatter bf1 = new BinaryFormatter();
            MemoryStream msnew = new MemoryStream();
            msnew.Write(inStream, 0, inStream.Length);
            msnew.Position = 0;
            DataSet ds = (DataSet)bf1.Deserialize(msnew);

            msg("Data from Server : " + ds.Tables["Test"].Rows[0]["fname"].ToString() + ds.Tables["Test"].Rows[0]["lname"].ToString());
        }

        public void msg(string mesg)
        {
            textBox1.Text = textBox1.Text + Environment.NewLine + " --> " + mesg;
        }
    }
}


5:09 AM