Permitir chamadas de entrada e saída no mesmo asterisco (número não registrado)

1

Eu tenho um caso particular em que operadora (não provedor) me atende sem precisar se registrar. No lado do portador, os números têm um IP associado que é usado para encaminhar qualquer chamada. Para chamada de saída, eu só preciso empurrar a chamada para o servidor transportadora (sem registro). Para enviar chamadas de saída, eu tenho um Cisco SPA504G, disposto a comprar vários outros se eu puder encontrar uma solução de trabalho.

Depois de testar muitas configurações, posso fazer chamadas de saída ou de entrada com a alteração das configurações, mas não consigo ter as duas coisas funcionando ao mesmo tempo. Pelo que vi, o "outcall" no sip.conf é usado em chamadas de entrada que eu não quero. Eu tentei muitas configurações com dicas on-line / howto, mas o meu caso parece um pouco particular.

Por favor, encontre abaixo minha configuração e me ajude a resolver este problema:)

sip.conf

[general]
maxexpirey=3600
defaultexpirey=3600
registertimeout=300
context=default
transport=udp
disallow=all
allow=ulaw
dtmfmode=auto
allowguest=yes
language=ja


[151]
type=user
;nat=force_rport,comedia
secret=151secret
host=dynamic
regext=151
context=fxsgroup
;directmedia=nonat
;directrtpsetup=no
allowguest=yes
defaultuser=151
fromuser=151
;nat=route
[outcall]
defaultuser=03XXXX9510
type=peer
;secret=03XXXX9510
host=10.254.32.1
fromuser=0367449510
context=fxsgroup
;trustrpid = yes
;sendrpid = yes
;canreinvite = no
;directmedia=no
allowguest=no

extensions.conf

[default]
;[03XXXX9510] ALEX 03XXXX9510 (
    exten => 03XXXX9510,Dial(SIP/151@outcall,60)
;   exten => 03XXXX9510,n,Dial(SIP/03XXXX2740@outcall,80)
    exten => 03XXXX9510,n,Hangup

[fxsgroup]
;151 ext
exten => 151,1,Dial(SIP/151,60,rT)

exten => _XXXXXXXXXXX, 1,Set(CALLERID(num)=03XXXX9510)
exten => _XXXXXXXXXXX, n, Dial(SIP/${EXTEN}@outcall, 20)
exten => _XXXXXXXXXXX, n, Congestion()
exten => _XXXXXXXXXXX, n, Hangup()

exten => _XXXXXXXXXX, 1,Set(CALLERID(num)=03XXXX9510)
exten => _XXXXXXXXXX, n, Dial(SIP/${EXTEN}@outcall, 20)
exten => _XXXXXXXXXX, n, Congestion()
exten => _XXXXXXXXXX, n, Hangup()

rastrear na depuração sip (chamada de entrada indo para outcall e não para o contexto padrão)

<--- SIP read from UDP:10.254.32.1:5060 --->
INVITE sip:[email protected]:5060 SIP/2.0
Call-ID: [email protected]
CSeq: 1 INVITE
From: <sip:[email protected]>;tag=12d7dc8113006c-f5c541eb42415
To: <sip:[email protected]>
Via: SIP/2.0/UDP 10.254.32.1:5060;branch=z9hG4bKfbd30971b55b4da33c7b37b23d0d2bf5
Max-Forwards: 70
Contact: <sip:[email protected]:5060>
Allow: OPTIONS, INVITE, ACK, CANCEL, BYE
Supported: timer
Content-Type: application/sdp
Content-Length: 138

v=0
o=- 1494691107189 0 IN IP4 10.254.32.1
s=-
c=IN IP4 10.254.32.1
t=0 0
m=audio 57396 RTP/AVP 0
a=rtpmap:0 PCMU/8000
a=sendrecv
<------------->
--- (12 headers 8 lines) ---
Sending to 10.254.32.1:5060 (no NAT)
Sending to 10.254.32.1:5060 (no NAT)
Using INVITE request as basis request - [email protected]
Found peer 'outcall' for '080XXXX2374' from 10.254.32.1:5060
Found RTP audio format 0
Found audio description format PCMU for ID 0
Capabilities: us - (ulaw), peer - audio=(ulaw)/video=(nothing)/text=(nothing), combined - (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x0 (nothing), combined - 0x0 (nothing)
Peer audio RTP is at port 10.254.32.1:57396
Looking for 03XXXX9510 in fxsgroup (domain 172.30.20.4)
sip_route_dump: route/path hop: <sip:[email protected]:5060>

<--- Transmitting (no NAT) to 10.254.32.1:5060 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.254.32.1:5060;branch=z9hG4bKfbd30971b55b4da33c7b37b23d0d2bf5;received=10.254.32.1
From: <sip:[email protected]>;tag=12d7dc8113006c-f5c541eb42415
To: <sip:[email protected]>
Call-ID: [email protected]
CSeq: 1 INVITE
Server: Asterisk PBX 14.2.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Session-Expires: 1800;refresher=uas
Contact: <sip:[email protected]:5060>
Content-Length: 0


<------------>
Audio is at 12388
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.254.32.1:5060:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 172.30.20.4:5060;branch=z9hG4bK60e97466
Max-Forwards: 70
From: <sip:[email protected]>;tag=as53476181
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 14.2.1
Date: Sat, 13 May 2017 15:58:27 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 249

v=0
o=root 1244963103 1244963103 IN IP4 172.30.20.4
s=Asterisk PBX 14.2.1
c=IN IP4 172.30.20.4
t=0 0
m=audio 12388 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

---

<--- SIP read from UDP:10.254.32.1:5060 --->
SIP/2.0 486 Busy Here
Via: SIP/2.0/UDP 172.30.20.4:5060;branch=z9hG4bK60e97466
Max-Forwards: 70
From: <sip:[email protected]>;tag=as53476181
To: <sip:[email protected]>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Contact: <sip:[email protected]:5060>
Allow: OPTIONS, INVITE, ACK, CANCEL, BYE
Content-Length: 0

<------------->
--- (10 headers 0 lines) ---
Transmitting (no NAT) to 10.254.32.1:5060:
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 172.30.20.4:5060;branch=z9hG4bK60e97466
Max-Forwards: 70
From: <sip:[email protected]>;tag=as53476181
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 14.2.1
Content-Length: 0

Tenho certeza de que existe uma solução, provavelmente um passo à frente;)

Obrigado antecipadamente!

    
por KuroNeko 13.05.2017 / 18:15

1 resposta

1

Você deve renomear seu usuário SIP como 'outcall' para 'trunk a' porque é isso que é; sim, as chamadas de entrada e de saída vão usar isso.

O Asterisk está fazendo exatamente o que você disse para fazer. As chamadas que atingem o terminal em 10.254.32.1 pertencem ao usuário do SIP 'outcalls' cujo contexto padrão é fxsgroup. Infelizmente o usuário 03XXXX9510 não existe no contexto fxsgroup, então sua chamada está falhando.

    
por 07.08.2017 / 22:47