Super Technologies Inc. @ Communication Asia
by arfeen on Jun.16, 2009, under Blog
DIDX is a Sponsor @ the Communication Asia
Be the first to get hold of the latest innovations from around the world,
like the Asus Gramin Phone which includes the Gramin’s Navigator inside it.
The show is over 7 Expo Halls with hundreds of companies exhibiting in it.
Booth number is 4P3-09 In Hall 4
In Communication Asia Show
Singapore Exhibition Center
Expo Center Station on the Tube Station (MRT)
Singapore Number is 8141-8468
Super Technologies now also offer
Hosted PBX
Hosted Call Forwarding and Management System
Hosted SIP Based phone services.
Asterisk AEL and func_odbc.conf example.
by arfeen on Jun.13, 2009, under Blog
Here is another Asterisk AEL example using func_odbc.conf.
You can call DB routines or querys from MySQL in your Asterisk AEL.
How to start ?
We first need to configure the ODBC connections which we will use in our func_odbc.conf. I assumed here, we have already setup ODBC DSN.
func_odbc.conf and extensions.ael are usually created in /etc/asterisk.
All the quries in the func_odbc.conf will be called a function and names will be defined as context, next line for DSN, and then read or write keywords.
e.g.,
[CHECKNAME] ;function name
dsn=mydsn ;dsn for ODBC connection
read=select name from users where user=’1001′ ;actual query. for update/insert use keyword “write” instead read
To use the arguments, coming from AEL, we will special functionSQL_ESC().
This function is a part of the ODBC module and ODBC must be compiled into Asterisk for this function to be available.
e.g.,
[CHECKNAME] ;function name
dsn=mydsn ;dsn for ODBC connection
read=select name from users where userid=’${SQL_ESC(${ARG1})}’ ;actual query. for update/insert use keyword “write” instead read
or for update the DB record
[UPDATENAME] ;function name
dsn=mydsn ;dsn for ODBC connection
write=update users set Active=1 where userid=’${SQL_ESC(${VAL1})}’
VAL and ARG notations used usually for values supplied and the arguments passed to the query respectively.
Calling Queries in Asterisk AEL:
To call the query (read from DB) built in func_odbc.conf,
Set(USERNAME=${ODBC_CHECKNAME(${EXTEN})});
Here ODBC_ is the keyword that calls the function ‘CHECKNAME’ from func_odbc.conf
e.g.
context default {
1001 => {
Answer();
;This line calling function and supplying extension no as argument to SQL Query.
Set(USERNAME=${ODBC_CHECKNAME(${EXTEN})});
;Display output on CLI
NoOp( User of the extension is: ${USERNAME} );
;Now updating user name, here NiceName would be update where userid is extension.
Set(ODBC_CHECKNAME(${EXTEN})=NiceName);
};
};
Each time changing in the file func_odbc.conf, we need to reload the module using:
CLI> module reload func_odbc.so
Same goes for Asterisk AEL, it is needed to be reloaded after evey update in the file using:
CLI>aelreload
It’s better to compile and check the Asterisk AEL file before compiling in CLI. Use the application “aelparse” on the shell which will display
the compilation information including errors, if any.
How to send email with attachment in PERL
by arfeen on Jun.04, 2009, under Blog
Here is a sample code which demonstrates how to send an email with file attachement.
#!/usr/bin/perl
my $FileName = "/var/home/myfile.jpg";
my $FileNameToMail = "ImageFile.jpg";
SendRecFile();
sub SendRecFile {
use MIME::Lite;
my $msg = MIME::Lite->new(
From => "email\@email.com",
To => "you\@domain.com",
Subject => "Testing Attachment in PERL",
Type => "multipart/mixed",
);
$msg->attach(
Type => 'TEXT',
Data => "File is attached",
);
$msg->attach(
Type => 'image/jpeg', # Content Type
Path => $FileName
Filename => $FileNameToMail,
Disposition => 'attachment'
);
$msg->send;
}
DID Numbers on DIDx.net
by arfeen on Jun.04, 2009, under Blog
If you want to buy/sell DID number from all over the world, DIDx.net is the place where you can do it. See available coverage on DIDx.net on http://www.didx.net/DID/ To signup, http://www.didx.net/signup.
Asterisk AEL
by arfeen on May.17, 2009, under Blog
I have started working on Asterisk Extension Language to avoid AGI scripting in Asterisk. AGI is not having much calls and so it crashes the Asterisk. That is why we need to write our script Asterisk AEL.
Though, I have not much done in Asterisk AEL, but I just want to share how to start a little Hello World AEL. Make a file extensions.ael in /etc/asterisk .
context default { userexten { NoOp(Hello World); }; };Go to Asterisk CLI and write the command:
CLI*> ael reloadThis command will reload the AEL you have written and will show the error as well on the CLI.
So far I have seen that, the AEL is trying to capture all the extensions.conf.
So, you must check if this is happening then your extensions.conf will be usesless,
I’m still studying on it and I’m facing this problem. For more info visit http://www.voip-info.org
My Facebook Profile Badge
by arfeen on May.02, 2009, under Blog
This is my Facebook Profile Badge
http://www.facebook.com/arfeen
My class won PHP Classes innovation award
by arfeen on Mar.01, 2009, under Blog
One of my php classes which was submitted to phpclasses.org, won phphclasses.org innovation awards.
http://www.phpclasses.org/winners/
My class nominated for phpclasses.org awards
by arfeen on Feb.01, 2009, under Blog
One of my php class which was submitted to phpclasses.org, is now nominated for phphclasses.org awards.
http://www.phpclasses.org/browse/package/5099.html
