SIP Configuration from MYSQL

i make DB with the name of “asterisk” and make Perl file with the name of “sip_conf.pl”. when i execute that file its working fine as shown below:

[color=#FF0000][root@localhost ~]# /etc/asterisk/sip_conf.pl
[1101]
host=dynamic
nat=yes
type=friend
call-limit=0
cancallforward=no
canreinvite=no
context=internal
dtmfmode=rfc2833
qualify=yes
disallow=all
allow=g729
username=Jone[/color]

[color=#0000FF]then i include that Perl file in sip.conf file as shonw below:
[general]
#include sip_conf.pl (is it correct?)[/color]

[color=#FF0000]but when i reload the sip file with the help of “sip reload” then below given error is shown:
localhost*CLI> sip reload
Reloading SIP
== Parsing ‘/etc/asterisk/sip.conf’: == Found
== Parsing ‘/etc/asterisk/sip_additional.conf’: == Found
== Parsing ‘/etc/asterisk/sip_conf.pl’: == Found
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#!/usr/bin/perl’ at line 1 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 2 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘###################’ at line 3 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#’ at line 5 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 11 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#CONNECTION’ at line 14 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 16 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 25 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#’ at line 26 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 27 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 30 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 34 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 35 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 36 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 41 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#’ at line 42 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 43 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 46 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 50 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 51 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 52 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#’ at line 54 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 57 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 59 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 61 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#print’ at line 62 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 64 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#’ at line 66 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 67 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#’ at line 68 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 70 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 72 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 75 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 76 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 78 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 79 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1041 process_text_line: Unknown directive ‘#print’ at line 80 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 82 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 83 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 84 of /etc/asterisk/sip_conf.pl
[Jan 22 21:30:44] WARNING[2577]: config.c:1165 process_text_line: No ‘=’ (equal sign) in line 86 of /etc/asterisk/sip_conf.pl
== Parsing ‘/etc/asterisk/users.conf’: == Found
== Using SIP CoS mark 4
== Parsing ‘/etc/asterisk/sip_notify.conf’: == Found[/color]

[color=#0000FF]and when i make register in Xlite (soft phone) the below given error is shown:
[Jan 22 18:21:28] NOTICE[2577]: chan_sip.c:21819 handle_request_register: Registration from ‘"Jone"sip:1101@192.168.1.15’ failed for ‘192.168.1.3’ – No matching peer found[/color]

can anyone help me, how to include the perl file in sip.conf or if any other mistake is happening, plz guide me…

thnaks…

Don’t you need to #exec the .pl file rather than #include-ing it?

Reading the documentation, I believe you also need to set xecinclude=yes in the [options] section of asterisk.conf.

I’ve not tried this myself, my answer is purely from my reading of the documentation.