No IP address in the channel

I am using asterisk Asterisk 1.4.41 on kernel 2.6.32-71.29.1.el6.x86_64.

I am having an issue when the channel field in the cdr does not have the IP address in it. instead of seeing something like
SIP/1.1.1.1-5060-0010a663 I see SIP/5060-0010a663.

The sip debug looks as follows

[code]
<— SIP read from 100.100.100.100:5060 —>
INVITE sip:02081235555@4.4.4.4:5060 SIP/2.0
From: sip:07718652389@100.100.100.100:5060;tag=99806b4d-13c4-4f2294bd-b63c3f7b-46e07264
To: +442081235555 sip:02081235555@4.4.4.4:5060
Call-ID: CXC-105-69761310-99806b4d-13c4-4f2294bd-b63c3f7b-7536c3f6@100.100.100.100
CSeq: 1 INVITE
Via: SIP/2.0/UDP 100.100.100.100:5060;branch=z9hG4bK-24b7e8-4f2294bd-b63c3f7b-6dc35ccd
Max-Forwards: 67
Supported: timer
Session-Expires: 900
Min-SE: 450
Allow: INVITE,ACK,PRACK,SUBSCRIBE,BYE,CANCEL,NOTIFY,INFO,REFER,UPDATE
Contact: sip:07718652389@100.100.100.100:5060;maddr=100.100.100.100;transport=udp
Content-Type: application/sdp
Content-Length: 426

v=0
o=- 4946626 0 IN IP4 100.100.100.100
s=Cisco SDP 0
c=IN IP4 100.100.100.100
t=0 0
m=audio 23780 RTP/AVP 8 18 0 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sqn:0
a=cdsc:1 audio RTP/AVP 8 18 0 101
a=cdsc:5 image udptl t38
a=cpar:a=T38FaxVersion:0
a=cpar:a=T38FaxRateManagement:transferredTCF
a=cpar:a=T38FaxMaxDatagram:160
a=cpar:a=T38FaxUdpEC:t38UDPRedundancy
a=X-sqn:0
a=X-cap:1 image udptl t38[/code]

I do not know of any other way to debug this problem. any help is welcome.

thanks

It is behaving as intended. You have a valid match on a sip.conf entry.

If you actually get IP addresses, you have allowguest set to yes, which is normally unsafe, and you failed to match a specific sip.conf entry.

hi david55. I am not sure that I understand. I have looked through my sip.conf entry and I am seeing a lot simalar to the following

[12345] type=friend accountcode=12345 username=12345 secret=letmein context=default call-limit=1 busy-level=1 incominglimit=1 outgoinglimit=1 host=dynamic nat=yes qualify=yes canreinvite=no

How could any of them match the call i am receiving?

Below is a sip debug when I do get the ip address in the channel.

[code]SIP/2.0 200 OK
Via: SIP/2.0/UDP 2.2.2.2:5060;branch=z9hG4bK42615755;received=2.2.2.2;rport=5060
From: “7718564582” sip:7718564582@2.2.2.2;tag=as70f1f5f2
To: sip:07935324199@217.73.66.90;tag=as28706db8
Call-ID: 5ddac9733a3e13120d2a26877cb9f879@2.2.2.2
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
Supported: replaces
Contact: sip:07935324199@2.2.2.2
Content-Type: application/sdp
Content-Length: 236

v=0
o=root 31650 31650 IN IP4 2.2.2.2
s=session
c=IN IP4 217.73.66.90
t=0 0
m=audio 11850 RTP/AVP 18 101
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv[/code]

I get sent the calls direc to my ip address. there are no peer or friend setup that I do in the sip.conf file.

It will match if either the source IP address is the address from which that device last registered, or the user part of the From: header matches the section name. An IP address match will be preferred over a From header match.

You should normally have allowguest=no, so that only calls that match are accepted, otherwise you will get a lot of calls from exotic addresses getting into your default context.

We only allow specific ip addresses through to our asterisk server.

Below are the output sip peers and registry

