Cannot set From: header correctly

So i hope this is just me not configuring things correctly, but i am finding it impossible to get outbound SIP INVITE’s to contain the correct information.

I am attempting to set up a SIP trunk to my ITSP but the calls are failing with an explicit Q850 “User not Found” message. I am using asterisk 11.6.

Here is my SIP config, for obvious reasons i have masked IP address and authentication fields:

[toProvider]
type=peer
host=10.XXX.XXX.XXX
context=default
disallow=all
allow=ulaw
canreinvite=no
defaultuser=myusername
remotesecret=mysecret
fromdomain=mydomain.net

I have checked and double checked these credentials, however i dont think the problem is mismatched credentials at all. Look at the INVITES asterisk sends when using this trunk:

INVITE sip:00XXXXXXXXXX@10.XXX.XXX.XXX SIP/2.0
Via: SIP/2.0/UDP 10.ZZZ.ZZZ.ZZZ:5060;branch=z9hG4bK31e8a5d2
Max-Forwards: 70
From: "Anonymous" <sip:anonymous@anonymous.invalid>;tag=as2bf1b624
To: <sip:00XXXXXXXXXX@10.XXX.XXX.XXX>
Contact: <sip:anonymous@10.ZZZ.ZZZ.ZZZ:5060>
Call-ID: 1bcb2c0b51f9b2a736ca5f3f03c81952@mydomain.net
CSeq: 102 INVITE
User-Agent: Asterisk PBX 11.6.0
Date: Sun, 23 Feb 2014 15:59:58 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH

Again i have masked certain details for obvious reason, but this is an actual INVITE taken from a SIP debug. In the above section 00XXXXXXXXXX is the number i am calling, 10.XXX.XXX.XXX is the IP address of my providers SIP gateway (as configured in my peer definition, see above) and 10.ZZZ.ZZZ.ZZZ is my asterisk server.

You can clearly see that the From: header doesnt contain ANY of the authentication credentials i have set in the SIP config. I took these settings from the example sip.conf provided with asterisk, so i hope they are the correct ones.

Have i missed something out?

Its worth mentioning that if i change:

To this:

The INVITE changes to this:

From: "Anonymous" <sip:mysuername@anonymous.invalid>

Which is only halfway there and still results in the call failing.

You should definitely be using fromuser.

I think there is a bug report about anonymous overriding explicit settings. I would have hoped it was fixed in current versions, as it should be an easy fix and it is not that new.

David thanks for the input, shortly after i posted this i found an open bug on jira titled “fromdomain not honored” or some such. It linked back to a forum post here with a description of the exact same problem. So it looks like yes, this is a bug, and no its not been fixed. Or at least it hasnt in 11.7.

Thanks again, at least i know now its not my configuration.