Pues no, ya intente colocando endbeforehexten=no
En mi scrip mando esto como salida:
Action: Originate
Channel: Zap/g1/numero_telefonio
WaitTime: 30
Callerid: Datos_cta <telefono>
Context: incoming
Exten: 1501
Priority: 1
En cuanto ejecuto el scrip al dar un show channels manda esto:
VoIP*CLI> show channels
Channel Location State Application(Data)
Zap/1-1 s@incoming:1 Ringing (None)
1 active channel
0 active calls
y cuando la llamada no se contesta o da error al marcado, solo se ve esto en la consola:
-- Hungup 'Zap/1-1'
y en esto es lo que aparece en el cdr :
'2008-10-24 09:35:00', '"017012" <52789369>', '52789369', '1501', 'incoming', 'Zap/1-1', '', 'Dial', 'Zap/g1/52789369', 0, 0, 'FAILED', 3, '', '1224858869.80', ''
y esto es lo que me da al estar monitoreando los eventos de asteris
Event: Newchannel
Privilege: call,all
Channel: Zap/1-1
State: Rsrvd
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1224859496.81
Event: Newcallerid
Privilege: call,all
Channel: Zap/1-1
CallerID: 52789369
CallerIDName: 017012
Uniqueid: 1224859496.81
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Newcallerid
Privilege: call,all
Channel: Zap/1-1
CallerID: 52789369
CallerIDName: 017012
Uniqueid: 1224859496.81
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Newstate
Privilege: call,all
Channel: Zap/1-1
State: Dialing
CallerID: 52789369
CallerIDName: 017012
Uniqueid: 1224859496.81
Event: Newstate
Privilege: call,all
Channel: Zap/1-1
State: Ringing
CallerID: 52789369
CallerIDName: 017012
Uniqueid: 1224859496.81
Event: Hangup
Privilege: call,all
Channel: Zap/1-1
Uniqueid: 1224859496.81
Cause: 0
Cause-txt: Unknown
En Sip esta es lo que aparece en la consola cuando marco:
VoIP*CLI> show channels
Channel Location State Application(Data)
Zap/1-1 s@incoming:1 Ringing AppDial((Outgoing Line))
SIP/20000-b7700678 952789369@internal:2 Ring Dial(Zap/g1/52789369|30)
Esto cuando termina el tiempo de espera para que contesten:
-- Nobody picked up in 30000 ms
-- Hungup 'Zap/1-1'
-- Executing Goto("SIP/20000-b7700678", "s-NOANSWER|1") in new stack
-- Goto (internal,s-NOANSWER,1)
-- Executing Playback("SIP/20000-b7700678", "/root/graba/2") in new stack
-- Playing '/root/graba/2' (language 'sp')
-- Executing Hangup("SIP/20000-b7700678", "") in new stack
== Spawn extension (internal, s-NOANSWER, 2) exited non-zero on 'SIP/20000-b7700678'
-- Executing AGI("SIP/20000-b7700678", "dicta.php||16") in new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/dicta.php
-- AGI Script dicta.php completed, returning 0
-- Executing Playback("SIP/20000-b7700678", "/root/graba/0") in new stack
-- Playing '/root/graba/0' (language 'sp')
-- Executing Hangup("SIP/20000-b7700678", "") in new stack
== Spawn extension (internal, h, 3) exited non-zero on 'SIP/20000-b7700678'
== End MixMonitor Recording SIP/20000-b7700678
Esto lo que aparece en el CDR:
'2008-10-24 09:49:33', '"HECTOR 20000" <20000>', '20000', 's-NOANSWER', 'internal', 'SIP/20000-b7700678', 'Zap/1-1', 'Hangup', '', 32, 1, 'ANSWERED', 3, '20000', '1224859773.82', ''
**** A qui puede aver un pequeño conflicto en el disposition ya que esta llamada entra a un conmutador el cual le contesta pero la extensión destino no lo hace, por lo que es corrector que se valla al NOANSWER.
Y por ultimo esto es lo que aparece monitoreando los eventos:
Event: Newchannel
Privilege: call,all
Channel: SIP/20000-b7700678
State: Ring
CallerID: 20000
CallerIDName: HECTOR 20000
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: 952789369
Priority: 1
Application: MixMonitor
AppData: /var/spool/asterisk/monitor/1224859773.82.wav
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: 952789369
Priority: 2
Application: Dial
AppData: Zap/g1/52789369|30
Uniqueid: 1224859773.82
Event: Newchannel
Privilege: call,all
Channel: Zap/1-1
State: Rsrvd
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1224859773.83
Event: Newstate
Privilege: call,all
Channel: Zap/1-1
State: Dialing
CallerID: 20000
CallerIDName: HECTOR 20000
Uniqueid: 1224859773.83
Event: Dial
Privilege: call,all
Source: SIP/20000-b7700678
Destination: Zap/1-1
CallerID: 20000
CallerIDName: HECTOR 20000
SrcUniqueID: 1224859773.82
DestUniqueID: 1224859773.83
Event: Newcallerid
Privilege: call,all
Channel: Zap/1-1
CallerID: 952789369
CallerIDName: <Unknown>
Uniqueid: 1224859773.83
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Newstate
Privilege: call,all
Channel: Zap/1-1
State: Ringing
CallerID: 952789369
CallerIDName: <unknown>
Uniqueid: 1224859773.83
Event: Hangup
Privilege: call,all
Channel: Zap/1-1
Uniqueid: 1224859773.83
Cause: 0
Cause-txt: Unknown
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: 952789369
Priority: 3
Application: Goto
AppData: s-NOANSWER|1
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: s-NOANSWER
Priority: 1
Application: Playback
AppData: /root/graba/2
Uniqueid: 1224859773.82
Event: Newstate
Privilege: call,all
Channel: SIP/20000-b7700678
State: Up
CallerID: 20000
CallerIDName: HECTOR 20000
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: s-NOANSWER
Priority: 2
Application: Hangup
AppData:
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: h
Priority: 1
Application: AGI
AppData: dicta.php||16
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: h
Priority: 2
Application: Playback
AppData: /root/graba/0
Uniqueid: 1224859773.82
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: h
Priority: 3
Application: Hangup
AppData:
Uniqueid: 1224859773.82
Event: Hangup
Privilege: call,all
Channel: SIP/20000-b7700678
Uniqueid: 1224859773.82
Cause: 16
Cause-txt: Normal Clearing
En este ejemplo si manda la causa pero esto por que en el plan de marcado yo indico en que momento colgar a la llamada.
Pero si yo cuelgo la llamada pasa esto:
Event: Newchannel
Privilege: call,all
Channel: SIP/20000-b7700678
State: Ring
CallerID: 20000
CallerIDName: HECTOR 20000
Uniqueid: 1224860429.90
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: 952789369
Priority: 1
Application: MixMonitor
AppData: /var/spool/asterisk/monitor/1224860429.90.wav
Uniqueid: 1224860429.90
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: 952789369
Priority: 2
Application: Dial
AppData: Zap/g1/52789369|30
Uniqueid: 1224860429.90
Event: Newchannel
Privilege: call,all
Channel: Zap/1-1
State: Rsrvd
CallerID: <unknown>
CallerIDName: <unknown>
Uniqueid: 1224860429.91
Event: Newstate
Privilege: call,all
Channel: Zap/1-1
State: Dialing
CallerID: 20000
CallerIDName: HECTOR 20000
Uniqueid: 1224860429.91
Event: Dial
Privilege: call,all
Source: SIP/20000-b7700678
Destination: Zap/1-1
CallerID: 20000
CallerIDName: HECTOR 20000
SrcUniqueID: 1224860429.90
DestUniqueID: 1224860429.91
Event: Newcallerid
Privilege: call,all
Channel: Zap/1-1
CallerID: 952789369
CallerIDName: <Unknown>
Uniqueid: 1224860429.91
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Newstate
Privilege: call,all
Channel: Zap/1-1
State: Ringing
CallerID: 952789369
CallerIDName: <unknown>
Uniqueid: 1224860429.91
Event: Hangup
Privilege: call,all
Channel: Zap/1-1
Uniqueid: 1224860429.91
Cause: 0
Cause-txt: Unknown
Event: Newexten
Privilege: call,all
Channel: SIP/20000-b7700678
Context: internal
Extension: h
Priority: 1
Application: AGI
AppData: dicta.php||0
Uniqueid: 1224860429.90
Event: Hangup
Privilege: call,all
Channel: SIP/20000-b7700678
Uniqueid: 1224860429.90
Cause: 0
Cause-txt: Unknown
hay forma de obtener los hangupcause de este tipo de marcaciones? Estoy trabajando con E1 ISDN y una tajeta SANGOMA de 4 puertos.