[Home]

Summary:ASTERISK-25453: user_agent not set in Server header
Reporter:Ross Beer (rossbeer)Labels:
Date Opened:2015-10-08 09:20:06Date Closed:2016-07-07 07:15:50
Priority:MinorRegression?
Status:Closed/CompleteComponents:Channels/chan_pjsip
Versions:13.6.0 Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:user_agent in pjsip.conf is not propagating to the 'server' header in responses.
{noformat}
[global]
user_agent=Custom User Agent
{noformat}

{noformat}
SIP/2.0 200 OK
Via: SIP/2.0/UDP <IPADDRESS>:5060;rport=5060;received=<IPADDRESS>;branch=z9hG4bK1ed3e105
Call-ID: 3a30dacd2da58a420e184dda0d8b223f@<IPADDRESS>:5060
From: "Withheld" <sip:Withheld@<IPADDRESS>>;tag=as58d74c06
To: <sip:37.157.54.198>;tag=z9hG4bK1ed3e105
CSeq: 102 OPTIONS
Accept: application/sdp, application/dialog-info+xml, application/pidf+xml, application/dialog-info+xml, application/xpidf+xml, application/cpim-pidf+xml, application/simple-message-summary, application/pidf+xml, application/simple-message-summary, message/sipfrag;version=2.0
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REFER, MESSAGE, REGISTER
Supported: 100rel, timer, replaces, norefersub
Accept-Encoding: text/plain
Accept-Language: en
Server: Asterisk PBX 13.6.0-rc3
Content-Length:  0
{noformat}

The value is correctly being used in user-agent headers.
Comments:By: Asterisk Team (asteriskteam) 2015-10-08 09:20:07.874-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

By: Joshua C. Colp (jcolp) 2015-10-08 09:49:55.862-0500

Did you paste the complete [global] section? As it is it's invalid. It needs a "type=global" to be recognized as a global section.

By: Ross Beer (rossbeer) 2015-10-08 09:55:11.398-0500

Sorry it was just an example of how its being set, full global section is:

[global]
type=global
max_forwards=70
user_agent=<Custom User Agent>
debug=no
realm=<Custom Realm>

The realm and user_agent is working correctly, its just not being set in the 'Server:' header.

By: Rusty Newton (rnewton) 2015-11-06 09:00:59.568-0600

{quote}Sorry it was just an example of how its being set, full global section is:

[global]
type=global
max_forwards=70
user_agent=<Custom User Agent>
debug=no
realm=<Custom Realm>

The realm and user_agent is working correctly, its just not being set in the 'Server:' header.
{quote}

Again your global section example is invalid. 'realm' is not an option for the global section. realm is set in an auth section.

I'm unable to reproduce your described problem testing with latest 13 from Git - Asterisk GIT-13-506aea2

Setting user_agent in the global section correctly populates both the User Agent and Server headers.

{noformat}
<--- Transmitting SIP response (523 bytes) to UDP:10.24.18.16:5060 --->
SIP/2.0 487 Request Terminated
Via: SIP/2.0/UDP 10.24.18.16:5060;rport=5060;received=10.24.18.16;branch=z9hG4bKPjmhHcOuPaVtnVSjW2AgGSmmRaAiVg9PHp
Call-ID: -e2xHKoB4XlTjKgb7vkJuAvd8hyg11tG
From: "ALICE<6001>" <sip:ALICE@10.24.18.124>;tag=w22zundV7JYzkWnQx30dB4kvnnsnRT8F
To: <sip:6002@10.24.18.124>;tag=2fcfc6cb-291d-4385-8ef7-1831b48c186f
CSeq: 32028 INVITE
Server: MyUserAgentValue
Allow: OPTIONS, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER, REGISTER
Content-Length:  0


 == Spawn extension (from-internal, 6002, 1) exited non-zero on 'PJSIP/ALICE-00000000'
<--- Transmitting SIP request (412 bytes) to UDP:10.24.21.155:5060 --->
CANCEL sip:BOB@10.24.21.155:5060 SIP/2.0
Via: SIP/2.0/UDP 10.24.18.124:5060;rport;branch=z9hG4bKPjcec45a11-7822-482d-8183-6439a90b9818
From: "ALICE<6001>" <sip:ALICE@10.24.18.124>;tag=573aea0f-20d5-4530-9665-88897b6bfc7a
To: <sip:BOB@10.24.21.155>
Call-ID: 0a586558-4ac4-4308-a316-81a10f1eb23d
CSeq: 24341 CANCEL
Reason: Q.850;cause=0
Max-Forwards: 70
User-Agent: MyUserAgentValue
Content-Length:  0
{noformat}

and my pjsip.conf global section:

{noformat}
[global]
type=global
max_forwards=70
user_agent=MyUserAgentValue
debug=no
{noformat}

Please compare with the latest Git branch to see if the problem is resolved there or provide additional information that would lead us to reproducing the issue. Thanks!

By: Ross Beer (rossbeer) 2015-11-16 09:03:38.292-0600

In the latest GIT version the issue still persists, the below example is on a NOTIFY:


{noformat}
NOTIFY sip:<USERNAME>@<IP Address>:1051 SIP/2.0
Via: SIP/2.0/UDP <IP Address>:5060;rport;branch=z9hG4bKPjdeb29466-1ac7-4132-8dc3-b8a91573ab8f
From: <sip:asterisk@<IP Address>>;tag=fed89603-f378-4bc0-b1c7-8d2ac4409062
To: <sip:<USERNAME>@<IP Address>>
Contact: <sip:asterisk@<IP Address>:5060>
Call-ID: b93c1182-8332-4da5-88c8-a3854097e372
CSeq: 44143 NOTIFY
Subscription-State: terminated
Event: message-summary
Allow-Events: presence, dialog, message-summary, refer
Max-Forwards: 70
User-Agent: Asterisk PBX GIT-13-4f43b85M
Content-Type: application/simple-message-summary
Content-Length: 48

Messages-Waiting: no
Voice-Message: 0/0 (0/0)
{noformat}

Its also worth noting that the contact and from are not using the configured custom value.

By: Rusty Newton (rnewton) 2015-11-18 17:24:04.246-0600

Can you provide additional information on how to reproduce the issue?  There must be another configuration option or something else needed to reproduce it as I can't reproduce with what you have shown so far.



By: Asterisk Team (asteriskteam) 2015-12-03 12:00:19.535-0600

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines