pode mostrar sua configuração do dahdi ?

Em 16/05/12 13:35, Listas - Anderson Morhy escreveu:
Complementando

Se observarem, olhando a Chamada entrando e verificando as variaveis Globais, não é mostrado o CallerID também

voip*CLI> core show channel DAHDI/i1/-254b
 -- General --
           Name: DAHDI/i1/-254b
           Type: DAHDI
       UniqueID: 1337185718.91905
       LinkedID: 1337185718.91905
      Caller ID: (N/A)
 Caller ID Name: (N/A)
Connected Line ID: (N/A)
Connected Line ID Name: (N/A)
    DNID Digits: 4641
       Language: en
          State: Up (6)
          Rings: 1
  NativeFormats: 0x8 (alaw)
    WriteFormat: 0x2 (gsm)
     ReadFormat: 0x8 (alaw)
 WriteTranscode: Yes gsm->slin->alaw
  ReadTranscode: No
1st File Descriptor: 11
      Frames in: 436
     Frames out: 431
 Time to Hangup: 0
   Elapsed Time: 0h0m9s
  Direct Bridge: <none>
Indirect Bridge: <none>
 --   PBX   --
        Context: ext-queues
      Extension: 5002
       Priority: 9
     Call Group: 0
   Pickup Group: 0
    Application: Playback
           Data: custom/clarotv
    Blocking in: ast_waitfor_nandfds
      Variables:
MONITOR_FILENAME=/var/spool/asterisk/monitor/q5002-20120516-132838-1337185718.91905
NODEST=5002
DIAL_OPTIONS=trM(auto-blkvm)
BLKVM_BASE=5002
BLKVM_OVERRIDE=BLKVM/5002/DAHDI/i1/-254b
MACRO_DEPTH=0
TTL=64
AMPUSERCIDNAME=
AMPUSER=
REALCALLERIDNUM=
CALLINGPRES_SV=allowed_not_screened
GOSUB_RETVAL=
CALLED_BLACKLIST=1
MYSQL_STATUS=0
connid=1
FROM_DID=4641
CALLEDTON=33
PRIREDIRECTREASON=UNKNOWN
ANI2=0
TRANSFERCAPABILITY=SPEECH

  CDR Variables:
level 1: dnid=4641
level 1: dst=4641
level 1: dcontext=from-pstn
level 1: channel=DAHDI/i1/-254b
level 1: lastapp=Playback
level 1: lastdata=custom/audionovo
level 1: start=2012-05-16 13:28:38
level 1: answer=2012-05-16 13:28:38
level 1: duration=8
level 1: billsec=8
level 1: disposition=ANSWERED
level 1: amaflags=DOCUMENTATION
level 1: uniqueid=1337185718.91905
level 1: linkedid=1337185718.91905
level 1: sequence=125384


Em 16-05-2012 13:09, Listas - Anderson Morhy escreveu:
Irei procurar ser detalhado, e irei colocar alguns comentários iniciando com ==> #
Estou usando Elastix 2.2

Bom, o que estou fazendo e o seguinte

# # Neste momento eu "pego" a informação de quem está ligando e qual DDR e insiro em um DB

exten => 4641,1,Set(__FROM_DID=${EXTEN})
exten => 4641,n,MYSQL(Connect connid host userdb senhadb banco)
exten => 4641,n,MYSQL(Query resultid ${connid} INSERT INTO teste SET origem = ${CALLERID(num)}, data = NOW(), tronco = ${EXTEN})
exten => 4641,n,MYSQL(Fetch fetchid ${resultid} AGIScript)
exten => 4641,n,MYSQL(Clear ${resultid})
exten => 4641,n,MYSQL(Disconnect ${connid})
exten => 4641,n,Gosub(app-blacklist-check,s,1)
exten => 4641,n,ExecIf($[ "${CALLERID(name)}" = "" ] ?Set(CALLERID(name)=${CALLERID(num)}))
exten => 4641,n,Set(__CALLINGPRES_SV=${CALLERPRES()})
exten => 4641,n,Set(CALLERPRES()=allowed_not_screened)
exten => 4641,n(dest-ext),Goto(ext-queues,5002,1)


##
## Aqui na primeira linha, observamos que o sistema Recebe o número originário ( 8488729215 ) e o DDR ( 4641

[May 16 13:01:43] VERBOSE[2977] sig_pri.c: -- Accepting call from '8488729215' to '4641' on channel 0/1, span 1

##
## Aqui começa a execução do AGI

[May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:1] Set("DAHDI/i1/-2539", "__FROM_DID=4641") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:2] MYSQL("DAHDI/i1/-2539", "Connect connid host userdb senhadb banco") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:3] MYSQL("DAHDI/i1/-2539", "Query resultid 1 INSERT INTO teste SET origem = "" <>, data = NOW(), tronco = 4641") in new stack

##Este erro aparece por que o campo origem = "" <> na Query SQL está vazio, já testei com outras variaveis e a sintaxe está correta.
##
[May 16 13:01:43] WARNING[21078] app_mysql.c: aMYSQL_query: mysql_query failed. Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' data = NOW(), tronco = 4641' at line 1

