VIDEOCHAT  ::   FAQ  ::   Поиск  ::   Регистрация  ::   Вход

Номер не существует или набран не правильно

Проблемы Asterisk без вэб-оболочек и их решения

Модераторы: april22, Zavr2008

Bibmaster
Сообщения: 10
Зарегистрирован: 22 янв 2011, 16:29

Номер не существует или набран не правильно

Сообщение Bibmaster »

Приветствую всех присутствующих!! Существует диалплан, в котором описаны те или иные направления, вот задался вопросом, как сделать так, чтобы при наборе номера, не описанного в диалплане, asterisk говорил бы что-то типа "указанный вами номер не существует или набран не правильно. Попробуйте еще раз.", а затем совершал hangup(). Номеров достаточно много и в ручную выискивать не описанные направления, лепя на ник Playback как-то не вариант. Может кто знает?
ded
Сообщения: 15628
Зарегистрирован: 26 авг 2010, 19:00

Re: Номер не существует или набран не правильно

Сообщение ded »

exten => i,1,NoOp(Invalid)
exten => i,n,Playback(указанный вами номер не существует или набран не правильно. Попробуйте еще раз)
exten => i,n,Hangup()
Bibmaster
Сообщения: 10
Зарегистрирован: 22 янв 2011, 16:29

Re: Номер не существует или набран не правильно

Сообщение Bibmaster »

