The IP address to call change, calling another server (IAX)

Hi,

from 3 days I’m trying to solve a problem, but I’ve not many information to supply.

The IP address to call change, calling another asterisk connected from iax protocol and the server called is the same where I’m logged.

Example:

I call SIP/1234 with IP x.x.x.x, but the call is sent to IP y.y.y.y (SIP/1234). The number 1234 is configured in both the server

Can be an asterisk behavior?

We will need more information. How are the calls being made? What is each systems extension range? What does the IAX configuration look like?

Hi,

IAX configuration >

[XXXXX]
type=friend
username=…
secret=…
auth=plaintext
host=…
context=fromiax
peercontext=fromiax
qualify=yes
transfer=yes

The call is made with Liblinphone dll.

Exstensions:

  1. IAX
    fromiax _. 1 Goto XXXXX,${EXTEN},1

  2. DIAL
    ‘XXXXX’, ‘1234’, ‘1’, ‘Dial’, ‘SIP/${EXTEN}’

Although not relevant here, “_.” is inadvisable because it also matches h, s, i, t, …

It is still proving difficult to work out what you are doing. My impression is that English is not a first language and you are abbreviating the information because of that, but that is actually the time when you must provide a lot of detail, so that you provide the same information in different ways and people can compensate when one of those ways was translated badly, by trying to find an interpretation that fits all the words.

I hope, be more explicative:
ACK sip:1111@192.168.0.70:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.0.125:5060;branch=z9hG4bK.FGXuZlEOE;rport
Call-ID: yvEoUuhwR6
From: sip:203@192.168.0.80;tag=~Cm2qqKr~
To: “” sip:1111@192.168.0.70;tag=as7dba4037
Contact: sip:203@192.168.0.125;transport=udp;+sip.instance=“urn:uuid:2221ac8a-2f0a-430e-9403-d933d1bb32a9
Route: sip:192.168.0.80;lr
Max-Forwards: 70
CSeq: 20 ACK

2018-08-24 16:12:27:223 belle-sip-error-bellesip_wake_lock_acquire(): cannot acquire wake lock. No JVM found
2018-08-24 16:12:27:223 belle-sip-message-channel [0x97644000]: received [488] new bytes from [UDP://::ffff:192.168.0.80:5060]:
BYE sip:203@192.168.0.125;transport=udp SIP/2.0
Via: SIP/2.0/UDP 192.168.0.80:5060;branch=z9hG4bK2982b9b0;rport
Max-Forwards: 70
From: sip:203@192.168.0.125;tag=vtKrBWI
To: “” sip:asterisk@192.168.0.80;tag=as6f400c86
Call-ID: 0ec7fb5a5f49ffae1e4603cc5f6897c6@192.168.0.80:5060
CSeq: 104 BYE
User-Agent: Asterisk PBX 15.2.2
X-Asterisk-HangupCause: Normal Clearing
X-Asterisk-HangupCauseCode: 16
Content-Length: 0

2018-08-24 16:12:27:244 belle-sip-message-channel [0x97644000] [488] bytes parsed
2018-08-24 16:12:27:245 belle-sip-message-channel [0x97644000]: message sent to [UDP://::ffff:192.168.0.80:5060], size: [341] bytes
SIP/2.0 481 Call/transaction does not exist
Via: SIP/2.0/UDP 192.168.0.80:5060;branch=z9hG4bK2982b9b0;rport
From: sip:203@192.168.0.125;tag=vtKrBWI
To: “” sip:asterisk@192.168.0.80;tag=as6f400c86
Call-ID: 0ec7fb5a5f49ffae1e4603cc5f6897c6@192.168.0.80:5060
CSeq: 104 BYE

2018-08-24 16:12:27:274 belle-sip-error-bellesip_wake_lock_acquire(): cannot acquire wake lock. No JVM found
2018-08-24 16:12:27:274 belle-sip-message-channel [0x97644000]: received [454] new bytes from [UDP://::ffff:192.168.0.80:5060]:
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.125:5060;branch=z9hG4bK.T-GdHrcK0;received=192.168.0.125;rport=5060
From: sip:203@192.168.0.80;tag=~Cm2qqKr~
To: “” sip:1111@192.168.0.70
Call-ID: yvEoUuhwR6
CSeq: 21 INVITE
Server: Asterisk PBX 15.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
>>> Contact: sip:1111@192.168.0.80:5060 <<< THE IP ADDRESS CHANGE, IT’S WRONG

It’s the IPv4 equivalent of the address from which the request was received, which looks right to me.

Are you another person with a broken SIP peer that attempts to use Contact for other then the intended purpose?

Hi,

when the call work well, the field “contact” don’t change.

it does not always happen

This is the log when works :

SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.101:5060;branch=z9hG4bK.zO~VqLFUj;received=192.168.0.101;rport=5060
From: “” sip:99999@192.168.0.70;tag=mUEYN04Ey
To: “” sip:9999@192.168.0.70
Call-ID: GIntaYTHbV
CSeq: 20 INVITE
Server: Asterisk PBX 15.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Contact: sip:9999@192.168.0.70:5060
Content-Length: 0

This is the log when not works :

SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.0.104:5060;branch=z9hG4bK.anNxcm64R;received=192.168.0.102;rport=5060
From: sip:203@192.168.0.80;tag=Jih-w-cx7
To: “” sip:9999@192.168.0.70
Call-ID: dW3~Vr-ZqU
CSeq: 21 INVITE
Server: Asterisk PBX 15.2.2
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces
Contact: sip:9999@192.168.0.80:5060
Content-Length: 0

Global Settings:

UDP Bindaddress: 0.0.0.0:5060
TCP SIP Bindaddress: Disabled
TLS SIP Bindaddress: Disabled
RTP Bindaddress: Disabled
Videosupport: No
Textsupport: No
Ignore SDP sess. ver.: No
AutoCreate Peer: Off
Match Auth Username: No
Allow unknown access: Yes
Allow subscriptions: Yes
Allow overlap dialing: No
Allow promisc. redir: No
Enable call counters: Yes
SIP domain support: No
Path support : No
Realm. auth: No
Our auth realm asterisk
Use domains as realms: No
Call to non-local dom.: Yes
URI user is phone no: No
Always auth rejects: No
Direct RTP setup: No
User Agent: Asterisk PBX 15.2.2
SDP Session Name: Asterisk PBX 15.2.2
SDP Owner Name: root
Reg. context: (not set)
Regexten on Qualify: No
Trust RPID: No
Send RPID: Yes
Legacy userfield parse: No
Send Diversion: Yes
Caller ID: asterisk
From: Domain:
Record SIP history: Off
Auth. Failure Events: Off
T.38 support: No
T.38 EC mode: Unknown
T.38 MaxDtgrm: 4294967295
SIP realtime: Enabled
Qualify Freq : 30000 ms
Q.850 Reason header: No
Store SIP_CAUSE: No

Network QoS Settings:

IP ToS SIP: CS0
IP ToS RTP audio: CS0
IP ToS RTP video: CS0
IP ToS RTP text: CS0
802.1p CoS SIP: 4
802.1p CoS RTP audio: 5
802.1p CoS RTP video: 6
802.1p CoS RTP text: 5
Jitterbuffer enabled: No

Network Settings:

SIP address remapping: Disabled, no localnet list
Externhost:
Externaddr: (null)
Externrefresh: 10

Global Signalling Settings:

Codecs: (ulaw|alaw|gsm|h263)
Relax DTMF: No
RFC2833 Compensation: No
Symmetric RTP: No
Compact SIP headers: No
RTP Keepalive: 0 (Disabled)
RTP Timeout: 0 (Disabled)
RTP Hold Timeout: 0 (Disabled)
MWI NOTIFY mime type: application/simple-message-summary
DNS SRV lookup: Yes
Pedantic SIP support: Yes
Reg. min duration 60 secs
Reg. max duration: 3600 secs
Reg. default duration: 120 secs
Sub. min duration 60 secs
Sub. max duration: 3600 secs
Outbound reg. timeout: 20 secs
Outbound reg. attempts: 0
Outbound reg. retry 403:No
Notify ringing state: Yes
Include CID: Yes
Notify hold state: No
SIP Transfer mode: open
Max Call Bitrate: 384 kbps
Auto-Framing: Yes
Outb. proxy:
Session Timers: Refuse
Session Refresher: uas
Session Expires: 1800 secs
Session Min-SE: 90 secs
Timer T1: 500
Timer T1 minimum: 100
Timer B: 32000
No premature media: Yes
Max forwards: 70

Default Settings:

Allowed transports: UDP
Outbound transport: UDP
Context: REP 02
Record on feature: automon
Record off feature: automon
Force rport: Auto (No)
DTMF: rfc2833
Qualify: 0
Keepalive: 0
Use ClientCode: No
Progress inband: No
Language: en
Tone zone:
MOH Interpret: default
MOH Suggest:
Voice Mail Extension: asterisk
RTCP Multiplexing: No

Realtime SIP Settings:

Realtime Peers: Yes
Realtime Regs: No
Cache Friends: Yes
Update: Yes
Ignore Reg. Expire: No
Save sys. name: Yes
Save path header: No
Auto Clear: 120 (Disabled)

Cisco SPA122 return when receiving the call sometimes “SIP/2.0 401 Unauthorized”

401 is not an error, in itself.

The fact that you are getting this makes me think that the Contact address is correct and your system’s IP address is unstable.

I’d certainly agree that Asterisk is getting the address from somewhere int your system configuration.

1 Like

Hi,

I’ve configured the static ip address with the “interfaces” file on Raspberry and I’ve disactivated dhcpcd, to have only one ip address active :

EXAMPLE:

auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.1

I’ve solved forcing in the library of the app the value Route with the destination server. Thanks.