Oi Luiz. Estabeleci um SIP entre o Call Manager e o Asterisk. O Call Manager possui um Publisher (39.41) e os Subscribers (39.42 e 39.43), onde ficam os telefones registrados.
Já testei tanto deixando todos os IPs possíveis do Call Manager, quanto apenas a referente ao registro do meu telefone no Call Manager(39.42) e a demora é a mesma. ;[callman01] ;type=friend ;context=ramais ;host=172.17.39.41 ;disallow=all ;allow=ulaw ;allow=alaw ;nat=no ;canreinvite=yes ;qualify=yes [callman02] type=friend context=ramais host=172.17.39.42 disallow=all allow=ulaw allow=alaw nat=no canreinvite=yes qualify=yes ;[callman03] ;type=friend ;context=ramais ;host=172.17.39.43 ;disallow=all ;allow=ulaw ;allow=alaw ;nat=no ;canreinvite=yes ;qualify=yes Do lado do Call Manager está tudo configurado e eles estão falando UDP. No lado do Asterisk , não consegui alguma captura especifica, mas peguei via TCPDUMP que ele parece tentar todos antes de efetivamente fechar com o primeiro , embora já tenha recebido INVITE do correto. tcpdump -i ens192 dst 172.17.37.129 and src 172.17.39.41 or 172.17.39.42 or 172.17.39.43 16:47:31.740674 IP *cucmservice01.sip* > asterisk.ogmaster.local.sip: SIP: INVITE sip:[email protected]:5060 SIP/2.0 16:47:32.254307 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: INVITE sip:[email protected]:5060 SIP/2.0 16:47:33.258050 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: INVITE sip:[email protected]:5060 SIP/2.0 16:47:35.272582 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: INVITE sip:[email protected]:5060 SIP/2.0 16:47:38.225049 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:38.740848 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:39.282208 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: INVITE sip:[email protected]:5060 SIP/2.0 16:47:39.751717 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:41.754129 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:43.224610 ARP, Request who-has asterisk.ogmaster.local tell infocucmpub, length 46 16:47:45.768670 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:46.055483 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:46.560533 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:47.292581 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: INVITE sip:[email protected]:5060 SIP/2.0 16:47:47.572900 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:49.587485 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:49.780979 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:51.054865 ARP, Request who-has asterisk.ogmaster.local tell cucmservice02, length 46 16:47:52.292278 ARP, Request who-has asterisk.ogmaster.local tell cucmservice01, length 46 16:47:53.596301 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:53.785687 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:57.607030 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:47:59.754553 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: ACK sip:[email protected]:5060 SIP/2.0 16:47:59.755067 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: ACK sip:[email protected]:5060 SIP/2.0 16:47:59.756284 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: ACK sip:[email protected]:5060 SIP/2.0 16:48:00.535923 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: OPTIONS sip:172.17.37.129:5060 SIP/2.0 16:48:02.126054 IP infocucmpub.sip > asterisk.ogmaster.local.sip: SIP: SIP/2.0 200 OK 16:48:02.220213 IP cucmservice01.sip > asterisk.ogmaster.local.sip: SIP: SIP/2.0 200 OK 16:48:02.220484 IP cucmservice02.sip > asterisk.ogmaster.local.sip: SIP: SIP/2.0 200 OK tcpdump -i ens192 src 172.17.37.129 and dst 172.17.39.41 or 172.17.39.42 or 172.17.39.43 16:47:59.749555 IP asterisk.ogmaster.local.sip > *cucmservice01.sip*: SIP: SIP/2.0 100 Trying 16:47:59.749932 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 100 Trying 16:47:59.750055 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 100 Trying 16:47:59.750181 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 100 Trying 16:47:59.750348 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.750472 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.750514 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 200 OK 16:47:59.750797 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 100 Trying 16:47:59.750935 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 200 OK 16:47:59.751084 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.751193 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.751293 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.751487 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: SIP/2.0 404 Not Found 16:47:59.751608 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: SIP/2.0 404 Not Found 16:47:59.751761 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 100 Trying 16:47:59.751864 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 200 OK 16:47:59.751998 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: SIP/2.0 404 Not Found 16:47:59.752116 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: SIP/2.0 404 Not Found 16:47:59.752230 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.752343 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: SIP/2.0 404 Not Found 16:47:59.752458 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: SIP/2.0 404 Not Found 16:47:59.752576 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: SIP/2.0 404 Not Found 16:48:00.536313 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 404 Not Found 16:48:02.124006 IP asterisk.ogmaster.local.sip > infocucmpub.sip: SIP: OPTIONS sip:172.17.39.41 SIP/2.0 16:48:02.218575 IP asterisk.ogmaster.local.sip > cucmservice02.sip: SIP: OPTIONS sip:172.17.39.43 SIP/2.0 16:48:02.218761 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: OPTIONS sip:172.17.39.42 SIP/2.0 16:48:02.589632 IP asterisk.ogmaster.local.sip > cucmservice01.sip: SIP: SIP/2.0 200 OK Testei alguns Debugs que fui pesquisando na internet mas não consegui compreender muito bem.... [Oct 31 15:35:20] DEBUG[31072] chan_sip.c: = Looking for Call ID: [email protected] (Checking From) --From tag 1146601895 --To-tag [Oct 31 15:35:20] DEBUG[31072] acl.c: For destination '172.17.39.42', our source address is '172.17.37.129'. [Oct 31 15:35:20] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:35:20] DEBUG[31072] netsock2.c: Splitting '172.17.39.42:5060' into... [Oct 31 15:35:20] DEBUG[31072] netsock2.c: ...host '172.17.39.42' and port '5060'. [Oct 31 15:35:20] DEBUG[31072] chan_sip.c: Allocating new SIP dialog for [email protected] - OPTIONS (No RTP) [Oct 31 15:35:20] DEBUG[31072] chan_sip.c: **** Received OPTIONS (3) - Command in SIP OPTIONS [Oct 31 15:35:20] DEBUG[31072] netsock2.c: Splitting '172.17.37.129:5060' into... [Oct 31 15:35:20] DEBUG[31072] netsock2.c: ...host '172.17.37.129' and port ''. [Oct 31 15:35:20] DEBUG[31072] netsock2.c: Splitting '172.17.39.42' into... [Oct 31 15:35:20] DEBUG[31072] netsock2.c: ...host '172.17.39.42' and port ''. [Oct 31 15:35:20] DEBUG[31072] chan_sip.c: Trying to put 'SIP/2.0 404' onto UDP socket destined for 172.17.39.42:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Allocating new SIP dialog for 7eeb423d62baf89b2376864b55f025a9@[fe80::a0e0:69c4:bc8b:b417]:5060 - OPTIONS (No RTP) [Oct 31 15:35:21] DEBUG[31072] acl.c: For destination '172.17.39.43', our source address is '172.17.37.129'. [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: SIP call-id changed from '7eeb423d62baf89b2376864b55f025a9@[fe80::a0e0:69c4:bc8b:b417]:5060' to ' [email protected]:5060' [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Initializing initreq for method OPTIONS - callid [email protected]:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Trying to put 'OPTIONS sip' onto UDP socket destined for 172.17.39.43:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Allocating new SIP dialog for 2b73bb0d2c3469fa0780743f3270ca4f@[fe80::a0e0:69c4:bc8b:b417]:5060 - OPTIONS (No RTP) [Oct 31 15:35:21] DEBUG[31072] acl.c: For destination '172.17.39.42', our source address is '172.17.37.129'. [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: SIP call-id changed from '2b73bb0d2c3469fa0780743f3270ca4f@[fe80::a0e0:69c4:bc8b:b417]:5060' to ' [email protected]:5060' [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Initializing initreq for method OPTIONS - callid [email protected]:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Trying to put 'OPTIONS sip' onto UDP socket destined for 172.17.39.42:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Allocating new SIP dialog for 3c48a6e96480adda0d8af61a4d498fb7@[fe80::a0e0:69c4:bc8b:b417]:5060 - OPTIONS (No RTP) [Oct 31 15:35:21] DEBUG[31072] acl.c: For destination '172.17.39.41', our source address is '172.17.37.129'. [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: SIP call-id changed from '3c48a6e96480adda0d8af61a4d498fb7@[fe80::a0e0:69c4:bc8b:b417]:5060' to ' [email protected]:5060' [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Initializing initreq for method OPTIONS - callid [email protected]:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Trying to put 'OPTIONS sip' onto UDP socket destined for 172.17.39.41:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: = Looking for Call ID: [email protected]:5060 (Checking To) --From tag as2ee346e2 --To-tag 348178859 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Stopping retransmission on ' [email protected]:5060' of Request 102: Match Found [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: = Looking for Call ID: [email protected]:5060 (Checking To) --From tag as138ca155 --To-tag 802041871 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Stopping retransmission on ' [email protected]:5060' of Request 102: Match Found [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Destroying SIP dialog [email protected]:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Destroying SIP dialog [email protected]:5060 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: = Looking for Call ID: [email protected]:5060 (Checking To) --From tag as34b82738 --To-tag 605276003 [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Stopping retransmission on ' [email protected]:5060' of Request 102: Match Found [Oct 31 15:35:21] DEBUG[31072] chan_sip.c: Destroying SIP dialog [email protected]:5060 [Oct 31 15:35:36] DEBUG[31072] chan_sip.c: Auto destroying SIP dialog ' [email protected]' [Oct 31 15:35:36] DEBUG[31072] chan_sip.c: Destroying SIP dialog [email protected] [Oct 31 15:35:43] DEBUG[31072] chan_sip.c: Auto destroying SIP dialog ' [email protected]' [Oct 31 15:35:43] DEBUG[31072] chan_sip.c: Destroying SIP dialog [email protected] [Oct 31 15:35:52] DEBUG[31072] chan_sip.c: Auto destroying SIP dialog ' [email protected]' [Oct 31 15:35:52] DEBUG[31072] chan_sip.c: Destroying SIP dialog [email protected] [Oct 31 15:36:04] DEBUG[31072] chan_sip.c: = Looking for Call ID: [email protected] (Checking From) --From tag 1522038610 --To-tag [Oct 31 15:36:04] DEBUG[31072] acl.c: For destination '172.17.39.43', our source address is '172.17.37.129'. [Oct 31 15:36:04] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:36:04] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:36:04] DEBUG[31072] netsock2.c: Splitting '172.17.39.43:5060' into... [Oct 31 15:36:04] DEBUG[31072] netsock2.c: ...host '172.17.39.43' and port '5060'. [Oct 31 15:36:04] DEBUG[31072] chan_sip.c: Allocating new SIP dialog for [email protected] - OPTIONS (No RTP) [Oct 31 15:36:04] DEBUG[31072] chan_sip.c: **** Received OPTIONS (3) - Command in SIP OPTIONS [Oct 31 15:36:04] DEBUG[31072] netsock2.c: Splitting '172.17.37.129:5060' into... [Oct 31 15:36:04] DEBUG[31072] netsock2.c: ...host '172.17.37.129' and port ''. [Oct 31 15:36:04] DEBUG[31072] netsock2.c: Splitting '172.17.39.43' into... [Oct 31 15:36:04] DEBUG[31072] netsock2.c: ...host '172.17.39.43' and port ''. [Oct 31 15:36:04] DEBUG[31072] chan_sip.c: Trying to put 'SIP/2.0 404' onto UDP socket destined for 172.17.39.43:5060 [Oct 31 15:36:12] DEBUG[31072] chan_sip.c: = Looking for Call ID: [email protected] (Checking From) --From tag 639004019 --To-tag [Oct 31 15:36:12] DEBUG[31072] acl.c: For destination '172.17.39.41', our source address is '172.17.37.129'. [Oct 31 15:36:12] DEBUG[31072] chan_sip.c: Setting AST_TRANSPORT_UDP with address 172.17.37.129:5060 [Oct 31 15:36:12] DEBUG[31072] netsock2.c: Splitting '172.17.39.41:5060' into... [Oct 31 15:36:12] DEBUG[31072] netsock2.c: ...host '172.17.39.41' and port '5060'. [Oct 31 15:36:12] DEBUG[31072] chan_sip.c: Allocating new SIP dialog for [email protected] - OPTIONS (No RTP) [Oct 31 15:36:12] DEBUG[31072] chan_sip.c: **** Received OPTIONS (3) - Command in SIP OPTIONS [Oct 31 15:36:12] DEBUG[31072] netsock2.c: Splitting '172.17.37.129:5060' into... [Oct 31 15:36:12] DEBUG[31072] netsock2.c: ...host '172.17.37.129' and port ''. [Oct 31 15:36:12] DEBUG[31072] netsock2.c: Splitting '172.17.39.41' into... [Oct 31 15:36:12] DEBUG[31072] netsock2.c: ...host '172.17.39.41' and port ''. [Oct 31 15:36:12] DEBUG[31072] chan_sip.c: Trying to put 'SIP/2.0 404' onto UDP socket destined for 172.17.39.41:5060 Atenciosamente, Giliardy Correia Arena. Em qui, 1 de nov de 2018 às 15:05, Giliardy Arena <[email protected]> escreveu: > Olá pessoal ! > Alguma ajuda ? Alguma dica ? > > Obrigado > > > Atenciosamente, > Giliardy Correia Arena. > > > > > Em qua, 31 de out de 2018 às 10:58, Giliardy Arena < > [email protected]> escreveu: > >> Olá , bom dia. >> >> Alguém sugere alguma forma de eu rastrear a ligação desde a chegada da >> requisicao SIP no servidor Asterisk , para entender o motivo de demorar >> muito para conectar? Algum debug específico, um trace , um log... >> >> Obrigado >> >> Em ter, 30 de out de 2018 20:22, Giliardy Arena <[email protected]> >> escreveu: >> >>> Sylvio >>> >>> O waitforsilence é para identificar se não tiver mais conversação e >>> encerrar a ligação. >>> Para evitar ficar alguma chamada presa gravando eternamente. >>> >>> >>> Atenciosamente, >>> Giliardy Correia Arena. >>> >>> >>> >>> >>> Em ter, 30 de out de 2018 às 17:57, Giliardy Arena < >>> [email protected]> escreveu: >>> >>>> Caros, >>>> Boa tarde. >>>> >>>> Estou aprendendo e estudando sobre o Asterisk. >>>> Atualmente administro um Cisco Call Manager e a minha ideia é usar o >>>> Asterisk para gravar ligações recebidas do Call Manager. >>>> >>>> Fiz a integração do Asterisk com o Call Manager com sucesso. >>>> >>>> Estou com problema para entender o motivo do Asterisk demorar para >>>> conectar a ligação a uma extensão. Tenho pesquisado, mas com dificuldades >>>> para entender como debugar. >>>> >>>> Criei a seguinte extensão, que atende sozinha e grava. >>>> >>>> exten => 2005,1,Answer() >>>> exten => >>>> 2005,n,MixMonitor(Ramal-${CALLERID(num)}-Em-${STRFTIME(${EPOCH},,%d-%m-%Y-%H-%M)}.wav) >>>> exten => 2005,n,WaitForSilence(10000|6) >>>> exten => 2005,n,Hangup >>>> >>>> >>>> Também experimentei o mesmo sintoma através de uma extensão que criei e >>>> loguei numa softphone. >>>> >>>> - Ativei Debug full , mas não tem nenhuma mensagem importante. Apenas o >>>> que vejo na CLI do asterisk >>>> >>>> - Na CLI do Asterisk só vejo log quando a chamada efetivamente é >>>> conectada, não sei se consigo ver desde o momento que ele recebe a >>>> requisição. >>>> >>>> - Fiz um TCPDUMP e realmente me parece que é o Asterisk demorando a >>>> conectar a extensão, mas via TCPDUMP não tenho detalhes para entender e >>>> ajustar. Demora aproximadamente 30segundos após chamar do Call Manager. >>>> >>>> >>>> Alguém pode me dar um help de por onde eu posso rastrear para tentar >>>> corrigir ? >>>> >>>> Obrigado! >>>> >>>> Atenciosamente, >>>> Giliardy Correia Arena. >>>> >>>> >>>>
_______________________________________________ KHOMP: completa linha de placas externas FXO, FXS, GSM e E1 Media Gateways de 1 a 64 E1s para SIP com R2, ISDN e SS7 Intercomunicador e acesso remoto via rede IP e telefones IP Conheça todo o portfólio em www.Khomp.com _______________________________________________ Para remover seu email desta lista, basta enviar um email em branco para [email protected]

