[asterisk-bugs] [JIRA] (ASTERISK-24370) res_pjsip/pjsip_options: OPTIONS request sent to Asterisk with no user in request is always 404'd

Matt Jordan (JIRA) noreply at issues.asterisk.org
Sun Oct 5 20:03:29 CDT 2014


     [ https://issues.asterisk.org/jira/browse/ASTERISK-24370?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Matt Jordan closed ASTERISK-24370.
----------------------------------

    Resolution: Fixed

> res_pjsip/pjsip_options: OPTIONS request sent to Asterisk with no user in request is always 404'd
> -------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-24370
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-24370
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Resources/res_pjsip
>    Affects Versions: 12.6.0, 13.0.0-beta2
>            Reporter: Matt Jordan
>            Severity: Minor
>         Attachments: ASTERISK-24370-13.diff
>
>
> Some endpoints like to send an OPTIONS request directly to Asterisk, and not to a particular user at asterisk. This ostensibly makes some sense: they just want to know if the server is around.
> {noformat}
> Index: res/res_pjsip/pjsip_options.c
> ===================================================================
> --- res/res_pjsip/pjsip_options.c	(revision 424093)
> +++ res/res_pjsip/pjsip_options.c	(working copy)
> @@ -641,7 +641,7 @@
>  
>  	if (ast_shutting_down()) {
>  		send_options_response(rdata, 503);
> -	} else if (!ast_exists_extension(NULL, endpoint->context, exten, 1, NULL)) {
> +	} else if (!ast_strlen_zero(exten) && !ast_exists_extension(NULL, endpoint->context, exten, 1, NULL)) {
>  		send_options_response(rdata, 404);
>  	} else {
>  		send_options_response(rdata, 200);
> digium-test-03*CLI> pjsip set logger on
> PJSIP Logging enabled
> <--- Received SIP request (635 bytes) from TLS:::ffff:132.177.252.58:60134 --->
> OPTIONS sip:digium-test-03.digium.sipit.net SIP/2.0
> Call-ID: 80fac3df618cfe9e143185d01ac39cf2 at 0:0:0:0:0:0:0:0
> CSeq: 113 OPTIONS
> From: "2001" <sip:2001 at digium-test-03.digium.sipit.net>;tag=94623d72
> To: "2001" <sip:2001 at digium-test-03.digium.sipit.net>
> Via: SIP/2.0/TLS 132.177.252.58:60134;branch=z9hG4bK-353937-62f29dce0a8a340a99416b0f42d91dcd
> Max-Forwards: 70
> Contact: "2001" <sip:2001 at 132.177.252.58:60134;transport=tls;registering_acc=digium-test-03_digium_sipit_net>
> User-Agent: Jitsi2.4.4997Linux
> Allow: INFO,OPTIONS,MESSAGE,BYE,REFER,SUBSCRIBE,ACK,CANCEL,PUBLISH,NOTIFY,INVITE
> Allow-Events: refer
> Content-Length: 0
> [Sep 29 09:06:15] NOTICE[9144]: res_pjsip/pjsip_options.c:642 options_on_rx_request: Looking for  in sipit
> <--- Transmitting SIP response (918 bytes) to TLS:::ffff:132.177.252.58:60134 --->
> SIP/2.0 404 Not Found
> Via: SIP/2.0/TLS 132.177.252.58:60134;rport;received=::ffff:132.177.252.58;branch=z9hG4bK-353937-62f29dce0a8a340a99416b0f42d91dcd
> Call-ID: 80fac3df618cfe9e143185d01ac39cf2 at 0:0:0:0:0:0:0:0
> From: "2001" <sip:2001 at digium-test-03.digium.sipit.net>;tag=94623d72
> To: "2001" <sip:2001 at digium-test-03.digium.sipit.net>;tag=z9hG4bK-353937-62f29dce0a8a340a99416b0f42d91dcd
> CSeq: 113 OPTIONS
> Accept: application/sdp, application/dialog-info+xml, application/simple-message-summary, application/simple-message-summary, application/pidf+xml, application/pidf+xml, application/dialog-info+xml, application/xpidf+xml, application/cpim-pidf+xml, 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
> Content-Length:  0
> {noformat}
> This is always 404'd due to the dialplan lookup failing (see NOTICE message in the above log snippet).
> If a user portion is not provided, we should probably just send a 200 ok.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list