INVITE Contact: ...asterisk@..." while using fromuser=

INVITE Contact: …asterisk@…" while using fromuser=62021 in sip.conf

My INVITEs fail because my server sees “Contact:…asterisk@…” instead of something like “Contact: sip:192.168.15.224:5069” or sip:62021@192.168.15.224:5060

I’ve read that the following in sip.conf (file listing below) would place the XXXX in the Contact:
[62021]
fromuser=XXXX"

I’ve been reading and trying everything I can to make thing s work but no avail.
Thanks for any advice /suggestions as to what I should do.

Full SIP of INVITE amd response:
== Using SIP RTP CoS mark 5
Audio is at 18246
Adding codec 100002 (gsm) to SDP
Adding codec 100003 (ulaw) to SDP
Adding codec 100004 (alaw) to SDP
Adding codec 100017 (testlaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 192.168.90.50:5260:
INVITE sip:62021@192.168.90.50:5260 SIP/2.0
Via: SIP/2.0/UDP 192.168.15.224:5060;branch=z9hG4bK2333aa80
Max-Forwards: 70
From: “PH_64021_64022_00001” sip:asterisk@192.168.15.224;tag=as73103ec0
To: sip:62021@192.168.90.50:5260
Contact: sip:asterisk@192.168.15.224:5060
Call-ID: 586e61c83ba3fabf266890e149324335@192.168.15.224:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.12.1
Date: Fri, 02 Jan 2015 20:34:15 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 285

v=0
o=root 649670355 649670355 IN IP4 192.168.15.224
s=Asterisk PBX 11.12.1
c=IN IP4 192.168.15.224
t=0 0
m=audio 18246 RTP/AVP 3 0 8 101
a=rtpmap:3 GSM/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=sendrecv


<— SIP read from UDP:192.168.90.50:5260 —>
SIP/2.0 404 Not Found
Via: SIP/2.0/UDP 192.168.15.224:5060;branch=z9hG4bK2333aa80;received=192.168.15.224
From: “PH_64021_64022_00001” sip:asterisk@192.168.15.224;tag=as73103ec0
To: sip:62021@192.168.90.50:5260;tag=0024C9BC-9696-14A6-80F6-325AA8C0AA77-5593
Call-ID: 586e61c83ba3fabf266890e149324335@192.168.15.224:5060
CSeq: 102 INVITE
Content-Length: 0

; sip.conf
; Created Fri Jan 2 15:19:52 2015
; Path: /nfs/newadmin/public/users/crs/testbuddy/log/ast25icm/asterisk/sip.conf
;
[general]

    registertimeout => 3600
    defaultexpiry => 3600
    allowexternaldomains = yes
    sendrpid = yes
    rpid_update = yes               ; In certain cases, the only method by which a connected line chg ...

;
; ICM
;
register=>62021:password@192.168.90.50:5260/62021
register=>62022:password@192.168.90.50:5260/62022
register=>62023:password@192.168.90.50:5260/62023
register=>62024:password@192.168.90.50:5260/62024
register=>62025:password@192.168.90.50:5260/62025
;
; OXE
;
register=>51206:password@152.148.200.236:5060/51206
register=>51207:password@152.148.200.236:5060/51207
register=>51208:password@152.148.200.236:5060/51208
register=>51209:password@152.148.200.236:5060/51209
register=>51210:password@152.148.200.236:5060/51210
;
; ICM client sections
;
[62021]

            type=peer
            host=192.168.90.50
            port=5260
            fromuser=62021
            username=ao1icmuser64021
            callerid="ao1icmuser64021" <64021>
            insecure=invite,port

[quote=“crs”]
My INVITEs fail because my server sees “Contact:…asterisk@…” instead of something like “Contact: sip:192.168.15.224:5069” or sip:62021@192.168.15.224:5060[/quote]

Your server is broken. It should not care as long as this is a well formed SIP URI and the domain part routes to Asterisk.

fromuser should set the From header. There is no valid reason for setting the user part of the Contact header on an invite.

I don’t understand why fromuser isn’t setting the From user, unless you are dialing the IP address directly.

Strictly speaking, fromuser shouldn’t cause a 404, but some people fake 404 if they don’t recognize the caller.

My guess is your are using originate (such details are important), and therefore have no destination extension number. Local channels are the fix for most originate problems.

Thanks for the reply.
My originate command, from my log, as best I can show because it does not appear to be echoed in the CLI output, is:
asteriskCmd(64021)
‘Exten’ => ‘62022’,
‘Action’ => ‘Originate’,
‘Callerid’ => ‘PH_64021_64022_00001’,
‘Priority’ => 1,
‘Channel’ => ‘SIP/62021@192.168.90.50:5260’,
‘Timeout’ => 20000,
‘Context’ => ‘outgoing’

What gave me the idea that the “fromuser” parameter would change the INVITE’s “From” and “Contact” paramters was the following posting:
Asterisk: The Future of Telephony (2nd Edition for Asterisk 1.4), by Jim van Meggelen, Jared Smith, and Leif Madsen.

Connecting to a SIP Service Provider
Prev Chapter 4. Initial Configuration of Asterisk Next
Connecting to a SIP Service Provider

The fromuser parameter is going to affect the way our INVITE message is structured when sending the call to the provider. By setting our username in the fromuser parameter, we will modify the From: and Contact: fields of the INVITE when sending a call to the provider. This may be required by the provider if it’s using these fields as part of its authentication routine. You can see the places Asterisk modifies the header in the next two code blocks.

Without the fromuser:

Audio is at 66.135.99.122 port 18154
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.251.55.100:5060:
INVITE sip:15195915119@10.251.55.100 SIP/2.0
Via: SIP/2.0/UDP 66.135.99.122:5060;branch=z9hG4bK32469d35;rport
From: “asterisk” sip:asterisk@66.135.99.122;tag=as4975f3ff
To: sip:15195915119@10.251.55.100
Contact: sip:asterisk@66.135.99.122
Call-ID: 58e3dfb2584930cd77fe989c00986584@66.135.99.122
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Fri, 20 Apr 2007 14:59:24 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 265

With the fromuser:

Audio is at 66.135.99.122 port 11700
Adding codec 0x2 (gsm) to SDP
Adding codec 0x4 (ulaw) to SDP
Adding non-codec 0x1 (telephone-event) to SDP
Reliably Transmitting (no NAT) to 10.251.55.100:5060:
INVITE sip:15195915119@10.251.55.100 SIP/2.0
Via: SIP/2.0/UDP 66.135.99.122:5060;branch=z9hG4bK635b0b1b;rport
From: “asterisk” sip:my_unique_id@66.135.99.122;tag=as3186c1ba
To: sip:15195915119@10.251.55.100
Contact: sip:my_unique_id@66.135.99.122
Call-ID: 0c7ad6156f92e70b1fecde903550a12f@66.135.99.122
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Max-Forwards: 70
Date: Fri, 20 Apr 2007 15:00:30 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Supported: replaces
Content-Type: application/sdp
Content-Length: 265