Skip to main content

Posts

Showing posts with the label unix

[SOCKET] On udp recvfrom peer address return 0.0.0.0:0

ISSUE: When using udp socket it is necessary to know the remote peer address from where the data is received. In future this can be used for sending and tracking messages. If you are ICE or STUN ,TURN developer then its a must. char recv_data[1024]; int sin_size; struct sockaddr_in remote_addr; int bytes_recv = recvfrom(mySock, recv_data,1024,0,(struct sockaddr *)&remote_addr,(socklen_t*)&sin_size); printf("got packet from IP:Port :: %s:%d\n",inet_ntoa(remote_addr.sin_addr), ntohs(remote_addr.sin_port));       In receiving data which returns remote port and IP as 0.0.0.0:0 Fix: Its happen because the sin_size is not initialize as it takes garbage bellow from system. So just initialize the sin_size will fix that.  sin_size = sizeof(remote_addr); So enjoy socket programming :)

[Asterik] configure: WARNING: *** Please install the SQLite3 development package. on Asterik

ISSUE: Asterik need SQLITE3 , when it doesn't find this then shows the following warnings - configure: WARNING: *** Asterisk now uses SQLite3 for the internal Asterisk database. configure: WARNING: *** Please install the SQLite3 development package. And the configure fails. Fix: yum install sqlite, sqlite-devel And you are done.

Easy duplex Alsa Audio capture and playback for upto CentOS 6.x and Ubuntu with easy API

Advanced Linux Sound Architecture (known by the acronym ALSA ) is a free and open source software framework released under the GNU GPL and the GNU LGPL that provides an API for sound card device drivers. It is part of the Linux kernel. Some of the goals of the ALSA project at its inception were automatic configuration of sound-card hardware and graceful handling of multiple sound devices in a system, goals which it has largely met. A couple of different frameworks, such as JACK, use ALSA to allow performing low-latency professional-grade audio editing and mixing. Concepts This section provides an overview of basic concepts pertaining to ALSA. Typically, ALSA supports up to eight cards , numbered 0 through 7; each card is a physical or logical kernel device capable of input, output, or control of sound , and card number 0 is used by default when no particular card is specified . Furthermore, each card may also be addressed by its id , which is an explanatory string such as ...