## Continua a Execução

[May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:4] MYSQL("DAHDI/i1/-2539", "Fetch fetchid AGIScript") in new stack [May 16 13:01:43] WARNING[21078] app_mysql.c: aMYSQL_fetch: missing some arguments [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:5] MYSQL("DAHDI/i1/-2539", "Clear ") in new stack [May 16 13:01:43] WARNING[21078] app_mysql.c: Identifier 0, identifier_type 2 not found in identifier list [May 16 13:01:43] WARNING[21078] app_mysql.c: Invalid result identifier 0 passed in aMYSQL_clear [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:6] MYSQL("DAHDI/i1/-2539", "Disconnect 1") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:7] Gosub("DAHDI/i1/-2539", "app-blacklist-check,s,1") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@app-blacklist-check:1] GotoIf("DAHDI/i1/-2539", "0?blacklisted") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@app-blacklist-check:2] Set("DAHDI/i1/-2539", "CALLED_BLACKLIST=1") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@app-blacklist-check:3] Return("DAHDI/i1/-2539", "") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:8] ExecIf("DAHDI/i1/-2539", "1 ?Set(CALLERID(name)=)") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:9] Set("DAHDI/i1/-2539", "__CALLINGPRES_SV=allowed_not_screened") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:10] Set("DAHDI/i1/-2539", "CALLERPRES()=allowed_not_screened") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [4641@from-pstn:11] Goto("DAHDI/i1/-2539", "ext-queues,5002,1") in new stack
[May 16 13:01:43] VERBOSE[21078] pbx.c:     -- Goto (ext-queues,5002,1)
[May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:1] Macro("DAHDI/i1/-2539", "user-callerid,") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:1] Set("DAHDI/i1/-2539", "AMPUSER=") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:2] GotoIf("DAHDI/i1/-2539", "0?report") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:3] ExecIf("DAHDI/i1/-2539", "1?Set(REALCALLERIDNUM=)") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:4] Set("DAHDI/i1/-2539", "AMPUSER=") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:5] Set("DAHDI/i1/-2539", "AMPUSERCIDNAME=") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:6] GotoIf("DAHDI/i1/-2539", "1?report") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Goto (macro-user-callerid,s,10) [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:10] GotoIf("DAHDI/i1/-2539", "0?continue") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:11] Set("DAHDI/i1/-2539", "__TTL=64") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:12] GotoIf("DAHDI/i1/-2539", "1?continue") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Goto (macro-user-callerid,s,19)

##
## Observei que neste ponto NEM AQUI onde não foi mexido o nº é identificado

[May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:19] Set("DAHDI/i1/-2539", "CALLERID(number)=") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:20] Set("DAHDI/i1/-2539", "CALLERID(name)=") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [s@macro-user-callerid:21] NoOp("DAHDI/i1/-2539", "Using CallerID "" <>") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:2] Answer("DAHDI/i1/-2539", "") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:3] Set("DAHDI/i1/-2539", "__BLKVM_OVERRIDE=BLKVM/5002/DAHDI/i1/-2539") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:4] Set("DAHDI/i1/-2539", "__BLKVM_BASE=5002") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:5] Set("DAHDI/i1/-2539", "DB(BLKVM/5002/DAHDI/i1/-2539)=TRUE") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:6] ExecIf("DAHDI/i1/-2539", "1?Set(_DIAL_OPTIONS=trM(auto-blkvm))") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:7] Set("DAHDI/i1/-2539", "__NODEST=5002") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:8] Set("DAHDI/i1/-2539", "MONITOR_FILENAME=/var/spool/asterisk/monitor/q5002-20120516-130143-1337184103.91783") in new stack [May 16 13:01:43] VERBOSE[21078] pbx.c: -- Executing [5002@ext-queues:9] Playback("DAHDI/i1/-2539", "custom/audio-novo") in new stack [May 16 13:01:43] VERBOSE[21078] file.c: -- <DAHDI/i1/-2539> Playing 'custom/audio-novo.gsm' (language 'en')



OBS: Não consegui em momento algum visualizar o nº de entrada em nenhum lugar, e como se a Placa/canal reconhecesse o nº e isso não fosse passado para o Asterisk.


Alguma sugestão? Ou Orientação?

Preciso apenas pegar o nº de entrada o Tronco (DDR) e inserir em um Banco de dados no momento da entrada da ligação. Nada além disso

Obrigado a todos


Att

Anderson Morhy


Em 16-05-2012 12:13, Leandro Alves escreveu:
Pq não manda a parte do seu codigo AGI, pra ficar melhor pra todos?

Nas varáveis globais do seu canal (vc enviou apenas as variáveis CDR), o seu celular é exibido?