К сожалению такая штука не работает..не знаю почему(( В консоли выдает только это Call from '10' to extension '1111' rejected because extension not found in context 'office'. Хотя вот это
[no_number]
exten => i,1,NoOp(Invalid)
exten => i,n,Playback(pbx-invalid)
exten => i,n,Hangup()

добавлено в
[office]
include => no_number
ded
Сообщения: 15628
Зарегистрирован: 26 авг 2010, 19:00

Re: Номер не существует или набран не правильно

Сообщение ded »

Изучите опции команды Dial

Код: Выделить всё

                                                                                                                                                                  
  Options:                                                                                                                                                         
    A(x) - Play an announcement to the called party, using 'x' as the file.                                                                                        
    C    - Reset the CDR for this call.                                                                                                                            
    c    - If DIAL cancels this call, always set the flag to tell the channel                                                                                      
           driver that the call is answered elsewhere.                                                                                                             
    d    - Allow the calling user to dial a 1 digit extension while waiting for                                                                                    
           a call to be answered. Exit to that extension if it exists in the                                                                                       
           current context, or the context defined in the EXITCONTEXT variable,                                                                                    
           if it exists.                                                                                                                                           
    D([called][:calling]) - Send the specified DTMF strings *after* the called                                                                                     
           party has answered, but before the call gets bridged. The 'called'                                                                                      
           DTMF string is sent to the called party, and the 'calling' DTMF                                                                                         
           string is sent to the calling party. Both parameters can be used                                                                                        
           alone.                                                                                                                                                  
    e    - execute the 'h' extension for peer after the call ends                                                                                                  
    f    - Force the callerid of the *calling* channel to be set as the                                                                                            
           extension associated with the channel using a dialplan 'hint'.                                                                                          
           For example, some PSTNs do not allow CallerID to be set to anything                                                                                     
           other than the number assigned to the caller.                                                                                                           
    g    - Proceed with dialplan execution at the current extension if the                                                                                         
           destination channel hangs up.                                                                                                                           
    G(context^exten^pri) - If the call is answered, transfer the calling party to                                                                                  
           the specified priority and the called party to the specified priority+1.                                                                                
           Optionally, an extension, or extension and context may be specified.                                                                                    
           Otherwise, the current extension is used. You cannot use any additional                                                                                 
           action post answer options in conjunction with this option.                                                                                             
    h    - Allow the called party to hang up by sending the '*' DTMF digit, or                                                                                     
           whatever sequence was defined in the featuremap section for                                                                                             
           'disconnect' in features.conf                                                                                                                           
    H    - Allow the calling party to hang up by hitting the '*' DTMF digit, or                                                                                    
           whatever sequence was defined in the featuremap section for                                                                                             
           'disconnect' in features.conf                                                                                                                           
    i    - Asterisk will ignore any forwarding requests it may receive on this                                                                                     
           dial attempt.                                                                                                                                           
    k    - Allow the called party to enable parking of the call by sending                                                                                         
           the DTMF sequence defined for call parking in the featuremap section of features.conf.                                                                  
    K    - Allow the calling party to enable parking of the call by sending                                                                                        
           the DTMF sequence defined for call parking in the featuremap section of features.conf.                                                                  
    L(x[:y][:z]) - Limit the call to 'x' ms. Play a warning when 'y' ms are                                                                                        
           left. Repeat the warning every 'z' ms. The following special                                                                                            
           variables can be used with this option:                                                                                                                 
           * LIMIT_PLAYAUDIO_CALLER   yes|no (default yes)                                                                                                         
                                      Play sounds to the caller.                                                                                                   
           * LIMIT_PLAYAUDIO_CALLEE   yes|no                                                                                                                       
                                      Play sounds to the callee.                                                                                                   
           * LIMIT_TIMEOUT_FILE       File to play when time is up.                                                                                                
           * LIMIT_CONNECT_FILE       File to play when call begins.                                                                                               
           * LIMIT_WARNING_FILE       File to play as warning if 'y' is defined.                                                                                   
                                      The default is to say the time remaining.                                                                                    
    m([class]) - Provide hold music to the calling party until a requested                                                                                         
           channel answers. A specific MusicOnHold class can be                                                                                                    
           specified.                                                                                                                                              
    M(x[^arg]) - Execute the Macro for the *called* channel before connecting                                                                                      
           to the calling channel. Arguments can be specified to the Macro                                                                                         
           using '^' as a delimeter. The Macro can set the variable                                                                                                
           MACRO_RESULT to specify the following actions after the Macro is                                                                                        
           finished executing.                                                                                                                                     
           * ABORT        Hangup both legs of the call.                                                                                                            
           * CONGESTION   Behave as if line congestion was encountered.                                                                                            
           * BUSY         Behave as if a busy signal was encountered.                                                                                              
           * CONTINUE     Hangup the called party and allow the calling party                                                                                      
                          to continue dialplan execution at the next priority.                                                                                     
           * GOTO:<context>^<exten>^<priority> - Transfer the call to the                                                                                          
                          specified priority. Optionally, an extension, or                                                                                         
                          extension and priority can be specified.                                                                                                 
           You cannot use any additional action post answer options in conjunction                                                                                 
           with this option. Also, pbx services are not run on the peer (called) channel,                                                                          
           so you will not be able to set timeouts via the TIMEOUT() function in this macro.                                                                       
           Be aware of the limitations that macros have, specifically with regards to use of                                                                       
           the WaitExten application. For more information, see the documentation for Macro()                                                                      
    n([x]) - This option is a modifier for the screen/privacy mode. It specifies                                                                                   
             that no introductions are to be saved in the priv-callerintros                                                                                        
             directory.                                                                                                                                            
             Specified without an arg, or with 0, the introduction is saved after                                                                                  
             an unanswered call originating from the same CallerID. With                                                                                           
             a 1 specified, the introduction is always deleted and rerequested.                                                                                    
    N    - This option is a modifier for the screen/privacy mode. It specifies                                                                                     
           that if callerID is present, do not screen the call.                                                                                                    
    o    - Specify that the CallerID that was present on the *calling* channel                                                                                     
           be set as the CallerID on the *called* channel. This was the                                                                                            
           behavior of Asterisk 1.0 and earlier.                                                                                                                   
    O([x]) - "Operator Services" mode (DAHDI channel to DAHDI channel                                                                                              
             only, if specified on non-DAHDI interface, it will be ignored).                                                                                       
             When the destination answers (presumably an operator services                                                                                         
             station), the originator no longer has control of their line.                                                                                         
             They may hang up, but the switch will not release their line                                                                                          
             until the destination party hangs up (the operator). Specified                                                                                        
             without an arg, or with 1 as an arg, the originator hanging up                                                                                        
             will cause the phone to ring back immediately. With a 2 specified,                                                                                    
             when the "operator" flashes the trunk, it will ring their phone                                                                                       
             back.                                                                                                                                                 
    p    - This option enables screening mode. This is basically Privacy mode                                                                                      
           without memory.                                                                                                                                         
    P([x]) - Enable privacy mode. Use 'x' as the family/key in the database if                                                                                     
           it is provided. The current extension is used if a database                                                                                             
           family/key is not specified.                                                                                                                            
    r    - Indicate ringing to the calling party. Pass no audio to the calling                                                                                     
           party until the called channel has answered.                                                                                                            
    S(x) - Hang up the call after 'x' seconds *after* the called party has                                                                                         
           answered the call.                                                                                                                                      
    t    - Allow the called party to transfer the calling party by sending the                                                                                     
           DTMF sequence defined in the blindxfer setting in the featuremap section                                                                                
           of features.conf.                                                                                                                                       
    T    - Allow the calling party to transfer the called party by sending the                                                                                     
           DTMF sequence defined in the blindxfer setting in the featuremap section                                                                                
           of features.conf.                                                                                                                                       
    U(x[^arg]) - Execute via Gosub the routine 'x' for the *called* channel before connecting                                                                      
           to the calling channel. Arguments can be specified to the Gosub                                                                                         
           using '^' as a delimeter. The Gosub routine can set the variable                                                                                        
           GOSUB_RESULT to specify the following actions after the Gosub returns.                                                                                  
           * ABORT        Hangup both legs of the call.                                                                                                            
           * CONGESTION   Behave as if line congestion was encountered.                                                                                            
           * BUSY         Behave as if a busy signal was encountered.                                                                                              
           * CONTINUE     Hangup the called party and allow the calling party                                                                                      
                          to continue dialplan execution at the next priority.                                                                                     
           * GOTO:<context>^<exten>^<priority> - Transfer the call to the                                                                                          
                          specified priority. Optionally, an extension, or                                                                                         
                          extension and priority can be specified.                                                                                                 
           You cannot use any additional action post answer options in conjunction                                                                                 
           with this option. Also, pbx services are not run on the peer (called) channel,                                                                          
           so you will not be able to set timeouts via the TIMEOUT() function in this routine.                                                                     
    w    - Allow the called party to enable recording of the call by sending                                                                                       
           the DTMF sequence defined in the automon setting in the featuremap section                                                                              
           of features.conf.                                                                                                                                       
    W    - Allow the calling party to enable recording of the call by sending                                                                                      
           the DTMF sequence defined in the automon setting in the featuremap section                                                                              
           of features.conf.                                                                                                                                       
    x    - Allow the called party to enable recording of the call by sending                                                                                       
           the DTMF sequence defined in the automixmon setting in the featuremap section                                                                           
           of features.conf.                                                                                                                                       
    X    - Allow the calling party to enable recording of the call by sending                                                                                      
           the DTMF sequence defined in the automixmon setting in the featuremap section                                                                           
           of features.conf. 
Bibmaster
Сообщения: 10
Зарегистрирован: 22 янв 2011, 16:29

Re: Номер не существует или набран не правильно

Сообщение Bibmaster »

Я что-то вообще запутался((((( это к чему? как оно поможет и куда эти буковки вписывать?????
ded писал(а):Изучите опции команды Dial

Код: Выделить всё

                                                                                                                                                                  
  Options:                                                                                                                                                         
    A(x) - Play an announcement to the called party, using 'x' as the file.                                                                                        
    C    - Reset the CDR for this call.                                                                                                                            
    c    - If DIAL cancels this call, always set the flag to tell the channel                                                                                      
           driver that the call is answered elsewhere.                                                                                                             
    d    - Allow the calling user to dial a 1 digit extension while waiting for                                                                                    
           a call to be answered. Exit to that extension if it exists in the                                                                                       
           current context, or the context defined in the EXITCONTEXT variable,                                                                                    
           if it exists.                                                                                                                                           
    D([called][:calling]) - Send the specified DTMF strings *after* the called                                                                                     
           party has answered, but before the call gets bridged. The 'called'                                                                                      
           DTMF string is sent to the called party, and the 'calling' DTMF                                                                                         
           string is sent to the calling party. Both parameters can be used                                                                                        
           alone.                                                                                                                                                  
    e    - execute the 'h' extension for peer after the call ends                                                                                                  
    f    - Force the callerid of the *calling* channel to be set as the                                                                                            
           extension associated with the channel using a dialplan 'hint'.                                                                                          
           For example, some PSTNs do not allow CallerID to be set to anything                                                                                     
           other than the number assigned to the caller.                                                                                                           
    g    - Proceed with dialplan execution at the current extension if the                                                                                         
           destination channel hangs up.                                                                                                                           
    G(context^exten^pri) - If the call is answered, transfer the calling party to                                                                                  
           the specified priority and the called party to the specified priority+1.                                                                                
           Optionally, an extension, or extension and context may be specified.                                                                                    
           Otherwise, the current extension is used. You cannot use any additional                                                                                 
           action post answer options in conjunction with this option.                                                                                             
    h    - Allow the called party to hang up by sending the '*' DTMF digit, or                                                                                     
           whatever sequence was defined in the featuremap section for                                                                                             
           'disconnect' in features.conf                                                                                                                           
    H    - Allow the calling party to hang up by hitting the '*' DTMF digit, or                                                                                    
           whatever sequence was defined in the featuremap section for                                                                                             
           'disconnect' in features.conf                                                                                                                           
    i    - Asterisk will ignore any forwarding requests it may receive on this                                                                                     
           dial attempt.                                                                                                                                           
    k    - Allow the called party to enable parking of the call by sending                                                                                         
           the DTMF sequence defined for call parking in the featuremap section of features.conf.                                                                  
    K    - Allow the calling party to enable parking of the call by sending                                                                                        
           the DTMF sequence defined for call parking in the featuremap section of features.conf.                                                                  
    L(x[:y][:z]) - Limit the call to 'x' ms. Play a warning when 'y' ms are                                                                                        
           left. Repeat the warning every 'z' ms. The following special                                                                                            
           variables can be used with this option:                                                                                                                 
           * LIMIT_PLAYAUDIO_CALLER   yes|no (default yes)                                                                                                         
                                      Play sounds to the caller.                                                                                                   
           * LIMIT_PLAYAUDIO_CALLEE   yes|no                                                                                                                       
                                      Play sounds to the callee.                                                                                                   
           * LIMIT_TIMEOUT_FILE       File to play when time is up.                                                                                                
           * LIMIT_CONNECT_FILE       File to play when call begins.                                                                                               
           * LIMIT_WARNING_FILE       File to play as warning if 'y' is defined.                                                                                   
                                      The default is to say the time remaining.                                                                                    
    m([class]) - Provide hold music to the calling party until a requested                                                                                         
           channel answers. A specific MusicOnHold class can be                                                                                                    
           specified.                                                                                                                                              
    M(x[^arg]) - Execute the Macro for the *called* channel before connecting                                                                                      
           to the calling channel. Arguments can be specified to the Macro                                                                                         
           using '^' as a delimeter. The Macro can set the variable                                                                                                
           MACRO_RESULT to specify the following actions after the Macro is                                                                                        
           finished executing.                                                                                                                                     
           * ABORT        Hangup both legs of the call.                                                                                                            
           * CONGESTION   Behave as if line congestion was encountered.                                                                                            
           * BUSY         Behave as if a busy signal was encountered.                                                                                              
           * CONTINUE     Hangup the called party and allow the calling party                                                                                      
                          to continue dialplan execution at the next priority.                                                                                     
           * GOTO:<context>^<exten>^<priority> - Transfer the call to the                                                                                          
                          specified priority. Optionally, an extension, or                                                                                         
                          extension and priority can be specified.                                                                                                 
           You cannot use any additional action post answer options in conjunction                                                                                 
           with this option. Also, pbx services are not run on the peer (called) channel,                                                                          
           so you will not be able to set timeouts via the TIMEOUT() function in this macro.                                                                       
           Be aware of the limitations that macros have, specifically with regards to use of                                                                       
           the WaitExten application. For more information, see the documentation for Macro()                                                                      
    n([x]) - This option is a modifier for the screen/privacy mode. It specifies                                                                                   
             that no introductions are to be saved in the priv-callerintros                                                                                        
             directory.                                                                                                                                            
             Specified without an arg, or with 0, the introduction is saved after                                                                                  
             an unanswered call originating from the same CallerID. With                                                                                           
             a 1 specified, the introduction is always deleted and rerequested.                                                                                    
    N    - This option is a modifier for the screen/privacy mode. It specifies                                                                                     
           that if callerID is present, do not screen the call.                                                                                                    
    o    - Specify that the CallerID that was present on the *calling* channel                                                                                     
           be set as the CallerID on the *called* channel. This was the                                                                                            
           behavior of Asterisk 1.0 and earlier.                                                                                                                   
    O([x]) - "Operator Services" mode (DAHDI channel to DAHDI channel                                                                                              
             only, if specified on non-DAHDI interface, it will be ignored).                                                                                       
             When the destination answers (presumably an operator services                                                                                         
             station), the originator no longer has control of their line.                                                                                         
             They may hang up, but the switch will not release their line                                                                                          
             until the destination party hangs up (the operator). Specified                                                                                        
             without an arg, or with 1 as an arg, the originator hanging up                                                                                        
             will cause the phone to ring back immediately. With a 2 specified,                                                                                    
             when the "operator" flashes the trunk, it will ring their phone                                                                                       
             back.                                                                                                                                                 
    p    - This option enables screening mode. This is basically Privacy mode                                                                                      
           without memory.                                                                                                                                         
    P([x]) - Enable privacy mode. Use 'x' as the family/key in the database if                                                                                     
           it is provided. The current extension is used if a database                                                                                             
           family/key is not specified.                                                                                                                            
    r    - Indicate ringing to the calling party. Pass no audio to the calling                                                                                     
           party until the called channel has answered.                                                                                                            
    S(x) - Hang up the call after 'x' seconds *after* the called party has                                                                                         
           answered the call.                                                                                                                                      
    t    - Allow the called party to transfer the calling party by sending the                                                                                     
           DTMF sequence defined in the blindxfer setting in the featuremap section                                                                                
           of features.conf.                                                                                                                                       
    T    - Allow the calling party to transfer the called party by sending the                                                                                     
           DTMF sequence defined in the blindxfer setting in the featuremap section                                                                                
           of features.conf.                                                                                                                                       
    U(x[^arg]) - Execute via Gosub the routine 'x' for the *called* channel before connecting                                                                      
           to the calling channel. Arguments can be specified to the Gosub                                                                                         
           using '^' as a delimeter. The Gosub routine can set the variable                                                                                        
           GOSUB_RESULT to specify the following actions after the Gosub returns.                                                                                  
           * ABORT        Hangup both legs of the call.                                                                                                            
           * CONGESTION   Behave as if line congestion was encountered.                                                                                            
           * BUSY         Behave as if a busy signal was encountered.                                                                                              
           * CONTINUE     Hangup the called party and allow the calling party                                                                                      
                          to continue dialplan execution at the next priority.                                                                                     
           * GOTO:<context>^<exten>^<priority> - Transfer the call to the                                                                                          
                          specified priority. Optionally, an extension, or                                                                                         
                          extension and priority can be specified.                                                                                                 
           You cannot use any additional action post answer options in conjunction                                                                                 
           with this option. Also, pbx services are not run on the peer (called) channel,                                                                          
           so you will not be able to set timeouts via the TIMEOUT() function in this routine.                                                                     
    w    - Allow the called party to enable recording of the call by sending                                                                                       
           the DTMF sequence defined in the automon setting in the featuremap section                                                                              
           of features.conf.                                                                                                                                       
    W    - Allow the calling party to enable recording of the call by sending                                                                                      
           the DTMF sequence defined in the automon setting in the featuremap section                                                                              
           of features.conf.                                                                                                                                       
    x    - Allow the called party to enable recording of the call by sending                                                                                       
           the DTMF sequence defined in the automixmon setting in the featuremap section                                                                           
           of features.conf.                                                                                                                                       
    X    - Allow the calling party to enable recording of the call by sending                                                                                      
           the DTMF sequence defined in the automixmon setting in the featuremap section                                                                           
           of features.conf. 
ded
Сообщения: 15628
Зарегистрирован: 26 авг 2010, 19:00

Re: Номер не существует или набран не правильно

Сообщение ded »

Может Вы вэбмастер? Которому ближе HTML код, но поручили освоить Астериск?
Зачем Вы тыркаете в кнопку цитировать полностью?? Тут не любят
а) тупых
б) не умеющих искать и находить ответы, лежащие под ногами
http://asterisk.ru/knowledgebase/Asterisk+i+extension
Bibmaster
Сообщения: 10
Зарегистрирован: 22 янв 2011, 16:29

Re: Номер не существует или набран не правильно

Сообщение Bibmaster »

для внутренних номеров, у меня вот так стоит..но проблему это не решает...
[local]
exten => _XX,1,NoOp()
exten => _XX,n,Dial(SIP/${EXTEN},45,gtT)
exten => _XX,n,GotoIf($["${DIALSTATUS}" : "ANSWER"]?Hangup)
exten => _XX,n,PlayBack(the-number-u-dialed&is-curntly-unavail)
exten => _XX,n,HangUp()
Bibmaster
Сообщения: 10
Зарегистрирован: 22 янв 2011, 16:29

Re: Номер не существует или набран не правильно

Сообщение Bibmaster »

Я думаю, что я не тупой, это первое. Второе вэбмастер то тут при чем??? Мне кажется просто, что когда нет аргументов, начинается вот такая ххерня, простите. Я задал вопрос и спросил, почему не работает, ибо показанный вами вариант, уважаемый, я рассматривал..А если Вы такой супер умач, то подскажите мне, дураку, как сделать, чтоб заработало, но не надо при этом мнить из себя фиг знает кого..типичная позиция маргинала...
ded
Сообщения: 15628
Зарегистрирован: 26 авг 2010, 19:00

Re: Номер не существует или набран не правильно

Сообщение ded »

[no_number]
exten => _X.,1,Goto(i,1)
exten => i,1,NoOp(Invalid)
exten => i,n,Playback(pbx-invalid)
exten => i,n,Hangup()
exten => t,n,Hangup()
[local]
include => no_number
exten => _XX,1,NoOp() - это тут тоже бессмысленный шаг
exten => _XX,n,Dial(SIP/${EXTEN},45,gtT) - вот тут эти буковки прописываются
: exten => _XX,n,GotoIf($["${DIALSTATUS}" : "ANSWER"]?Hangup) - это не нужно
: exten => _XX,n,PlayBack(the-number-u-dialed&is-curntly-unavail) - это не нужно
; exten => _XX,n,HangUp() - это не нужно

У Вас было два варианта - а) и б)
Вариант б) с негодованием отвергли, пришлось подсказать дураку.
Bibmaster
Сообщения: 10
Зарегистрирован: 22 янв 2011, 16:29

Re: Номер не существует или набран не правильно

Сообщение Bibmaster »

Спасибо большое! Но не стоит так критично относиться, просто я не гуру в этом деле, поэтому таких нюансов знать не могу..делал, как написано в книге..а оно не работало( Кстати то, что закоментировали я использовал просто для оповещения о том, что номер неотвечает.позвоните позже...
Ответить
© 2008 — 2025 Asterisk.ru
Digium, Asterisk and AsteriskNOW are registered trademarks of Digium, Inc.
Design and development by PostMet-Netzwerk GmbH