Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Perl-AGI process


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
abdul_zu at yahoo.com
Guest





PostPosted: Sat Jan 12, 2008 7:05 am    Post subject: [asterisk-users] Perl-AGI process Reply with quote

Hi All,

i have created one prepaid PERL AGI script to integrate asterisk users in our current Oracle Billing System. I am using $AGI->exec('Dial', $dialstr); in script after getting the MAX time out for the priticular call.

But when the channels increase on my asterisk more than 50-60 asterisk get crashed and i am suspecting the cause is of AGI Script. because when i check ps on server i found lot of process for routing.pl file which is the main to check balance and max credit time.

[root at hatifserver3 root]# ps -aux|grep asterisk
root 16419 0.0 0.0 5288 1072 pts/1 S 10:46 0:00 /bin/sh /usr/sbin/safe_asterisk
root 16421 32.5 0.4 39404 17604 pts/1 S 10:46 22:39 /usr/sbin/asterisk -f -vvvg -c
root 24537 0.0 0.2 96392 10472 pts/1 S 11:29 0:00 /usr/local/bin/perl /var/lib/asterisk/agi-bin/routing.pl
root 26821 0.0 0.2 96392 10472 pts/1 S 11:41 0:00 /usr/local/bin/perl /var/lib/asterisk/agi-bin/routing.pl
root 27177 0.0 0.2 96384 10476 pts/1 S 11:43 0:00 /usr/local/bin/perl /var/lib/asterisk/agi-bin/routing.pl

it is more than this just i put only few for example.
I think the routing.pl file continue running till the call hangup.

My question is, Is there anyway to kill the routing.pl once $AGI->exec('Dial', $dialstr); will run and the call should be continue?



--------
Regard,

---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080112/0b067980/attachment.htm
Back to top
tpeirce at digitalcon.ca
Guest





PostPosted: Sat Jan 12, 2008 8:32 am    Post subject: [asterisk-users] Perl-AGI process Reply with quote

Abdul wrote:
Quote:
i have created one prepaid PERL AGI script to integrate asterisk users
in our current Oracle Billing System. I am using $AGI->exec('Dial',
$dialstr); in script after getting the MAX time out for the priticular
call.
...
My question is, Is there anyway to kill the routing.pl once
$AGI->exec('Dial', $dialstr); will run and the call should be continue?

No, the AGI won't exit until that command has completed and the AGI
terminates on it's own. What I have done in the past is instead of
Dial, I use SetVar to set the timeout (and any other dial options) into
a variable. Then in my asterisk dial plan I call the Dial command with
that variable.

Or putting it another way in pseudo code:

Dialplan:
s,n,AGI(routecall.agi)
s,n,Dial(${routecall-destination},${routecall-args})

routecall.agi script:
SetVar(routecall-destination) = SIP/blah
SetVar(routecall-args) = L(60000:10000)

Best regards,
Trevor Peirce

--
Real CNAM data for incoming Caller ID @ www.cnam.info
Back to top
abdul_zu at yahoo.com
Guest





PostPosted: Sat Jan 12, 2008 9:35 am    Post subject: [asterisk-users] Perl-AGI process Reply with quote

HI Trevor,

Thank you for your suggestion.
I configured to use what u told as following but not working still.

routes.pl
$dgw = 'SIP/5556'; #A-Z carrier
$opt = 'L(60000:10000)';
$AGI->set_variable(routecall-destination, $dgw);
$AGI->set_variable(routecall-args, $opt);

Extnenitons.conf
[testwell]
exten => _x.,1,Set(TIMEOUT(absolute)=3660)
exten => _x.,2,AGI(routes.pl)
exten => _x.,3,Dial(${routecall-destination},${routecall-args})
exten => h,1,DeadAGI(stop.pl)
Warnning :

[Jan 12 14:34:22] WARNING[27323]: app_dial.c:863 dial_exec_full: Dial requires an argument (technology/number)
== Spawn extension (testwell, 9745424620, 9) exited non-zero on 'SIP/8098179675-b726f5e8'


Could you please find out where is the problem?





Abdul <abdul_zu at yahoo.com> wrote: Hi All,

i have created one prepaid PERL AGI script to integrate asterisk users in our current Oracle Billing System. I am using $AGI->exec('Dial', $dialstr); in script after getting the MAX time out for the priticular call.

But when the channels increase on my asterisk more than 50-60 asterisk get crashed and i am suspecting the cause is of AGI Script. because when i check ps on server i found lot of process for routing.pl file which is the main to check balance and max credit time.

[root at hatifserver3 root]# ps -aux|grep asterisk
root 16419 0.0 0.0 5288 1072 pts/1 S 10:46 0:00 /bin/sh /usr/sbin/safe_asterisk
root 16421 32.5 0.4 39404 17604 pts/1 S 10:46 22:39 /usr/sbin/asterisk -f -vvvg -c
root 24537 0.0 0.2 96392 10472 pts/1 S 11:29 0:00 /usr/local/bin/perl /var/lib/asterisk/agi-bin/routing.pl
root 26821 0.0 0.2 96392 10472 pts/1 S 11:41 0:00 /usr/local/bin/perl /var/lib/asterisk/agi-bin/routing.pl
root 27177 0.0 0.2 96384 10476 pts/1 S 11:43 0:00 /usr/local/bin/perl /var/lib/asterisk/agi-bin/routing.pl

it is more than this just i put only few for example.
I think the routing.pl file continue running till the call hangup.

My question is, Is there anyway to kill the routing.pl once $AGI->exec('Dial', $dialstr); will run and the call should be continue?





--------
Regard,

---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.


--------
Regard,

---------------------------------
Never miss a thing. Make Yahoo your homepage.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080112/a340123b/attachment-0001.htm
Back to top
tpeirce at digitalcon.ca
Guest





PostPosted: Sun Jan 13, 2008 1:10 pm    Post subject: [asterisk-users] Perl-AGI process Reply with quote

Abdul wrote:
Quote:
routes.pl
$dgw = 'SIP/5556'; #A-Z carrier
$opt = 'L(60000:10000)';
$AGI->set_variable(routecall-destination, $dgw);
$AGI->set_variable(routecall-args, $opt);

Extnenitons.conf
[testwell]
exten => _x.,1,Set(TIMEOUT(absolute)=3660)
exten => _x.,2,AGI(routes.pl)
exten => _x.,3,Dial(${routecall-destination},${routecall-args})
exten => h,1,DeadAGI(stop.pl)


Warnning :

[Jan 12 14:34:22] WARNING[27323]: app_dial.c:863 dial_exec_full: Dial
requires an argument (technology/number)
== Spawn extension (testwell, 9745424620, 9) exited non-zero on
'SIP/8098179675-b726f5e8'
Hmm. You might be having problems with escaping. That's one thing I
recall bothered me about Asterisk::AGI

The best way to debug it is to add NoOp(routecall-destination =
${routecall-destination}) to your dial plan and look at the verbose
output to see what it's saying. Then try adding some escapes to your
Perl script and see if that helps.

That's first a single quote ' then a double quote " as below, and to
close it obviously a double then a single:

$dgw = '"SIP/5556"'; #A-Z carrier
$opt = '"L(60000:10000)"';

--
Real CNAM data for incoming Caller ID @ www.cnam.info
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services