Em 16 de maio de 2012 12:05, Mike Tesliuk <m...@tesliuk.com <mailto:m...@tesliuk.com>> escreveu:

    De acordo com o log abaixo é callerid(num) e exten

     [May 15 20:34:05] VERBOSE[2977] sig_pri.c:     -- Accepting
    call from
    '8494322145 <tel:8494322145>' to '4641' on channel 0/1, span 1

    dentro do agi (no meu caso em perl), eu faria da seguinte forma


     $callerid =  $agi->get_variable("CALLERID(num)");
     $dnid = $agi->get_variable("EXTEN");

    em todo caso, voce pode por no seu extension o seguinte

     exten => 4641,1,NoOp(CALLERID: ${CALLERID(num)})

    e voce deverá ver com a legenda na frente

    se eu estiver falando algo que voce ja saiba peço deculpas mas como
    re-assinei a lista agora não peguei o contexto todo.



    _______________________________________________
    KHOMP Inovação: External Board Series
    Módulos de 1/2 rack e 1U para todas as interfaces e soluções
    Asterisk e FreeSWITCH.
    Tenha a External Series Experience na sua aplicação. Visite
    www.khomp.com <http://www.khomp.com>
    _______________________________________________
    DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
    20 anos de experiência com E1(R2/ISDN), FXS, FXO e GSM
    Centro Treinamento - Curso de PABX IP -  Asterisk  - Site
    www.digivoice.com.br <http://www.digivoice.com.br>
    ________
    YEALINK: Telefones IP e VídeoPhones IP com o melhor
    custo/benefício do mercado.
    email: yeal...@commlogik.com.br
    <mailto:yeal...@commlogik.com.br> | www.commlogik.com.br
    <http://www.commlogik.com.br> | (11) 5503-1011
    <tel:%2811%29%205503-1011>
    ______________________________________________
    Para remover seu email desta lista, basta enviar um email em
    branco para asteriskbrasil-unsubscr...@listas.asteriskbrasil.org
    <mailto:asteriskbrasil-unsubscr...@listas.asteriskbrasil.org>




--
Att.,

Leandro Alves



_______________________________________________
KHOMP Inovação: External Board Series
Módulos de 1/2 rack e 1U para todas as interfaces e soluções Asterisk e 
FreeSWITCH.
Tenha a External Series Experience na sua aplicação. Visitewww.khomp.com
_______________________________________________
DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
20 anos de experiência com E1(R2/ISDN), FXS, FXO e GSM
Centro Treinamento - Curso de PABX IP -  Asterisk  - Sitewww.digivoice.com.br
________
YEALINK: Telefones IP e VídeoPhones IP com o melhor custo/benefício do mercado.
email:yeal...@commlogik.com.br  |www.commlogik.com.br  | (11) 5503-1011
______________________________________________
Para remover seu email desta lista, basta enviar um email em branco 
paraasteriskbrasil-unsubscr...@listas.asteriskbrasil.org


_______________________________________________
KHOMP Inovação: External Board Series
Módulos de 1/2 rack e 1U para todas as interfaces e soluções Asterisk e 
FreeSWITCH.
Tenha a External Series Experience na sua aplicação. Visitewww.khomp.com
_______________________________________________
DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
20 anos de experiência com E1(R2/ISDN), FXS, FXO e GSM
Centro Treinamento - Curso de PABX IP -  Asterisk  - Sitewww.digivoice.com.br
________
YEALINK: Telefones IP e VídeoPhones IP com o melhor custo/benefício do mercado.
email:yeal...@commlogik.com.br  |www.commlogik.com.br  | (11) 5503-1011
______________________________________________
Para remover seu email desta lista, basta enviar um email em branco 
paraasteriskbrasil-unsubscr...@listas.asteriskbrasil.org


_______________________________________________
KHOMP Inovação: External Board Series
Módulos de 1/2 rack e 1U para todas as interfaces e soluções Asterisk e 
FreeSWITCH.
Tenha a External Series Experience na sua aplicação. Visite www.khomp.com
_______________________________________________
DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
20 anos de experiência com E1(R2/ISDN), FXS, FXO e GSM
Centro Treinamento - Curso de PABX IP -  Asterisk  - Site  www.digivoice.com.br
________
YEALINK: Telefones IP e VídeoPhones IP com o melhor custo/benefício do mercado.
email: yeal...@commlogik.com.br | www.commlogik.com.br | (11) 5503-1011
______________________________________________
Para remover seu email desta lista, basta enviar um email em branco para 
asteriskbrasil-unsubscr...@listas.asteriskbrasil.org

_______________________________________________
KHOMP Inovação: External Board Series
Módulos de 1/2 rack e 1U para todas as interfaces e soluções Asterisk e 
FreeSWITCH.
Tenha a External Series Experience na sua aplicação. Visite www.khomp.com
_______________________________________________
DIGIVOICE  Fabricante de Placas de Voz e Channel Bank
20 anos de experiência com E1(R2/ISDN), FXS, FXO e GSM
Centro Treinamento - Curso de PABX IP -  Asterisk  - Site  www.digivoice.com.br
________
YEALINK: Telefones IP e VídeoPhones IP com o melhor custo/benefício do mercado.
email: yeal...@commlogik.com.br | www.commlogik.com.br | (11) 5503-1011
______________________________________________
Para remover seu email desta lista, basta enviar um email em branco para 
asteriskbrasil-unsubscr...@listas.asteriskbrasil.org

Responder a