Sunday, September 6, 2009

Thinking to start blogging after a long time....

Tuesday, September 11, 2007

XMPP VoIP Phone

Now days, Telephony is not just about to talk, but it has so many other powerful feature. IP telephony has inherited enormous potential, which has given so many ways to develop and strengthen the telephony. This blog is about another and all together new aspect of telephony, more specific Enterprise Telephony.

Imagine a day to office, what would a person need from his telephone near his desk? I will list down few features or expectations which phone can offer to make his business profitable and fast.

  • How if desk phone initiates the meeting automatically which is set in your calender?
  • How if you can have the presence or availability status of the person to whom you want to call right on your screen?
  • How if you can get all your corporate communication, news feeds pushed on your phone instead of flooding your mailbox?
  • How if your phone acts an normal telephone, chatting client, voice mail box, e-mail and fax viewer?
  • How if your outlook calender, enterprise calender is available on your phone, which you can access from any where in the enterprise or through VPN?
  • What if your telephone can be integrated with Google Apps?
Here is the partial list of the features which powers the phone and in turns telephony. Now, it would be very easy to get convinced, telephony is not just about to talk, but its much more than that!!

What makes these features reside in your Telephony server??

Which protocol, what type of call-processing???

XMPP is the answer.............

XMPP (eXtensible Messaging and Presence Protocol) is widely gaining popularity due to its simple XML based approach and long list of Presence feature.


  • XMPP can be seen a s a new VoIP Protocol l
  • It has widely accepted as a IM standard
  • With the advent of Jingle (XEP-166) , its very easy to push XMPP as a complete VoIP protocol, with presence intergrated.l
Jingle can be thought of power of XMPP VoIP.

l- Google has developed Jingle (XEP-166) extension which is used for Voice, Video Sessions.
- Jingle supports ICE, STUN and TURN making NAT transparent solution.
-

Thursday, May 10, 2007

Macros in C/C++


Function-like Macros

You can also define macros whose use looks like a function call. These are called function-like macros. To define a function-like macro, you use the same `#define' directive, but you put a pair of parentheses immediately after the macro name. For example,

     #define lang_init()  c_init()
lang_init()
==> c_init()

A function-like macro is only expanded if its name appears with a pair of parentheses after it. If you write just the name, it is left alone. This can be useful when you have a function and a macro of the same name, and you wish to use the function sometimes.

     extern void foo(void);
#define foo() /* optimized inline version */
...
foo();
funcptr = foo;

Here the call to foo() will use the macro, but the function pointer will get the address of the real function. If the macro were to be expanded, it would cause a syntax error.

If you put spaces between the macro name and the parentheses in the macro definition, that does not define a function-like macro, it defines an object-like macro whose expansion happens to begin with a pair of parentheses.

     #define lang_init ()    c_init()
lang_init()
==> () c_init()()

The first two pairs of parentheses in this expansion come from the macro. The third is the pair that was originally after the macro invocation. Since lang_init is an object-like macro, it does not consume those parentheses.




An object-like macro is a simple identifier which will be replaced by a code fragment. It is called object-like because it looks like a data object in code that uses it. They are most commonly used to give symbolic names to numeric constants.

You create macros with the `#define' directive. `#define' is followed by the name of the macro and then the token sequence it should be an abbreviation for, which is variously referred to as the macro's body, expansion or replacement list. For example,

     #define BUFFER_SIZE 1024

defines a macro named BUFFER_SIZE as an abbreviation for the token 1024. If somewhere after this `#define' directive there comes a C statement of the form

     foo = (char *) malloc (BUFFER_SIZE);

then the C preprocessor will recognize and expand the macro BUFFER_SIZE. The C compiler will see the same tokens as it would if you had written

     foo = (char *) malloc (1024);

By convention, macro names are written in uppercase. Programs are easier to read when it is possible to tell at a glance which names are macros.

The macro's body ends at the end of the `#define' line. You may continue the definition onto multiple lines, if necessary, using backslash-newline. When the macro is expanded, however, it will all come out on one line. For example,

     #define NUMBERS 1, \
2, \
3
int x[] = { NUMBERS };
==> int x[] = { 1, 2, 3 };

The most common visible consequence of this is surprising line numbers in error messages.

There is no restriction on what can go in a macro body provided it decomposes into valid preprocessing tokens. Parentheses need not balance, and the body need not resemble valid C code. (If it does not, you may get error messages from the C compiler when you use the macro.)

The C preprocessor scans your program sequentially. Macro definitions take effect at the place you write them. Therefore, the following input to the C preprocessor

     foo = X;
#define X 4
bar = X;

produces

     foo = X;
bar = 4;

When the preprocessor expands a macro name, the macro's expansion replaces the macro invocation, then the expansion is examined for more macros to expand. For example,

     #define TABLESIZE BUFSIZE
#define BUFSIZE 1024
TABLESIZE
==> BUFSIZE
==> 1024

TABLESIZE is expanded first to produce BUFSIZE, then that macro is expanded to produce the final result, 1024.

Notice that BUFSIZE was not defined when TABLESIZE was defined. The `#define' for TABLESIZE uses exactly the expansion you specify—in this case, BUFSIZE—and does not check to see whether it too contains macro names. Only when you use TABLESIZE is the result of its expansion scanned for more macro names.

This makes a difference if you change the definition of BUFSIZE at some point in the source file. TABLESIZE, defined as shown, will always expand using the definition of BUFSIZE that is currently in effect:

     #define BUFSIZE 1020
#define TABLESIZE BUFSIZE
#undef BUFSIZE
#define BUFSIZE 37

Now TABLESIZE expands (in two stages) to 37.

If the expansion of a macro contains its own name, either directly or via intermediate macros, it is not expanded again when the expansion is examined for more macros. This prevents infinite recursion. See Self-Referential Macros, for the precise details.


(Source: GCC Documentation: http://gcc.gnu.org/onlinedocs/cpp/)


Tuesday, May 8, 2007

Third Party Registration for H.323 Phones

Can any H.323 endpoint register to any other H.323 endpoint? What will be the advantages of it?

Work in Progress!!

Unicode Support for SMS in Mobile Phones

Now days mobiles are ubiquitous, covering almost all the regions and languages in the world. Cell phone manufactures supports phone menus in different languages but they are limited. If an user writes his message in Marathi (Devnagri Script, India) and sends it to a person who do not has
any support for Marathi in his cell phone, then he will not able to see the message correctly. Instead, he will see all unreadable characters.
There could be so many such cases even in one country. The country like India, which has large number of users with different native languages. It is practically impossible to support all the languages inside cell phone. And here comes the sigh of relief, Unicode.
Unicode provides the platform to encode and decode almost every symbol from different scripts. Its universally accepted standard, which uses UTF-8, UTF-16 etc. encoding schemes. If cell phone has Unicode support then any user can send and understand his own language. As Unicode includes Universal character set, which can be used in any countries.

Therefore, Unicode provides simplest solution which can be easily ported on mobile. SMS is the best candidate for its usage!!

Most of the mobile phones (even low end mobiles) manufacturers have provided the Unicode support, however, the problem still lies with the font rendering onto the tiny screen.

Even after recognizing the character, it has to be presented on to mobile screen, some times due
to limited capabilities of the phones, not all the language fonts are available.

This is the biggest limitation on this issue. There are couple of good blogs available on the internet which talks about the issues related fonts for different languages...



- (C) Anand Paithankar (anandpaithankar@gmail.com)