[OpenSER-Devel] [ openser-Bugs-1857636 ] [CPL] <otherwise> not taken if not "Subject" header

SourceForge.net noreply at sourceforge.net
Tue Jan 15 17:24:00 UTC 2008


Bugs item #1857636, was opened at 2007-12-24 19:11
Message generated for change (Settings changed) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1857636&group_id=139143

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: ver devel
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Iñaki Baz (ibc_sf)
>Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: [CPL] <otherwise> not taken if not "Subject" header

Initial Comment:
The following script takes the default action if no "Subject" header exits, but it should take "otherwise" action:

<cpl>
	<incoming>
		<string-switch field="subject">
			<string contains="hello">
				<reject status="reject" reason="Subjet = hello" />
			</string>
			<otherwise>
				<location url="sip:voicemail at domain" />
					<proxy />
				</location>
			</otherwise>
		</string-switch>
	</incoming>
</cpl>


Three cases:

a) "Subject" header containing "hello": The call is rejected (ok).

b) "Subject" header doesn't contain "hello": The call is proxied to "sip:voicemail at domain" (ok).

c) No "Subject" header: default action is triggered, so CPL returns 1 and OpenSER script continues (¿?¿?¿).


RFC 3880 says:

  4.  Switches

   [...]

   The output "otherwise", which MUST be the last
   output specified if it is present, matches if no
   other condition matched.

   If no condition matches and no "otherwise" output
   was present in the script, the default script
   behavior is taken.


So I consider the actual behaviour a bug since "otherwise" should be matched when "Subject" header doesn't exist because **no other condition matched**.

Default script should not be taken since **no condition matches and "otherwise" output DOES be present**.


This issue causes a problem in case of matching a "Subject" header, since I must clone <notpresent> and <otherwise> contents and it shouldn't be necessary according to RFC.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=743020&aid=1857636&group_id=139143



More information about the Devel mailing list