Categories

Archives

Reminder App for Facebook

facebook reminder app

Facebook reminder app – User Interface

It was quite challenging, but I managed to convert this into a facebook app. It was challenging due to poor documentation at facebook how to make facebook apps, and obsolete tutorials and blogs on this subject, since facebook has updated their apps api in June 2010.

Anyways, now the reminder service is there, up and running. If you have a facebook account, all you need to do is search for ‘reminders’, and it’ll show you a reminders app with a telephone icon as follows:

Just click it, and it’ll ask you that the app wants your basic info and your email address. Accept it, and you are all setup to use the reminder app.

Or even simpler, just click the app screenshot above and it’ll take you to facebook and install the app for you, if you gave it permission to do so.

The interface is simple to use, made in JavaScript, very user friendly.

All the items are self explanatory, along with a help icons which tell you how to use the associated fields.

As a new user, $10 are added to your account. You have to register your phone numbers where you would like to receive the reminder calls.

Give it a try and I am sure you’ll find it a very useful app. Just a note, that the phone reminder part is good only for North America. Rest of the world can use only email reminders. Based on demand, I’ll see if I can open the International routes to certain countries.

3 people like this post.
Unlike

Setup SNMP on an Asterisk server

SNMP – Simple Network Monitoring Protocol, as it name suggests, is a protocol used to monitor various properties of network equipment. These properties are identified by something called OIDs (Object Identifiers) which are long numeric strings and identify various things, like hardware version, time on the device, data flow rate, and tons of other stuff.O OIDs and grouped in what is called a MIB (Management Information [...]

How to extract one particular call from the huge call log file

If you have a busy system, the activity output on the Asterisk CLI screen is totally useless. It scrolls so fast with so much information that you really can’t make sense of anything you see on the screen, and there is no way to limit this information to only to certain important commands and outputs which you really care about for your system. So then how to troubleshoot a call on such a system.

By default Asterisk stores call activity log in folder /var/log/asterisk either in file named messages or file named full. As the name suggests, the full file has more detailed record, and this is what we shall consider for the purpose of this blog.

This file can be hundred of mega byte in size based on how busy your system is. In order to analyze the contents of this file for a particular call, first of all what you need to do is to find the session id for that call. If you carefully note on the What you need to do for troubleshooting purposes is to extract a single call from it in a separate file and and then analyze it.

Consider the following example. Today a client of mine called regarding some issue calling a particular number. We shall assume the number was 7055623000. Now for my particular dial plan, which is very complex, but because I have personally hand coded it all from scratch, I know every line of it. So I would know where a particular call starts and how the dial plan flows. But even if I won’t, I would ask the client for:

The number the client was having trouble with
The time when the client was having this trouble.

When you have the number, i.e. 7055623000 in this case and you know the time of problem was around 11:40, open the log file in a text editor or viewer and search for this number. In my dialplan it would look something like following:

[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [7055623000@outbound:1] SetGlobalVar(“SIP/200.10-b6b41328″, “CALL_DIRECTION=OUT”) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [7055623000@outbound:2] Set(“SIP/200.10-b6b41328″, “userid=”10″”) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [7055623000@outbound:3] NoOp(“SIP/200.10-b6b41328″, ” – - – Incoming CID is 0 – - – “) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [7055623000@outbound:4] GotoIf(“SIP/200.10-b6b41328″, “1?5:7″) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [7055623000@outbound:5] Verbose(“SIP/200.10-b6b41328″, ” – - – Changing caller id for outbound call – - – “) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [7055623000@outbound:6] Macro(“SIP/200.10-b6b41328″, “set_callerid|200″) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [s@macro-set_callerid:1] Set(“SIP/200.10-b6b41328″, “ext=200″) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [s@macro-set_callerid:2] NoOp(“SIP/200.10-b6b41328″, “_______________________________________________________________________________________________”) in new stack
[2011-02-24 11:40:15] VERBOSE[13102] logger.c:     — Executing [s@macro-set_callerid:3] NoOp(“SIP/200.10-b6b41328″, ”                               S E T   C A L L E R I D   A N D   N A M E   [...]

From Scratch to Finish: Setting up and Configure Asterisk for Production

centos2

Unlike my very first painful installs of Asterisk 1.0.9 on Fedora 4 in 2004, nowadays it is very easy to install Asterisk on almost any system. I did a brand new setup of Asterisk yesterday on CentOS, and noted down all the step both for my own reference and to help anybody who wants to do a similar [...]

Getting started with AEL

Male hands typing on a laptop

AEL stands for Asterisk Extensions Language. It is intended to make writing dialplans easier than the standard syntax used in extensions.conf. The standard syntax is not very user friendly, makes it difficult to write complex dialplans, and makes it even more difficult to read those dialplans. AEL on the other hand makes writing dialplans much easier and faster, plus its syntax is like a programming language which programmers are more familiar [...]

The h Extension

The h extension is a great extension, and when a call is hung up by any of the parties, i.e. either by the caller or by the callee, asterisk dialplan looks for the h extension before hanging up the call. Same is true for a conference call, when a user exits, first asterisk looks for the h extension for the hung up leg of the [...]

Some Considerations on Asterisk for Receiving DTMF

dialpad2

The problem with the inband DTMF is that telephone systems can also take high pitch sounds as some random DTMF digit. It happens in real life that a woman talking on the phone suddenly hears a DTMF digit send to the phone system when she had not pressed any digit. Women’s voices have higher pitch so they can more easily be incorrectly recognized as a DTMF digit than a male voice. Another drawback of inband DTMF is that if line is bad and call’s voice is not clear, DTMF won’t be sent correctly and the other end will not be able to correctly understand it. A noisy background can also cause the same effect. Using any codec other than g711/ulaw/alaw will also generally result the DTMF audio getting [...]

Check SIP Extension Status Using PHP and AGI Scripting

If you are using PHP for AGI scripting in Asterisk, you must already be familiar with these two wonderful libraries: phpagi.php and phpagi-asmanager.php. If not, then you should. These two libraries already contain all the AGI and Asterisk Manager commands ready for use in PHP scripts. Chances are that these libraries already exist on your system, otherwise you can always download them from [...]

Keep track of number of active calls in Asterisk

How to keep track of the total number of calls in Asterisk? There is no predefined variable yet which keeps track of this very important piece of information, which is sometimes very critical to make certain decisions in a dialplan.

There are various ways to get this information, e.g. you can do:

asterisk -rx “show channels” | awk ‘END{print [...]

Scaling an Asterisk installation

Scaling basically means that if the hardware in your system can’t handle any more load, then the system should be able to take additional hardware and share extra load with it. In case of VoIP calls, if you server is capable of handling, lets say 300 concurrent calls, and thanks to your evolving business now your call volume is going beyond 300 concurrent calls, then adding an additional server should take these additional calls and this way share the load of this extra call volume.

There are various ways to scale any system. In case of an Asterisk server, we can scale it simply in its dialplan by defining additional trunks to use in case the traffic volume is more than usual.

Lets say we have two asterisk servers: Asterisk-A and Asterisk-B. We can connect them using both IAX and SIP trunks. It is very simple to do. I prefer to use IAX trunking between the asterisk servers, because this is what this protocol is designed for (IAX – Inter Asterisk eXchange).

For the sake of this example, we’ll assume that Asterisk-A has IP address 192.168.0.10 and Asterisk-B has IP address 192.168.0.11. The context which processes the calls is named [main-context]. Communication takes place over ulaw.

Create the following context in iax.conf on Asterisk A:

[mytrunk]
host=192.168.0.11
type=friend
qualify=yes
trunk=yes
disallow=all
allow=ulaw
context=main-context

Now create the following context in iax.conf on Asterisk B:

[mytrunk]
host=192.168.90.10
type=friend
qualify=yes
trunk=yes
disallow=all
allow=ulaw
context=main-context

The only difference in the above is that of the IP addresses.

Now reload IAX on both the servers, from asterisk CLI:

iax2 reload

Once done, you can see the status of these trunks using:

iax2 show peers
iax2 show users

These command will show the status of these trunks like this:

Asterisk-A*CLI> iax2 show peers
Name/Username    Host                 Mask             Port          Status
trunkb           192.168.0.11    (S)  255.255.255.255  4569 (T)      OK (2 ms)
1 iax2 peers [1 online, 0 offline, 0 unmonitored]
Asterisk-A*CLI> iax2 show users
Username         Secret                Authen           Def.Context      A/C    Codec Pref
trunkb           -no secret-           000000000000003  main-context   No     Host

This means that the trunks are ready for use.

Taking into account that Asterisk-A is the primary server which is receiving and sending calls, now in the dialplan you can introduce a condition so that if the number of calls is greater than 300, direct them to Asterisk-B. For example if NUMCALLS is the variable keeping track of the active calls, and the name of your default trunk is ‘main-trunk’, you can do the following:

(AEL example)

Set(TRUNK=”main-trunk”);
if(“${NUMCALLS}”>”300″) { Set(TRUNK=”mytrunk”); };
Dial(SIP/${TRUNK}/${EXTEN});

(non-AEL example)

exten => _.,1,Set(TRUNK=”main-trunk”)
exten => _.,n,GotoIf($["${NUMCALLS}">"300"]?scale:noscale)
exten => _.,n(scale),Set(TRUNK=”mytrunk”)
exten => _.,n(noscale),Dial(SIP/${TRUNK}/${EXTEN});
To learn how to setup a variable like NUMCALLS to keep track of your active calls, see my blog ”Keep track of number of active calls in Asterisk”, which has its link in the list below.

1 person likes this post.
Unlike