[root@server ~]# asterisk -rx 'sip show registry' Host Username Refresh State Reg.Time [root@server ~]# asterisk -rx 'sip show peers' Name/username Host Dyn Nat ACL Port Status 26168/26168 (Unspecified) D N 0 UNKNOWN 26167/26167 (Unspecified) D N 0 UNKNOWN 26166/26166 (Unspecified) D N 0 UNKNOWN 26165/26165 (Unspecified) D N 0 UNKNOWN 26164/26164 (Unspecified) D N 0 UNKNOWN 26163/26163 (Unspecified) D N 0 UNKNOWN 26162/26162 (Unspecified) D N 0 UNKNOWN 26161/26161 (Unspecified) D N 0 UNKNOWN 26160/26160 (Unspecified) D N 0 UNKNOWN 26159/26159 (Unspecified) D N 0 UNKNOWN 26158/26158 (Unspecified) D N 0 UNKNOWN 26157/26157 (Unspecified) D N 0 UNKNOWN 26156/26156 (Unspecified) D N 0 UNKNOWN 26155/26155 (Unspecified) D N 0 UNKNOWN 26154/26154 (Unspecified) D N 0 UNKNOWN 26152/26152 (Unspecified) D N 0 UNKNOWN 26151/26151 (Unspecified) D N 0 UNKNOWN 26150/26150 (Unspecified) D N 0 UNKNOWN 26149/26149 (Unspecified) D N 0 UNKNOWN 26148/26148 (Unspecified) D N 0 UNKNOWN 26147/26147 (Unspecified) D N 0 UNKNOWN 26153/26153 (Unspecified) D N 0 UNKNOWN 111002/111002 (Unspecified) D N 0 UNKNOWN 111001/111001 (Unspecified) D N 0 UNKNOWN 24 sip peers [Monitored: 0 online, 24 offline Unmonitored: 0 online, 0 offline]

I dont see how anything in the header can match the above peers.

here is the dump again, this time preseving the original numbers. I have only changed the server IP.

[code]<— SIP read from 1.1.1.1:5060 —>
INVITE sip:01133167017@2.2.2.2:5060 SIP/2.0
From: sip:07805204265@1.1.1.1:5060;tag=99806b4d-13c4-4f2294bd-b63c3f7b-46e07264
To: +441133167017 sip:01133167017@2.2.2.2:5060
Call-ID: CXC-105-69761310-99806b4d-13c4-4f2294bd-b63c3f7b-7536c3f6@77.107.128.156
CSeq: 1 INVITE
Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK-24b7e8-4f2294bd-b63c3f7b-6dc35ccd
Max-Forwards: 67
Supported: timer
Session-Expires: 900
Min-SE: 450
Allow: INVITE,ACK,PRACK,SUBSCRIBE,BYE,CANCEL,NOTIFY,INFO,REFER,UPDATE
Contact: sip:07805204265@1.1.1.1:5060;maddr=1.1.1.1;transport=udp
Content-Type: application/sdp
Content-Length: 426

v=0
o=- 4946626 0 IN IP4 1.1.1.1
s=Cisco SDP 0
c=IN IP4 1.1.1.1
t=0 0
m=audio 23780 RTP/AVP 8 18 0 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sqn:0
a=cdsc:1 audio RTP/AVP 8 18 0 101
a=cdsc:5 image udptl t38
a=cpar:a=T38FaxVersion:0
a=cpar:a=T38FaxRateManagement:transferredTCF
a=cpar:a=T38FaxMaxDatagram:160
a=cpar:a=T38FaxUdpEC:t38UDPRedundancy
a=X-sqn:0
a=X-cap:1 image udptl t38 [/code]

An Asterisk SIP peer with address set to “(Unspecified)” is of no use to anyone, and might as well not be there. Before it is useful, you must either explicitly set a static address, or the device must register.

In particular, it cannot be used for outgoing calls without an address and it could only be used for incoming calls if the From address matched the section name, but you would use a pure “user” entry, not a “friend” one for that. If you get an IP address in the CDR, the sip.conf entry has not served any purpose for Asterisk, as it has been bypassed.

That is what I am after. When I recieve that call, I want it to bypass the sip.conf and give me the ip address in the CDR.

Since I am not getting the IP address in the CDR, I am guessing the sip.conf file is interfering. I dont understand why the sip.conf would interfere. the user doesn’t match, neither does any of the IP addresses.

Could it be that the sender of the call is trying to establish and send down a sip trunk of sorts? and on my side it is lookinf for that in the sip.conf?

Thanks for you patience