BALANCE_PATTERN

BALANCE_PATTERN defines an obligatory prefix text, which should exit in the returned HTML page from web-server.

Read details here: Display of Balance (HTTP method).

For example, if the server returns following web-page:

<HTML>
<HEAD>
</HEAD>
<BODY>

Balance: 10.22

</BODY>
</HTML>

 

In this case prefix string is "Balance:"

And inside installer-brand.nsi you should specify:

!define BALANCE_PATTERN       "Balance:"

 

Why using of prefix string is important?

Let's assume that the server returns always only balance value without prefix string:

<HTML>
<HEAD>
</HEAD>
<BODY>

10.22

</BODY>
</HTML>

 

What happen if the server has internal problem and return following error page some time:

<HTML>
<HEAD>
</HEAD>
<BODY>

HTTP 500 Internal server error

</BODY>
</HTML>

 

The softphone will try to decode such string and find 500 as integer. User will see that his balance is 500.00

That's why it is highly recommeded to use obligatory prefix string in the response from the server.

If the softphone doesn't find such string in the response, then such response is interpreted as invalid.

 

Sending currency sign inside the response from the server

If you have softphone customers who have accounts in different currencies (USD, EUR etc), then you can send currencty sign together with balance value. So, it is displayed correctly to user.

The currency sign should be returned between obligatory prefix string and balance value itself, for example:

<HTML>
<HEAD>
</HEAD>
<BODY>

Balance: USD 10.22

</BODY>
</HTML>

In this example, currencty sign is "USD".

See BALANCE_FORMAT for details about how to display it to user.

 

Comments (0)