rob345
October 14, 2013, 7:44pm
1
Hi,
on asterisk LTS 1.8.23 tryed to use sip.conf paramenter usereqphone = yes in order to have SIP URI user=phone added to headers: r-URI, To and From. This is added in [general] and in peer config.
but i only see it added on dest header To and r-URI, noway to have it added to From.
The From user part is a valid e.164 national number 0X…
Do I make something wrong in config or it is a known bug ?
sip.conf
…
[011xxxxxout]
type = peer
host = 10.4.0.29
domain = 172.16.1.1
fromdomain = 172.16.1.
todomain = 10.4.0.29
nat = yes
usereqphone = yes
dtmfmode = rfc2833
canreinvite = no
context = BtTrunk
insecure = invite
…
extensions.conf
…
exten => _45X.,1,Set(Calling=${CALLERID(num)})
exten => _45X.,n,Set(CALLERID(num)=011xxxxx${Calling:2})
exten => _45X.,n,SipAddHeader(P-Asserted-Identity: sip:CALLERID(num)@172.16.1.1 ;user=phone)
exten => _45X.,n,Dial(SIP/011xxxxxout/${EXTEN:2})
exten => _45X.,n,Hangup()
Reliably Transmitting (NAT) to 10.4.0.29:5060:
INVITE sip:335xxxxxxx@10.4.0.29 ;user=phone SIP/2.0
Via: SIP/2.0/UDP 172.16.1.1:5060;branch=z9hG4bK2182a5e4;rport
Max-Forwards: 70
From: “6015” sip:011xxxxxxx@172.16.1.1 ;tag=as36e554b9
To: sip:335xxxxxxx@10.4.0.29;user=phone
Contact: sip:011xxxxxxx@172.16.1.1:5060
Call-ID: 789c5a002ff0bdf37f65dda12aafa485@172.16.1.1
Seq: 102 INVITE
User-Agent: Asterisk PBX 1.8.23.0
Date: Thu, 26 Sep 2013 13:48:45 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
P-Asserted-Identity: sip:011xxxxxxx@172.16.1.1
Content-Type: application/sdp
Content-Length: 307
[ …SDP…]
I have hit the same problem here, with user=phone being added to the invite sip uri, the TO sip header but not the FROM sip header.
Did you, or anyone, have a pointer as to what causes this behaviour, and how to fix it?
I can see another old request with the same problem, but no answer, so hoping that I can get a bit more success. See User=phone in FROM header field of uri-parameter of SIP URL
Thanks in advance
Probably an oversight by the developer.
It won’t get fixed in 1.8.x as it is past end of life.
Triki
November 30, 2017, 1:11pm
4
There is a workaround until “usereqphone” variable is available for From header.
You can use fromdomain variable on your sip*.conf.
For instance:
fromuser=yourSIPuser
fromdomain=yourdomain.com ;user=phone
If you find something like this:
From: sip:yourSIPuser@yourdomain.com;user=phone:5160 ;tag=as695bc59b
You’ll have to change your Asterisk listening port for your trunk and for your extensions.
Now:
Trunk 5060
Extensions 5160
Trunk:
Edit your file for “bind” variable (in my case: pjsip.transports.conf)
Change bind=0.0.0.0:5060 to bind=0.0.0.0:5160
Extensions:
Edit your file for “bindport” variable (in my case: sip_general_additional.conf)
Change bindport=5160 to bindport=5060
Don’t forget to REGISTER your UA to new Extensions listening port (5060) and to reload these files
Now new From header will be as this (std.5060 port is avoided as is considered a well known port):
From: sip:yourSIPuser@yourdomain.com;user=phone ;tag=as695bc59b
Hope to be useful
Hi,
I need to add “user=phone” in From
I used “usereqphone=yes” but it only work at “To” Parameter
also tried “fromdomain=10.XX.XX.74;user=phone” and it worked at “To” Paramenter but “Call-ID” parameter became: “anonymous@anonymous”
so the result is “400 bad request”
How to add “user=phone” at “To” Parameter without getting bad request?