Project

General

Profile

Inbound Number with E164 format - V4

Added by Jorge Cornejo about 5 years ago

Hi
Trying to setup a Twilio account, as it is well known, this is mandatory in E164 format. But at the Inbound Admin page, it wouldn't allow me to use + as recognized as an special character.
I tried updating the Asterisk tables but yet, I get a 404 error, so guessing I am missing something.

where could I see the AGI logs?

INVITE sip:+511139370687@subdomain.maindomain.com SIP/2.0
Record-Route: <sip:177.71.206.194:5060;lr;ftag=54794005_6772d868_95833def-5add-4766-8a99-960d08c9e3f4>
From: <sip:+5111995589070@test1.pstn.twilio.com>;tag=54794005_6772d868_95833def-5add-4766-8a99-960d08c9e3f4
To: <sip:+555139370687@subdomain.maindomain.com>
CSeq: 19998358 INVITE
Recv-Info: x-broadworks-client-session-info
Max-Forwards: 62
Diversion: <sip:+511139370687@public-vip.br1.twilio.com>;reason=unconditional
Call-ID: 1e3f0afab102da2cd2baa12fea223dc9@0.0.0.0
Via: SIP/2.0/UDP 177.71.206.194:5060;branch=z9hG4bK794c.84daf1b3.0
Via: SIP/2.0/UDP 172.19.128.227:5060;rport=5060;received=172.19.128.227;branch=z9hG4bK95833def-5add-4766-8a99-960d08c9e3f4_6772d868_139-1026663800066047465
Contact: <sip:+5111995589070@172.19.128.227:5060;transport=udp>
Allow: ACK,BYE,CANCEL,INVITE,OPTIONS,REFER,NOTIFY
User-Agent: Twilio Gateway
X-Twilio-AccountSid: ACbbbdd35c4a04528cd7be747b6e5d7d40
Content-Type: application/sdp
X-Twilio-CallSid: CAff59971416778e5a7f6e7345b8a776ea
Content-Length: 238

v=0
o=root 274648881 274648881 IN IP4 177.71.206.214
s=Twilio Media Gateway
c=IN IP4 177.71.206.214
t=0 0
m=audio 15294 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv
SIP/2.0 404 Not Found
From: <sip:+5111995589070@test1.pstn.twilio.com>;tag=54794005_6772d868_95833def-5add-4766-8a99-960d08c9e3f4
To: <sip:+555139370687@subdomain.maindomain.com>;tag=a6a1c5f60faecf035a1ae5b6e96e979a-bd2e
CSeq: 19998358 INVITE
Call-ID: 1e3f0afab102da2cd2baa12fea223dc9@0.0.0.0
Via: SIP/2.0/UDP 177.71.206.194:5060;branch=z9hG4bK794c.84daf1b3.0;rport=5060
Via: SIP/2.0/UDP 172.19.128.227:5060;rport=5060;received=172.19.128.227;branch=z9hG4bK95833def-5add-4766-8a99-960d08c9e3f4_6772d868_139-1026663800066047465
Content-Length: 0

ACK sip:+511139370687@subdomain.maindomain.com SIP/2.0
Via: SIP/2.0/UDP 177.71.206.194:5060;branch=z9hG4bK794c.84daf1b3.0
From: <sip:+5111995589070@test1.pstn.twilio.com>;tag=54794005_6772d868_95833def-5add-4766-8a99-960d08c9e3f4
Call-ID: 1e3f0afab102da2cd2baa12fea223dc9@0.0.0.0
To: <sip:+555139370687@subdomain.maindomain.com>;tag=a6a1c5f60faecf035a1ae5b6e96e979a-bd2e
CSeq: 19998358 ACK
Max-Forwards: 70
User-Agent: Twilio Gateway
Content-Length: 0


Replies (5)

RE: Inbound Number with E164 format - V4 - Added by Wittie Manansala about 5 years ago

Hi,

Hope the below notes in /etc/asterisk/extension.conf may help:

[trunkinbound]
; DID call routing process
; exten => _XXXXXXXXXX,1,AGI(agi-DID_route.agi)  ; use this one instead of the one below if you are having delay issues, and match to number of received digits
exten => _X.,1,AGI(agi-DID_route.agi)
exten => _X.,n,Hangup()
; If you have DIDs that arrive with a plus sign at the beginning then uncomment
;exten => _+X.,1,AGI(agi-DID_route.agi)
;exten => _+X.,n,Hangup()
; If you have DIDs that arrive with a plus and 1 at the beginning that you want to filter out, then uncomment
;exten => _+1X.,1,Goto(trunkinbound,${EXTEN:2},1)

RE: Inbound Number with E164 format - V4 - Added by Jorge Cornejo about 5 years ago

So
I am sending Twilio directly to port 5070 of Asterisk.
At the WebAdmin I can see that it creates a record at Asterisk DB under vicidial_inbound but doesn't modify any Asterisk file or Kamailio, therefore when I call to Asterisk or Kamailio it doesn't know what to do...
Do I have to add it manually? I thought GoAutodial would take care of everything. If so, how would the call end up in agents as agents are in Kamailio and public calls into Asterisk...doesn't quite match...Somehow Asterisk needs to know about Kamailio activity, but as there is no rule to forward events to Asterisk, how does this works??
Anyone has a functional V4? Can you share a Kamailio file showing asterisk integration?

Thanks!

RE: Inbound Number with E164 format - V4 - Added by Wittie Manansala about 5 years ago

Hi,

Based in your CLI your DID arrived with + sign or +511139370687. Try to ask your VOIP Provider to remove the + sign? If they're unable to remove it you have to edit /etc/asterisk/extension.conf and database table vicidial_inbound_dids>did_pattern.

Sample:

update vicidial_inbound_dids set did_pattern='+511139370687' where did_pattern='511139370687'

Thanks

RE: Inbound Number with E164 format - V4 - Added by Jorge Cornejo about 5 years ago

Yes I updated the database, but Asterisk doesn't use MySQL.
Does GoAutoDial is supposed to create the rule at the extension.conf too or should it be done manually?

RE: Inbound Number with E164 format - V4 - Added by Wittie Manansala about 5 years ago

Hi,

Try to enable below settings in extensions.conf:

1. nano /etc/asterisk/extensions.conf

FROM:

;exten => _+X.,1,AGI
;exten => _+X.,n,Hangup()

TO:
exten => _+X.,1,AGI
exten => _+X.,n,Hangup()

2. reload asterisk;
a. asterisk -vvvr
b. core reload

Thanks

    (1-5/5)
    Go to top