Tuesday, June 15, 2010

Use OTA to setup SIP profiles in NOKIA S60 Phones - Part 4

To send back OTA XML back to customer, we need a SMS gateway with XML support.
 
One example is the NOWSMS software.
 
This software provides an URL interface for our asp program to send back OTA XML via http post.
 
With more and more Nokia phones launched, we soon find that the new models require OTA PIN by default.  Untrusted SMS is just silently ignored.
 
To add PIN to our OTA SMS, we need to include two parameters in the NOWSMS URL as below.
OTAPINTYPE=USER
OTAPIN=<our specific pin>
 
We also have to revise our promotion leaflets with the PIN information. 
 
When user opens a pin-enabled SMS, the phone will prompt for a password and only after a correct pin is entered will the SIP profile be provisioned.
 

 

 

 

Tuesday, May 4, 2010

Use OTA to setup SIP profiles in NOKIA S60 Phones - Part 3

There are plenty information about OTA XML on NOKIA S60 platform in www.forum.nokia.com and there are many templates available.  However, it takes more time than expected to come up a workable one.
 
The result is as below.  It could be provisioned on most NOKIA S60 phones to register at sip-project.our-domain.com.  The AUTOREG parameter in APPID w9010 instructs the phone to register our SIP server automatically whenever possible.  It is quite important because customer will see a visual indicator on his phone.  Without it, customer might mistake a traditional IDD call as VOIP call.
 
<?xml version="1.0"?>
<!DOCTYPE wap-provisioningdoc PUBLIC "-//WAPFORUM//DTD PROV 1.0//EN"
"http://www.wapforum.org/DTD/prov.dtd">
<wap-provisioningdoc version="1.2">
 
<characteristic type="APPLICATION">
<parm name="APPID" value="w9013"/>
<parm name="PROVIDER-ID" value="Who-are-we"/>
<parm name="NAME" value="Who-are-we VoIP settings "/>
<parm name="TO-APPREF" value="SIP_appref"/>
<parm name="TO-NAPID" value="INTERNET"/>
<parm name="SMPORT" value="16384"/>
<parm name="EMPORT" value="32766"/>
<parm name="MEDIAQOS" value="46"/>
<parm name="NODTMFIB"/>
<parm name="NODTMFOOB"/>
<!-- Codec: AMR NB -->
 
    <!-- AMR NB with default values -->
    <characteristic type="CODEC">
      <parm name="MEDIASUBTYPE" value="0"/>
      <parm name="PRIORITYINDEX" value="0"/>
    </characteristic>
   
    <!-- G711 u-law with default values -->
    <characteristic type="CODEC">
      <parm name="MEDIASUBTYPE" value="4"/>
      <parm name="PRIORITYINDEX" value="1"/>
    </characteristic>
   
    <!-- G711 a-law with default values -->
    <characteristic type="CODEC">
      <parm name="MEDIASUBTYPE" value="3"/>
      <parm name="PRIORITYINDEX" value="2"/>
    </characteristic>
   
    <!-- iLBC with default values -->
    <characteristic type="CODEC">
      <parm name="MEDIASUBTYPE" value="1"/>
      <parm name="PRIORITYINDEX" value="3"/>
    </characteristic>
   
    <!-- G.729 with default values -->
    <characteristic type="CODEC">
      <parm name="MEDIASUBTYPE" value="10"/>
      <parm name="PRIORITYINDEX" value="4"/>
    </characteristic>
   
    <!-- CN Comfort noise with default values -->
    <characteristic type="CODEC">
      <parm name="MEDIASUBTYPE" value="9"/>
      <parm name="PRIORITYINDEX" value="5"/>
    </characteristic>
 
 <characteristic type="VOIPURIS">
  <parm name="TO-APPREF" value="SIP_appref"/>
  <parm name="IPVOICEMAILBOXURI" value="login-id@sip-project.our-domain.com"/>
 </characteristic>
</characteristic><!-- APPLICATION VoIP w9013 -->
 

