[Asterisk-Users] Limit call length, whisper time remaining?

John Todd jtodd at loligo.com
Sat May 17 00:05:02 MST 2003


>  > without setting a timelimit on the current channel.
>>  If I use the "AbsoluteTimeout" app, the current channel will
>>  be hang up and therefore any channel spawned by "Dial".
>>  That means that you can't force a timelimit on a spawned
>>  channel without closing the current channel as well.
>
>Actually you should be able to use:
>
>exten => 1234,1,AbsoluteTimeout(120)
>exten => 1234,2,Dial(Zap/somenumber|20)
>exten => 1234,3,Playback(sorrynobodyanswered)
>exten => 1234,4,Hangup
>
>exten => T,1,Playback(sorrytimeisup)
>exten => T,2,Hangup
>
>Note the capital 'T'
>
>Mark

I was unable to make this work with SIP channels.  I pared the config 
file down to complete minimums (sending the call from the UA directly 
into the context that you describe, more or less) but the actions 
under the "T" extension are never executed to my knowledge.


My calls from the UA (x2203) are being fed directly into context 
2208, which dials (successfully) SIP phone 2208.  I answer, and the 
call hangs up after 5 seconds.  Nothing happens, then, and both calls 
hang up "normally" (2208 is an ATA-186, and 2203 is a Cisco 7960. 
Both are behind NAT.)

[2208]
exten => 2208,1,AbsoluteTimeout(5)
exten => 2208,2,Dial(SIP/2208)
exten => 2208,3,Hangup

exten => T,1,mp3player(/var/lib/asterisk/mohmp3/dont-touch-me.mp3)
exten => T,2,Hangup


*CLI> DEBUG[7176]: File chan_sip.c, Line 607 (create_addr): Setting 
NAT on RTP to -1
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '12251e140aed27fd65a20e5b79e9168d at 202.22.13.10' of 
Request 102: Found
DEBUG[7176]: File chan_sip.c, Line 3354 (check_user): Setting NAT on RTP to -1
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '0002b9eb-0ef448ae-707f0dbc-4c5a3454 at 10.0.1.15' of 
Response 101: Found
DEBUG[7176]: File chan_sip.c, Line 3354 (check_user): Setting NAT on RTP to -1
DEBUG[7176]: File chan_sip.c, Line 2894 (build_route): build_route: 
Contact hop: <sip:2203 at 10.0.1.15:5060>
     -- Executing AbsoluteTimeout("SIP/2203-d016", "5") in new stack
     -- Set Absolute Timeout to 5
     -- Executing Dial("SIP/2203-d016", "SIP/2208") in new stack
DEBUG[38929]: File chan_sip.c, Line 607 (create_addr): Setting NAT on RTP to -1
     -- Called 2208
DEBUG[7176]: File chan_sip.c, Line 502 (__sip_ack): Acked pending invite 102
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '7756a75e3a31757b0fdc489434d9d2e2 at 202.22.13.10' of 
Request 102: Found
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '7756a75e3a31757b0fdc489434d9d2e2 at 202.22.13.10' of 
Request 102: Not Found
     -- SIP/2208-37b2 is ringing
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '7756a75e3a31757b0fdc489434d9d2e2 at 202.22.13.10' of 
Request 102: Not Found
DEBUG[7176]: File chan_sip.c, Line 2894 (build_route): build_route: 
Contact hop: <sip:2208 at 10.0.1.39:5060;user=phone;transport=udp>
     -- SIP/2208-37b2 answered SIP/2203-d016
     -- Attempting native bridge of SIP/2203-d016 and SIP/2208-37b2
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '0002b9eb-0ef448ae-707f0dbc-4c5a3454 at 10.0.1.15' of 
Response 102: Found
DEBUG[32786]: File rtp.c, Line 302 (ast_rtp_read): RTP NAT: Using 
address 202.22.13.8:28794
DEBUG[32786]: File rtp.c, Line 302 (ast_rtp_read): RTP NAT: Using 
address 202.22.13.8:28795
DEBUG[38929]: File rtp.c, Line 838 (ast_rtp_write): Ooh, format 
changed from 0 to 4
DEBUG[38929]: File rtp.c, Line 838 (ast_rtp_write): Ooh, format 
changed from 0 to 4

[at this point I've answered the call, and I can hear both legs of 
the call just fine]

DEBUG[38929]: File channel.c, Line 2075 (ast_channel_bridge): Didn't 
get a frame from channel: SIP/2203-d016
DEBUG[38929]: File channel.c, Line 2143 (ast_channel_bridge): Bridge 
stops bridging channels SIP/2203-d016 and SIP/2208-37b2
   == Spawn extension (2208, 2208, 2) exited non-zero on 'SIP/2203-d016'
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '7756a75e3a31757b0fdc489434d9d2e2 at 202.22.13.10' of 
Request 103: Found
WARNING[38929]: File pbx.c, Line 1777 (ast_pbx_run): Timeout, but no 
rule 't' in context '2208'
DEBUG[7176]: File chan_sip.c, Line 520 (__sip_ack): Stopping 
retransmission on '0002b9eb-0ef448ae-707f0dbc-4c5a3454 at 10.0.1.15' of 
Request 102: Found

*CLI>

JT



More information about the asterisk-users mailing list