Newbie question on passing variables.

My device has the following variables declared :

<stateVariable sendEvents="no">
  <name>SMSText</name>
  <sendEventsAttribute>no</sendEventsAttribute>
  <dataType>string</dataType>
</stateVariable>
<stateVariable sendEvents="no">
  <name>SMSRecipientNumber</name>
  <sendEventsAttribute>no</sendEventsAttribute> 
  <dataType>string</dataType>
</stateVariable>

and an action : SendSMS

I am calling the device (currently from the Test Code page) as follows :

luup.call_action(“urn:upnp-org:serviceId:GSMControl1”,“SendSMS”,{ SMSRecipientNumber= “07855511327”, SMSText=“Test Text” },9)

In the SendSMS action I reference the variables like this :

  <name>SendSMS</name>
  <run>
  
  	luup.log('GSMControl : SMS Send : Number: ' .. SMSRecipientNumber)
	luup.log('GSMControl : SMS Send : Text:  ' .. SMSText)

This is clearly not the correct approach as the variables aren’t set.

Is this the correct approach (with whatever code changes are required) or is the whole approach flawed?

Have a look at a simple plugin to see how it is done. For example the virtual switch: MiOS Apps

If you’d like to see it without installing, you can look for “[tt]lul_settings[/tt]” in any of these:
http://wiki.micasaverde.com/index.php/Luup_Declarations
http://wiki.micasaverde.com/index.php/Luup_Somfy_Walkthrough

or visually via the “browse source” options on any plugin on http://code.mios.com, since they all do it in one form or another.