<characteristic type="APPLICATION">
 
 <parm name="APPID" value="w9010"/>
 <parm name="NAME" value="Who-are-we"/>
 <parm name="APPREF" value="SIP_appref"/>
 <parm name="PROVIDER-ID" value="Who-are-we"/>
 <parm name="PTYPE" value="IETF"/>
 <parm name="PUID" value="login-id@sip-project.our-domain.com"/>
 <parm name="TO-NAPID" value="INTERNET"/>
 <parm name="APROTOCOL" value="UDP"/>
 <parm name="AUTOREG" value="ON"/>
 <characteristic type="APPADDR">
  <parm name="ADDR" value="sip-project.our-domain.com"/>
  <characteristic type="PORT">
   <parm name="PORTNBR" value="5060"/>
  </characteristic>
 </characteristic>
 <characteristic type="APPAUTH">
  <parm name="AAUTHNAME" value="login-id"/>
  <parm name="AAUTHSECRET" value="password"/>
  <parm name="AAUTHDATA" value="server-realm"/>
 </characteristic>
 <characteristic type="RESOURCE">
  <parm name="URI" value="sip-project.our-domain.com:5060;transport=UDP"/>
  <parm name="AAUTHNAME" value="login-id"/>
  <parm name="AAUTHSECRET" value="password"/>
  <parm name="AAUTHDATA" value="server-realm"/>
 </characteristic>
</characteristic>
 
<characteristic type="APPLICATION">
 <parm name="APPID" value="w902E"/>
 <parm name="NAME" value="NAT/FW Traversal settings"/>
 <parm name="APPREF" value="SIP_appref"/>
 <characteristic type="NW">
  <parm name="DOMAIN" value="sip-project.our-domain.com"/>
  <parm name="CRLFREFRESH"/>
 </characteristic>
 <characteristic type="NATIAP">
  <parm name="TO-NAPID" value="INTERNET"/>
  <parm name="REFRESHTCP" value="1200"/>
  <parm name="REFRESHUDP" value="28"/>
  <parm name="STUNRETRANSMIT" value="250"/>
 </characteristic>
</characteristic><!-- APPLICATION -->
 
 
</wap-provisioningdoc>
 
We soon notice an interesting thing.  Normally, a SIP client refreshes at interval to keep its registration record alive in the SIP server.  In our case, the refresh does not happen until 20 minutes after the last expiry. 
 
In NOKIA S60 phone, the refreshing logic resends the SIP requests on behalf of the client based on the value of the Expires-header or expires-parameter in the 2XX response to the refreshed SIP request as follows:
 
if (expiresIn2xxResponse > 1200)
    {
    refreshAfter = expiresIn2xxResponse-600;
    }
else
    {
    refreshAfter = expiresIn2xxResponse/2;
    }
By inspecting the server log, we find that the 50-minute TTL in SIP header from NOKIA S60 is not recognized by our SIP server which expires the registration using its default 30-minute timeout value.  The NOKIA S60 considers itself alive not until 20 minutes after its registration was forced to expire.  Once the reason found, the problem is solved easily by changing the server TTL. 
 
In our nokia.aspx, we merge the above XML with appropriate login id and password from database, preparing to send back to customer.

Monday, May 3, 2010

Use OTA to setup SIP profiles in NOKIA S60 Phones - Part 2

The proposed workflow makes sense to all parties and the project kicks off quickly.  While the marketing people takes care of the voucher production and distribution mechanism, I focus on several technical issues yet to solve.
 
Issues to be solved:
1.How to setup a SMS gateway to capture callerid and trigger the validation process.
2.Work out the OTA XML which will setup a SIP profile in S60 phones to automatically register at our VOIP service partner
3.How to send the OTA SMS back to customer
 
The first issue could be handled by NOWSMS.  It is a powerful and user-friendly SMS gateway on wintel platform.  It supports different types of SMSC via GSM modem, SMPP or HTTP interface.  We source a *SMS service provider which could reach all local mobile numbers at a good bulk pricing as well as an inbound number for our customer to send the voucher SMS.  NOWSMS easily recongizes this provider's gateway via SMPP interface. 
 
