OK, I would suggest you get two ssh sessions going on one,
tailf /var/log/asterisk/full|grep -E "AGI"
on the other,
rasterisk -x
Now, you will see why further debug output is needed . . . the lines in your tailf that start with
AGI Tx >>
AGI Rx <<
will be what Asterisk sends to your script (Tx) and what you send to asterisk (Rx), Waht you posted gives
-- Executing [1712NXXXXXX@from-internal:2] AGI("SIP/7250-000313f7", "numsearch2.php,1712NXXXXXX") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/numsearch2.php
AGI Tx >> agi_request: numsearch2.php
AGI Tx >> agi_channel: SIP/7250-000313f7
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1446589711.715831
AGI Tx >> agi_version: 11.16.0
AGI Tx >> agi_callerid: 7250
AGI Tx >> agi_calleridname: 7250 matt
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 1712NXXXXXX
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: from-internal
AGI Tx >> agi_extension: 1712NXXXXXX
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >> agi_threadid: 139932559197952
AGI Tx >> agi_arg_1: 1712NXXXXXX
AGI Tx >>
AGI Rx << ANSWER
[INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('ANSWER',{ts '2015-11-03 16:28:31.976075'},'7250 matt','7250','7250','','1712NXXXXXX','1712NXXXXXX','from-internal','SIP/7250-000313f7','AGI','numsearch2.php,1712NXXXXXX',3,'','1446589711.715831','1446589711.715831','','','')]
0x7f44895cc520 -- Probation passed - setting RTP source address to xxx.xxx.xxx.xxx:41245
AGI Tx >> 200 result=0
AGI Rx << EXEC Dial LOCAL/1712NXXXXXX
-- AGI Script Executing Application: (Dial) Options: (LOCAL/1712NXXXXXX)
[INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_START',{ts '2015-11-03 16:28:32.59664'},'','','','','','1712NXXXXXX','default','Local/1712NXXXXXX@default-0003ec1f;1','','',3,'','1446589712.715832','1446589711.715831','','','')]
[INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_START',{ts '2015-11-03 16:28:32.61460'},'','','','','','1712NXXXXXX','default','Local/1712NXXXXXX@default-0003ec1f;2','','',3,'','1446589712.715833','1446589711.715831','','','')]
[2015-11-03 16:28:32] NOTICE[32678][C-00044dde]: chan_local.c:971 local_call: No such extension/context 1712NXXXXXX@default while calling Local channel
-- Couldn't call LOCAL/1712NXXXXXX
--
AGI Tx >> 200 result=0
[INSERT INTO cel (eventtype,eventtime,cid_name,cid_num,cid_ani,cid_rdnis,cid_dnid,exten,context,channame,appname,appdata,amaflags,accountcode,uniqueid,linkedid,peer,userdeftype,userfield) VALUES ('CHAN_END',{ts '2015-11-03 16:28:32.65281'},'','1712NXXXXXX','','','','1712NXXXXXX','default','Local/1712NXXXXXX@default-0003ec1f;1','AppDial','(Outgoing Line)',3,'','1446589712.715832','1446589711.715831','','','')]
-- AGI Script numsearch2.php completed, returning 0
-- Executing [1712NXXXXXX@from-internal:3] Set("SIP/7250-000313f7", "MOHCLASS=default") in new stack
-- Executing [1712NXXXXXX@from-internal:4] Set("SIP/7250-000313f7", "_NODEST=") in new stack
-- Executing [1712NXXXXXX@from-internal:5] Macro("SIP/7250-000313f7", "dialout-trunk,2,1712NXXXXXX,,off") in new stack
-- Executing [s@macro-dialout-trunk:1] Set("SIP/7250-000313f7", "DIAL_TRUNK=2") in new stack
In your log:-
[2015-11-03 16:28:32] NOTICE[32678][C-00044dde]: chan_local.c:971 local_call: No such extension/context 1712NXXXXXX@default while calling Local channel
(I thought I told you that already, no? )