Dail out error SIP/2.0 603 Declined

I’m Unable to make calls with my current configurations.
Kindly advice, what’s wrong with my configurations
All of my configurations are mention below along with error.
Thanks in Advance… !!


asterisk -r

<------------>
– Executing [03235879678@default:1] AGI(“SIP/192.168.1.14-08f932c0”, “d.pl”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/d.pl
– AGI Script d.pl completed, returning 0
[color=red]== Auto fallthrough, channel ‘SIP/192.168.1.14-08f932c0’ status is ‘UNKNOWN’[/color]
Scheduling destruction of SIP dialog ‘B4B8729BC507469587D683F82AF243070xc0a8010e’ in 32000 ms (Method: INVITE)
trixbox1*CLI>
<— Reliably Transmitting (NAT) to 192.168.1.14:5060 —>
[color=red]SIP/2.0 603 Declined[/color]
Via: SIP/2.0/UDP 192.168.1.14;branch=z9hG4bKc0a8010e000001ee49db25e500007c7f000000a3;received=192.168.1.14;rport=5060
[color=red]From: “unknown” sip:192.168.1.14;tag=36ddc4ccfb[/color]
To: sip:03235879678@192.168.1.60;tag=as345dd9a5
Call-ID: B4B8729BC507469587D683F82AF243070xc0a8010e
CSeq: 1 INVITE
User-Agent: X-PRO build 1101
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Contact: sip:03235879678@192.168.1.60
Content-Length: 0

Sip.conf

[general]
context=default
dtmfmode=auto
allowoverlap=no
realm=Huawei.com
bindport=5060
bindaddr=0.0.0.0
dumphistory=yes
srvlookup=no
domain=huawei.com
useragent=X-PRO build 1101
usereqphone=yes
maxexpirey=180
qualify=yes
defaultexpirey=1800
nat=yes

disallow=all ; First disallow all codecs
allow=ulaw ; Allow codecs in order of preference
allow=alaw
allow=g729
allow=g723
;seragent=Linksys/PAP2T-3.1.15(LS)
useragent=eyeBeam release 3007n stamp 17816
;useragent=Motorola-IMS/3.1 807301148
;useragent=KZ Tech iSurf 1008 IAD
;useragent=WRTP54G-3.1.27
usereqphone = no ;
dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833
matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches

;[general]
;context=default ; Default context for incoming calls
;allowoverlap=no ; Disable overlap dialing support. (Default is yes)
;realm=Huawei.com ; Realm for digest authentication
;bindport=5060 ; UDP Port to bind to (SIP standard port is 5060)
;bindaddr=0.0.0.0 ; IP address to bind to (0.0.0.0 binds to all)
;srvlookup=yes ; Enable DNS SRV lookups on outbound calls
;domain=Hu ; Set default domain for this host
;maxexpirey = 120
;defaultexpirey = 120
;regseconds=120

;disallow=all ; First disallow all codecs
;allow=ulaw ; Allow codecs in order of preference
;allow=alaw
;allow=g729
;allow=g723
;useragent=Linksys/PAP2T-3.1.15(LS)
;useragent=eyeBeam release 3007n stamp 17816
;useragent=Motorola-IMS/3.1 807301148
;useragent=KZ Tech iSurf 1008 IAD
;useragent=WRTP54G-3.1.27
;usereqphone = no ;
;dtmfmode = rfc2833 ; Set default dtmfmode for sending DTMF. Default: rfc2833
;matchexterniplocally = yes ; Only substitute the externip or externhost setting if it matches

;----------------------------------------- OUTBOUND SIP REGISTRATIONS ------------------------
registertimeout=20 ; retry registration calls every 20 seconds (default)
registerattempts=0 ; Number of registration attempts before we give up

register => xxxxxxx:yyyyyyy@10.215.11.250/xxxxxxx
register => xxxxxxx:yyyyyyy@10.215.11.250/xxxxxxx
register => xxxxxxx:yyyyyyy@10.215.11.250/xxxxxxx
register => xxxxxxx:yyyyyyy@10.215.11.250/xxxxxxx

[authentication]
auth = xxxxxxx@Huawei.com:yyyyyyyy
auth = xxxxxxx@Huawei.com:yyyyyyyy
auth = xxxxxxx@Huawei.com:yyyyyyyy

;----------------------------------------- NAT SUPPORT ------------------------
;externip = 10.131.66.7 ; Address that we’re going to put in outbound SIP
;externip = 78.129.223.169

localnet=192.168.0.0/255.255.0.0; All RFC 1918 addresses are local networks

autodomain=no ; Turn this on to have Asterisk add local host
fromdomain=huawei.com ; When making outbound SIP INVITEs to

[xlite1]
type=friend
secret=blah
callerid=“Jane Smith” <5678>
host=dynamic ; This device needs to register
nat=yes ; X-Lite is behind a NAT router
canreinvite=no ; Typically set to NO if behind NAT
fromdomain=huawei.com
Host=huawei.com
disallow=all
allow=ulaw
allow=alaw
allow=g729
allow=gsm ; GSM consumes far less bandwidth than ulaw
context=default

;---------------- TRUNKS -------------------

[192.168.1.14]
type=friend
context=default
host=192.168.1.14
canreinvite=no
disallow=all
allow=g729
allow=g723
allow=ulaw
allow=alaw
nat=yes

[xxxxxxx]
type=friend
secret=yyyyyyy
username=xxxxxxx@10.215.11.250
fromuser=xxxxxxx
fromdomain=huawei.com
host=huawei.com
defaultip=192.168.1.14
context=sip
userregphone=yes
outboundproxy=10.215.11.250
port=5060
regseconds=10

[xxxxxxx]
type=friend
secret=yyyyyyy
username=xxxxxxx@10.215.11.250
fromuser=xxxxxxx
fromdomain=huawei.com
host=Huawei.com
userregphone=yes
outboundproxy=10.215.11.250
port=5060
regseconds=10

[xxxxxxx]
type=friend
secret=yyyyyyy
username=xxxxxxx@10.215.11.250
fromuser=xxxxxxx
fromdomain=huawei.com
host=Huawei.com
userregphone=yes
outboundproxy=10.215.11.250
port=5060
regseconds=10

extensions.conf

[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
CONSOLE=Console/dsp ; Console interface for demo

[default]
exten => _X.,1,agi,d.pl
exten => _X.,3,Hangup
exten => 99999,1,Dial(SIP/0218010094/92214321901)
exten => 99999,2,Hangup

Agi-script

#!/usr/bin/perl

use Asterisk::AGI;

use DBI;

use DBD::Pg;

use POSIX;

sub logger ($) {

$AGI->verbose("@_", 1);

}

sub elogger ($) {

$AGI->verbose("@_", 1);

open(ERRLOG, '>>/var/log/deErr.log');

print ERRLOG "@_ \n";

close (ERRLOG);

}

$AGI = new Asterisk::AGI;

my %input = $AGI->ReadParse();

my $todial = “”;

my $inputdid = $input{‘dnid’};

$inputdid =~ s/^92/0/;

my $num_len = length($inputdid);

my $call_flag = 0;

if ( ($inputdid =~ /^03/) && ($num_len==11) )

{

    $call_flag=1;

}

elsif( ($inputdid =~ /^02/) && ($num_len==10) )

{

$call_flag=1;

}

elsif( ($inputdid =~ /^04/) && ($num_len==10) )

{

$call_flag=1;

}

elsif( ($inputdid =~ /^05/) && ($num_len==10) )

{

$call_flag=1;

}

elsif( ($inputdid =~ /^06/) && ($num_len==10) )

{

$call_flag=1;

}

elsif( ($inputdid =~ /^07/) && ($num_len==10) )

{

$call_flag=1;

}

elsif( ($inputdid =~ /^08/) && ($num_len==10) )

{

$call_flag=1;

}

elsif( ($inputdid =~ /^09/) && ($num_len==10) )

{

$call_flag=1;

}

else

{

$call_flag=0;

}

if ($call_flag eq “1”)

{

# Connect to Database

my $dsn = 'dbi:Pg:dbname=viz;host=127.0.0.1;';

my $dbh = DBI->connect($dsn, "", "");

if (!$dbh) {

	elogger "error connecting to database ($inputdid) !";

	$AGI->set_variable('hangup','1');

    	exit;

}



my $query2 = "select did from numbers where status=1 and activechan<maxchan and (now()-lasthit)> (interval '30 seconds') order by (now()-lasthit) desc limit 1";

my $xth = $dbh->prepare (qq {$query2});

$xth->execute();

my ($did) = $xth->fetchrow_array();

logger ("called: $inputdid, selected DID: $did");



if ($did) 

{



	my $vx1 = "update numbers set activechan=activechan + 1, lasthit=now() where did='$did'";

logger ($vx1);

	my $vx1_a = $dbh->prepare (qq { $vx1 });

	$vx1_a->execute();

	$vx1_a->finish();



	$AGI->exec('Set',"CALLERID(ani)=$did");

	$AGI->exec('Set',"CALLERID(name)=$did");

	$AGI->exec('Set',"CALLEDTON=local");

	$todial = "SIP/$did/$inputdid";	

	$AGI->exec('Dial',$todial);

        my $answeredtime = $AGI->get_variable('ANSWEREDTIME');

	$answeredtime = $answeredtime / 60;



     	my $vx2 = "update numbers set activechan=activechan-1, minstoday=minstoday + $answeredtime where did='$did'";

logger ($vx2);

        my $vx2_a = $dbh->prepare (qq { $vx2 });

    	$vx2_a->execute();

        $vx2_a->finish();	

}

else 

{

	logger ("All DIDs busy !");

}



$dbh->disconnect();	

}

else

{

logger ("Invalid Called $inputdid Length: $num_len ");

}

exit;