Next, we need to process the inbound sms and triggers the validation process.  It is accomplished in the '2-Way' tab of NOWSMS gateway control panel.  There, we instruct NOWSMS to invoke an ASP program upon receiving a sms and pass in two parameters: @@SENDER@@ and @@FULLSMS@@.  In the 'Received SMS Command Table', we input the below command.
 
 
When a sms is received, NOWSMS will substitue @@SENDER@@ and @@FULLSMS@@ with the callerid and the sms content which is, in our scenario, the voucher number and call the nokia.aspx.  Inside the asp, we perform some database validations on the voucher number and construct the OTA XML to send back to customer (ie the callerid).  Our campaign targets local customers due to a technical constraint.  There is chance that the OTA XML could not be sent intact to overseas mobile.  It depends on other side's local sms route.
 
* a more funny approach is to use GSM phone as the SMSC though it is for small scale deployment only.  however, we are more flexible with respect to cost and the selection of inbound number.
 
 
 
 
 

Use OTA to setup SIP profiles in NOKIA S60 Phones - Part1

I once have a project to configure NOKIA S60 phones via OTA XML.
 
The project aims to promote some NOKIA S60 models by offering tips and funny applications.  WIFI feature always looks a good candidate to explore and VOIP so happens to be a heat topic.  Soon, we get a feeling that it would be cool if customer is giving a convenient method to turn his S60 phone to a VOIP phone.
 
With support from a VOIP provider, we then shape the overall logistic.
1.Customer purchases the S60 phone is given a gift voucher among other premiums.
2.The voucher entitles customer to some free air-time and contains an unique secret code
3.From the purchased phone, he then sends a text sms to our SMSC.   The sms content is simply the secret code on the voucher. [We need to ascertain that the sms comes from a genuine customer]
4.Our SMSC,upon receiving the secret code, performs a series of validation to determine the SIP profile we shall apply to the sending phone and how much free air-time the customer entitles.
5.Then we reply an OTA XML SMS to the customer.
6.Within a short time, the customer will see a new message on his phone.  By saving the sms, his NOKIA phone instantly is given a SIP profile with related parameters properly setup.  Customer does not need to bother the overwhelming technical details.  In fact, most customers knows nothing about SIP.  [we hope he is impressed by how simple it is].
7.To make a VOIP call, he dials a number as usual but this time has to choose 'Internet Call' from the option menu. 
8.The S60 phone then guides customer to select a local WIFI connection and proceeds to dial out. [We hope he could realize VOIP saves him some IDD costs and thus appreciate the S60 phone he purchased].
 
 

Monday, April 12, 2010

Send SIP configuration via XML OTA

A more user-friendly approach to setup SIP account in NOKIA phone is sending the configuration via OTA SMS.  The sample XML below will configure the receiving phone to register at sip-domain using login:sip-account and password:sip-pwd.

After receiving this SMS, user only needs to 'Save' and it is done.

<?xml version="1.0"?>


<!DOCTYPE wap-provisioningdoc PUBLIC "-//WAPFORUM//DTD PROV 1.0//EN"

"http://www.wapforum.org/DTD/prov.dtd">

<wap-provisioningdoc version="1.2">



<characteristic type="APPLICATION">

<parm name="APPID" value="w9013"/>

<parm name="PROVIDER-ID" value="XXXX"/>

<parm name="NAME" value="XXXX VoIP settings "/>

<parm name="TO-APPREF" value="SIP_appref"/>

<parm name="TO-NAPID" value="INTERNET"/>

<parm name="SMPORT" value="16384"/>

<parm name="EMPORT" value="32766"/>

<parm name="MEDIAQOS" value="46"/>

<parm name="NODTMFIB"/>

<parm name="NODTMFOOB"/>

<!-- Codec: AMR NB -->



<!-- AMR NB with default values -->

<characteristic type="CODEC">

<parm name="MEDIASUBTYPE" value="0"/>

<parm name="PRIORITYINDEX" value="0"/>

</characteristic>



<!-- G711 u-law with default values -->

<characteristic type="CODEC">

<parm name="MEDIASUBTYPE" value="4"/>

<parm name="PRIORITYINDEX" value="1"/>

</characteristic>



<!-- G711 a-law with default values -->

<characteristic type="CODEC">

<parm name="MEDIASUBTYPE" value="3"/>

<parm name="PRIORITYINDEX" value="2"/>

</characteristic>



