Changing port for kamailio and asterisk
Added by Shivam Agrawal over 4 years ago
Hi,
I have been using GOautodial for around a month and things were great. Until my sip provider blocked requests from all port except 5060.
Since currently asterisk runs on 5070 requests from that. I am able to change asterisk port to 5060 but I am unable to change kamailio port which is running at 5060 currently.
Due to which I am unable to hear voice on my softphone after changing asterisk port and calling.
I have attached logs of asterisk while I login to dialer.
Someone please help me with this and Thanks in advance.
[[Audio is at 17024
Adding codec opus to SDP
Adding codec ulaw to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (NAT) to 127.0.0.1:5060:
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK40fc3226;rport
Max-Forwards: 70
From: "S2006221530408600051" <sip:[email protected]>;tag=as2b79611e
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.17.2-vici
Date: Mon, 22 Jun 2020 10:00:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Remote-Party-ID: "S2006221530408600051" <sip:[email protected]>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 308
v=0
o=root 1014497388 1014497388 IN IP4 127.0.0.1
s=Asterisk PBX 13.17.2-vici
c=IN IP4 127.0.0.1
t=0 0
m=audio 17024 RTP/AVP 107 0 101
a=rtpmap:107 opus/48000/2
a=fmtp:107 useinbandfec=1
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:20
a=sendrecv
<--- SIP read from UDP:127.0.0.1:5060 --->
INVITE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK40fc3226;rport
Max-Forwards: 70
From: "S2006221530408600051" <sip:[email protected]>;tag=as2b79611e
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 13.17.2-vici
Date: Mon, 22 Jun 2020 10:00:40 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Remote-Party-ID: "S2006221530408600051" <sip:[email protected]>;party=calling;privacy=off;screen=no
Content-Type: application/sdp
Content-Length: 308
v=0
o=root 1014497388 1014497388 IN IP4 127.0.0.1
s=Asterisk PBX 13.17.2-vici
c=IN IP4 127.0.0.1
t=0 0
m=audio 17024 RTP/AVP 107 0 101
a=rtpmap:107 opus/48000/2
a=fmtp:107 useinbandfec=1
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:20
a=sendrecv
<------------->
--- (15 headers 14 lines) ---
Sending to 127.0.0.1:5060 (NAT)
Sending to 127.0.0.1:5060 (NAT)
Using INVITE request as basis request - [email protected]:5060
Found peer 'kamailio' for '5164536886' from 127.0.0.1:5060
Found RTP audio format 107
Found RTP audio format 0
Found RTP audio format 101
Found audio description format opus for ID 107
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Capabilities: us - (opus|ulaw), peer - audio=(ulaw|opus)/video=(nothing)/text=(nothing), combined - (opus|ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port 127.0.0.1:17024
Looking for 7495393220 in default (domain vaglxc01.goautodial.com)
<--- Reliably Transmitting (NAT) to 127.0.0.1:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK40fc3226;received=127.0.0.1;rport=5060
From: "S2006221530408600051" <sip:[email protected]>;tag=as2b79611e
To: <sip:[email protected]>;tag=as11d93721
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Server: Asterisk PBX 13.17.2-vici
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Length: 0
<------------>
Scheduling destruction of SIP dialog '[email protected]:5060' in 6400 ms (Method: INVITE)
<--- SIP read from UDP:127.0.0.1:5060 --->
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK40fc3226;received=127.0.0.1;rport=5060
From: "S2006221530408600051" <sip:[email protected]>;tag=as2b79611e
To: <sip:[email protected]>;tag=as11d93721
Call-ID: [email protected]:5060
CSeq: 102 INVITE
Server: Asterisk PBX 13.17.2-vici
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
Transmitting (NAT) to 127.0.0.1:5060:
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK40fc3226;rport
Max-Forwards: 70
From: "S2006221530408600051" <sip:[email protected]>;tag=as2b79611e
To: <sip:[email protected]>;tag=as11d93721
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.17.2-vici
Content-Length: 0
<--- SIP read from UDP:127.0.0.1:5060 --->
ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 127.0.0.1:5060;branch=z9hG4bK40fc3226;rport
Max-Forwards: 70
From: "S2006221530408600051" <sip:[email protected]>;tag=as2b79611e
To: <sip:[email protected]>;tag=as11d93721
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 13.17.2-vici
Content-Length: 0
<------------->
--- (10 headers 0 lines) ---
Really destroying SIP dialog '[email protected]:5060' Method: ACK
Scheduling destruction of SIP dialog '[email protected]:5060' in 6400 ms (Method: INVITE)
Really destroying SIP dialog '[email protected]:5060' Method: INVITE
Really destroying SIP dialog '[email protected]:5060' Method: OPTIONS]]
Thanks and Regards,
Shivam A.
Replies (3)
RE: Changing port for kamailio and asterisk - Added by Demian Biscocho over 4 years ago
Asterisk port 5070 only applies to incoming calls to Asterisk. All outgoing SIP calls uses standard 5060. It's possible to interchange Kamailio 5060 to 5070 and Asterisk's 5070 to 5060 or have Asterisk and Kamailio on separate boxes so both can use 5060.
RE: Changing port for kamailio and asterisk - Added by Gokhan SAHIN 5 months ago
hello, I am having the same problem. did you solve the problem?
I did bindport=5060 in sip.conf. then listen=udp:127.0.0.1:5080 in kamailio.cfg
I did listen=udp:10.10.40.29:5080. but kamailio is not working. when I look at sip show peers it shows unreacheable.
how can we solve it? provider only accepts requests from 5060.
regards.
RE: Changing port for kamailio and asterisk - Added by Wittie Manansala 5 months ago
Revert to the default settings first and make sure it's working properly, then try adjusting the config files. This might help.
/etc/asterisk/sip-goautodial.conf
/etc/kamailio/kamailio.cfg
/etc/asterisk/sip.conf
Thanks