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

SourceForge.net noreply at sourceforge.net
Tue Jan 29 10:55:03 UTC 2008


Bugs item #1857636, was opened at 2007-12-24 19:11
Message generated for change (Comment added) 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.

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

>Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2008-01-29 12:55

Message:
Logged In: YES 
user_id=1275325
Originator: NO

Hi Inaki,

I went through the RFC and to e honest I'm not 100% sure that your
interpretation is the correct one. Actually the RFC seams to me a bit
ambiguous in explaining if the "not-present" node is took over by
"otherwise" if missing. Basically this is was you say - if the
"not-present" node is absent, its case will be took over by "otherwise"..

Just to clarify the case before getting into code, could you push this
question on the "sip-implementers" mailing list? "if 'Subject' is missing
and no 'not-present' is present, then the 'otherwise' must be caller? "

Thanks and regards,
Bogdan

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

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