<!-- iLBC with default values -->

<characteristic type="CODEC">

<parm name="MEDIASUBTYPE" value="1"/>

<parm name="PRIORITYINDEX" value="3"/>

</characteristic>



<!-- G.729 with default values -->

<characteristic type="CODEC">

<parm name="MEDIASUBTYPE" value="10"/>

<parm name="PRIORITYINDEX" value="4"/>

</characteristic>



<!-- CN Comfort noise with default values -->

<characteristic type="CODEC">

<parm name="MEDIASUBTYPE" value="9"/>

<parm name="PRIORITYINDEX" value="5"/>

</characteristic>



<characteristic type="VOIPURIS">

<parm name="TO-APPREF" value="SIP_appref"/>

<parm name="IPVOICEMAILBOXURI" value="sip-account@sip-domain"/>

</characteristic>

</characteristic><!-- APPLICATION VoIP w9013 -->





<characteristic type="APPLICATION">



<parm name="APPID" value="w9010"/>

<parm name="NAME" value="XXXX"/>

<parm name="APPREF" value="SIP_appref"/>

<parm name="PROVIDER-ID" value="XXXX"/>

<parm name="PTYPE" value="IETF"/>

<parm name="PUID" value="sip-account@sip-domain"/>

<parm name="TO-NAPID" value="INTERNET"/>

<parm name="APROTOCOL" value="UDP"/>

<parm name="AUTOREG" value="ON"/>

<characteristic type="APPADDR">

<parm name="ADDR" value="sip-domain"/>

<characteristic type="PORT">

<parm name="PORTNBR" value="5060"/>

</characteristic>

</characteristic>

<characteristic type="APPAUTH">

<parm name="AAUTHNAME" value="sip-account"/>

<parm name="AAUTHSECRET" value="sip-pwd"/>

<parm name="AAUTHDATA" value="SIP-REALM"/>

</characteristic>

<characteristic type="RESOURCE">

<parm name="URI" value="sip-domain:5060;transport=UDP"/>

<parm name="AAUTHNAME" value="sip-account"/>

<parm name="AAUTHSECRET" value="sip-pwd"/>

<parm name="AAUTHDATA" value="SIP-REALM"/>

</characteristic>

</characteristic>



<characteristic type="APPLICATION">

<parm name="APPID" value="w902E"/>

<parm name="NAME" value="NAT/FW Traversal settings"/>

<parm name="APPREF" value="SIP_appref"/>

<characteristic type="NW">

<parm name="DOMAIN" value="sip-domain"/>

<parm name="CRLFREFRESH"/>

</characteristic>

<characteristic type="NATIAP">

<parm name="TO-NAPID" value="INTERNET"/>

<parm name="REFRESHTCP" value="1200"/>

<parm name="REFRESHUDP" value="28"/>

<parm name="STUNRETRANSMIT" value="250"/>

</characteristic>

</characteristic><!-- APPLICATION -->





</wap-provisioningdoc>

Friday, April 9, 2010

Use Nokia phones to make VOIP calls

Certain Nokia phones (eg E71, E66, N97, XM 56xx, etc) has a sip client built-in. We can turn the phone to a sip phone easily so as to enjoy the cost savings brought by voip technology.

How cost is saved?
In the first place, you need to find a ITSP (Internet Telephone Service Provider). There should be a number of ITSP around you already. You had better pick an ITSP which operates in country like US, HK, etc where the outgoing IDD rates are very low.

When you call from your sip-enabled nokia phone, your call is routed via internet to the ITSP which then links your call to the desired destination. With the VOIP technology, you were like making call from these countries. For example, making a call from HK to China is usually less than 15c while it is doubled in the other way round.



How to turn on the sip?

The sip configuration is usually in Tools>Settings>Connection>Sip. You just need to input the required SIP accounts and your phone is sip-enabled. Nevertheless, it could take you nothing less than a few minutes to complete the setup and some people really don't like working on the small phone keypads.

If massive rollout is required to a group of users, we can use SMS OTA to configure the phone. I'd furnish more details in another blog.


Where the nokia sip phone can be used?

Ideally, you can find free WIFI internet access which would not be too difficult nowadays.