Delay when placing a call - AGI script

Hello !

I’m having some issues with my asterisk box: placing a call between two registered extensison takes around 10 secs. I noticed the AGI scripts coming with freepbx introduce this delay:

[Jan  2 15:48:12] VERBOSE[6224] logger.c:     -- Executing [s@macro-exten-vm:6] Set("SIP/2707-9fb09260", "RT=30") in new stack
[Jan  2 15:48:12] VERBOSE[6224] logger.c:     -- Executing [s@macro-exten-vm:7] Macro("SIP/2707-9fb09260", "record-enable|7960|IN") in new stack
[Jan  2 15:48:12] DEBUG[6224] pbx.c: Function result is '0'
[Jan  2 15:48:12] VERBOSE[6224] logger.c:     -- Executing [s@macro-record-enable:1] GotoIf("SIP/2707-9fb09260", "0 > 0?2:4") in new stack
[Jan  2 15:48:12] VERBOSE[6224] logger.c:     -- Goto (macro-record-enable,s,4)
[Jan  2 15:48:12] VERBOSE[6224] logger.c:     -- Executing [s@macro-record-enable:4] DeadAGI("SIP/2707-9fb09260", "recordingcheck||1167749292.8") in new stack
[Jan  2 15:48:12] VERBOSE[6224] logger.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
[Jan  2 15:48:17] VERBOSE[6224] logger.c:   recordingcheck||1167749292.8: Inbound recording not enabled
[Jan  2 15:48:17] VERBOSE[6224] logger.c:     -- AGI Script recordingcheck completed, returning 0
[Jan  2 15:48:17] VERBOSE[6224] logger.c:     -- Executing [s@macro-record-enable:5] NoOp("SIP/2707-9fb09260", "No recording needed") in new stack
[Jan  2 15:48:17] VERBOSE[6224] logger.c:     -- Executing [s@macro-exten-vm:8] Macro("SIP/2707-9fb09260", "dial|30|tr|7960") in new stack
[Jan  2 15:48:17] VERBOSE[6224] logger.c:     -- Executing [s@macro-dial:1] DeadAGI("SIP/2707-9fb09260", "dialparties.agi") in new stack
[Jan  2 15:48:17] VERBOSE[6224] logger.c:     -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
[Jan  2 15:48:22] VERBOSE[6224] logger.c:   dialparties.agi: Starting New Dialparties.agi
[Jan  2 15:48:22] VERBOSE[6224] logger.c:   dialparties.agi: priority is 1
[Jan  2 15:48:22] VERBOSE[6224] logger.c:   dialparties.agi: Caller ID name is 'Vincent Thinselin' number is '2707'
[Jan  2 15:48:22] VERBOSE[6224] logger.c:   dialparties.agi: Methodology of ring is  'none'
[Jan  2 15:48:22] VERBOSE[6224] logger.c:     --  dialparties.agi: Added extension 7960 to extension map
[Jan  2 15:48:22] DEBUG[6224] db.c: Unable to find key '7960' in family 'CF'
[Jan  2 15:48:22] VERBOSE[6224] logger.c:     --  dialparties.agi: Extension 7960 cf is disabled
[Jan  2 15:48:22] DEBUG[6224] db.c: Unable to find key '7960' in family 'DND'
[Jan  2 15:48:22] VERBOSE[6224] logger.c:     --  dialparties.agi: Extension 7960 do not disturb is disabled

5 seconds lost because of recordingcheck and another 5 because of dialparties …
Do you have a clue on why I get this behavior ?
I have tried with the recent 1.4 and same thing with 1.2.14, all with freepbx
Running CentOS release 4.4 (Final)

Cheers,
Vincent.

in your position i would ask this question (after searching the forum at FreePBX first) to the devs over there.

i recall dialparties having a bug that introduced a delay, but this was some time ago (like a year !)

Thanks !

I have already searched ar freepbx forums, and even googling around didn’t help me a lot. I’ll follow your advice and ask to devs.

Cheers,
Vincent

are you up to editing dialparties.agi so you can find out where it’s getting delayed ? if you can output to the console at checkpoints you can start to work out at which point it’s hanging.

the imposed delays in the FreePBX scripts are one reason i don’t use it anymore. it’s not particularly suited to UK setups imo.

Hi !

Yes, I can put some debug messages and find out wher the delay comes from.
What is strange is that it used to work, and suddenly… not.

Let’s see if my PHP is stil up-to-date.

V.

Well well well…

Jan 4 16:26:44 VERBOSE[10304] logger.c: – Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
Jan 4 16:26:49 VERBOSE[10304] logger.c: dialparties.agi: Starting New Dialparties.agi

The first debug message appears with 5 secs delay. So it looks like it takes time to load !!! Any idea ?

Edit:
[root@idefix agi-bin]# time php -v
PHP 4.3.9 (cgi) (built: Nov 7 2006 09:14:36)
Copyright © 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright © 1998-2004 Zend Technologies

real 0m5.042s
user 0m0.034s
sys 0m0.007s
[root@idefix agi-bin]#

So it is PHP that takes time !!! Any idea on how to improve this ?
Thanks.
V.