Mij lijkt dat Asterisk ook niet moet ophangen na het uitvoeren van een script, maar het gebeurt wel.
Onze normale bel procedure is de standaard procedure van Trixbox/Asterisk, hier hebben wij niets aan gewijzigd.
Als ik bijvoorbeeld inlog op de asterisk console en dan in de gaten houd wat er allemaal gebeurt, dan zie ik bij een normaal inkomend gesprek dit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
| -- Executing [605@from-internal:1] Macro("SIP/606-b7707900", "exten-vm|novm|605") in new stack
-- Executing [s@macro-exten-vm:1] Macro("SIP/606-b7707900", "user-callerid") in new stack
-- Executing [s@macro-user-callerid:1] Set("SIP/606-b7707900", "AMPUSER=606") in new stack
-- Executing [s@macro-user-callerid:2] GotoIf("SIP/606-b7707900", "0?report") in new stack
-- Executing [s@macro-user-callerid:3] ExecIf("SIP/606-b7707900", "1|Set|REALCALLERIDNUM=606") in new stack
-- Executing [s@macro-user-callerid:4] Set("SIP/606-b7707900", "AMPUSER=606") in new stack
-- Executing [s@macro-user-callerid:5] Set("SIP/606-b7707900", "AMPUSERCIDNAME=gkeu3") in new stack
-- Executing [s@macro-user-callerid:6] GotoIf("SIP/606-b7707900", "0?report") in new stack
-- Executing [s@macro-user-callerid:7] Set("SIP/606-b7707900", "AMPUSERCID=606") in new stack
-- Executing [s@macro-user-callerid:8] Set("SIP/606-b7707900", "CALLERID(all)="gkeu3" <606>") in new stack
-- Executing [s@macro-user-callerid:9] ExecIf("SIP/606-b7707900", "0|Set|CHANNEL(language)=") in new stack
-- Executing [s@macro-user-callerid:10] GotoIf("SIP/606-b7707900", "0?continue") in new stack
-- Executing [s@macro-user-callerid:11] Set("SIP/606-b7707900", "__TTL=64") in new stack
-- Executing [s@macro-user-callerid:12] GotoIf("SIP/606-b7707900", "1?continue") in new stack
-- Goto (macro-user-callerid,s,19)
-- Executing [s@macro-user-callerid:19] NoOp("SIP/606-b7707900", "Using CallerID "gkeu3" <606>") in new stack
-- Executing [s@macro-exten-vm:2] Set("SIP/606-b7707900", "RingGroupMethod=none") in new stack
-- Executing [s@macro-exten-vm:3] Set("SIP/606-b7707900", "VMBOX=novm") in new stack
-- Executing [s@macro-exten-vm:4] Set("SIP/606-b7707900", "EXTTOCALL=605") in new stack
-- Executing [s@macro-exten-vm:5] Set("SIP/606-b7707900", "CFUEXT=") in new stack
-- Executing [s@macro-exten-vm:6] Set("SIP/606-b7707900", "CFBEXT=") in new stack
-- Executing [s@macro-exten-vm:7] Set("SIP/606-b7707900", "RT=""") in new stack
-- Executing [s@macro-exten-vm:8] Macro("SIP/606-b7707900", "record-enable|605|IN") in new stack
-- Executing [s@macro-record-enable:1] GotoIf("SIP/606-b7707900", "1?check") in new stack
-- Goto (macro-record-enable,s,4)
-- Executing [s@macro-record-enable:4] AGI("SIP/606-b7707900", "recordingcheck|20100408-082926|asterisk-1270708166.262") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
Hier nog 167 regels met "AGI Tx >>" dingen.
== Manager 'admin' logged off from 127.0.0.1
-- AGI Script dialparties.agi completed, returning 0
-- Executing [s@macro-dial:7] Dial("SIP/606-b7707900", "SIP/605||tr") in new stack
-- Called 605
-- SIP/605-08614d30 is ringing
-- SIP/605-08614d30 answered SIP/606-b7707900 |
Dit gebeurt er allemaal als ik mijn "extensions_custom.conf" aanpassing weghaal. Dat is dus de standaard bel procedure van Trixbox.
Maar als ik dan mijn wijzigingen weer aanzet en ga bellen, dan zie ik dit:
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
| -- Executing [605@from-internal:1] AGI("SIP/606-b7707900", "test.php") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/test.php
AGI Tx >> agi_request: test.php
AGI Tx >> agi_channel: SIP/606-b7707900
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: asterisk-1270708820.264
AGI Tx >> agi_callerid: 606
AGI Tx >> agi_calleridname: device
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 605
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: from-internal
AGI Tx >> agi_extension: 605
AGI Tx >> agi_priority: 1
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >> CLI>
AGI Rx << ANSWER
AGI Tx >> 200 result=0
AGI Rx << Resource id #5
AGI Tx >> 510 Invalid or unknown command
-- AGI Script test.php completed, returning 0
-- Executing [605@from-internal:2] Dial("SIP/606-b7707900", "SIP/605") in new stack
-- SIP/605-b75078d0 is ringing
-- SIP/605-b75078d0 answered SIP/606-b7707900 |
Hier wordt mijn script dus aangeroepen en daarna de Dial functie, maar de originele bel procedure roept blijkbaar ook een hoop dingen aan, deze stelt een hoop variabelen in en roept ook een script aan met AGI. Dit wordt allemaal niet gedaan als ik mijn wijzigingen toevoeg.
Ik heb de "510 Invalid or unknown command" fout gezien, maar dat is niet de reden dat het bellen anders gaat, als ik de regel
code:
1
| exten => _XXX,1,AGI(test.php) |
weghaal en er dus alleen dit overblijft:
code:
1
2
| [from-internal-custom]
exten => _XXX,n,Dial(SIP/${CALLERID(dnid), 0, tTrf) |
Dan doet ie nog steeds een heleboel niet, die origineel wel gedaan worden.
//Edit: de "AGI Tx >> 510 Invalid or unknown command" fout kwam omdat ik nog een echo in mijn php script had staan, welke Asterisk dus niet snapte. Deze heb ik weggehaald en nu is deze fout in ieder geval weg...
[
Voor 3% gewijzigd door
Walance op 08-04-2010 10:09
. Reden: kleine toevoeging ]