Re: ppg push - product-name attr.

2003-03-20 Thread Aarno Syvänen
Hi,

this is a bug in any case: Kannel should ignore attributes it does 
understand, expect in the case of fatal errors (phone number,
for instance). What specs are referring ? Kannel may even implement 
product-name ;)

And, of course, all testing tools are good. Even better are ppg testing 
tools not written by the writer of the code itself.

Aarno

On Wednesday, March 19, 2003, at 11:39 PM, Bas A. Schulte wrote:

maybe another bug in ppg push handling. If my pap document contains a 
product-name attribute (which is valid according to the spec I saw), 
ppg fails to parse the request, this appears in the logfile:

2003-03-19 23:29:06 [14] WARNING: PPG: pap control entity erroneous, 
the request unacceptable

This piece of xml causes Kannel to fail:


http://www.wapforum.org/DTD/pap_1.0.dtd";>

...
whilst this piece works:


http://www.wapforum.org/DTD/pap_1.0.dtd";>

...
I looked through wap_push_ppg.c but boy, xml parsing in C *is* scary 
;) Not my cup of tea.

BTW, I'm not totally sure this is actually a bug, it could be 
something in a more recent version of the WAP/PAP spec. I checked in 
WAP-247-PAP-20010429-a.pdf, which tells me this is an optional 
(implied) attribute so I think Kannel should handle this.

Regards,

Bas.

ps. I'm working on a simple commandline example java app that uses 
Openwave's wap push library, freely available, might be good to add 
this is a conformance and/or alternative testing tool? Kannel PPG does 
work with the example PushIT application that comes with the lib 
because that one does not generate the product-name attribute if it's 
not filled in in the GUI. The commandline tool I'm using however uses 
the lib's SimplePush class which sets it by default and you can't 
override that (easily).







Re: ppg push - product-name attr.

2003-03-20 Thread Bas A. Schulte
Hi Aarno,

On Thursday, March 20, 2003, at 09:54 AM, Aarno Syvänen wrote:

this is a bug in any case: Kannel should ignore attributes it does 
understand, expect in the case of fatal errors (phone number,
for instance). What specs are referring ? Kannel may even implement 
product-name ;)
First the WAP 2.0 specs, document WAP-247-PAP-20010429-a.pdf 
(http://www1.wapforum.org/tech/terms.asp?doc=WAP-247-PAP-20010429-a.pdf), 
section 8.1:



The pap element specifies a set of elements that describe messages. The 
elements are tagged with "message" or
"response" suffix to make it clear when they are messages or responses 
to messages.

Attributes

product-name=CDATA

This attribute contains the name or identification of the pap handling 
application that generated the message. It
may be useful in operational compatibility between various vendor 
implementations.
I also checked the 1.2.1 specs, document WAP-164-PAP-19991108-a.pdf 
(http://www1.wapforum.org/tech/terms.asp?doc=WAP-164-PAP-19991108-a.pdf), 
section 9.1, which is exactly the same.

,To conclude, Kannel should handle this ok ;) It might of course set the 
attribute in pap result documents as well.

Regards,

Bas.





Re: ppg push - product-name attr.

2003-03-20 Thread Aarno Syvänen
Hi,

Actually Kannel baseline is 1.2 (as specified in MMS specs). But of  
course implementing product-name is useful, with it we can support  
quirks of at least some vendors.

Aarno

On Thursday, March 20, 2003, at 10:11 AM, Bas A. Schulte wrote:

On Thursday, March 20, 2003, at 09:54 AM, Aarno Syvänen wrote:

this is a bug in any case: Kannel should ignore attributes it does  
understand, expect in the case of fatal errors (phone number,
for instance). What specs are referring ? Kannel may even implement  
product-name ;)
First the WAP 2.0 specs, document WAP-247-PAP-20010429-a.pdf  
(http://www1.wapforum.org/tech/terms.asp?doc=WAP-247-PAP-20010429- 
a.pdf), section 8.1:



The pap element specifies a set of elements that describe messages.  
The elements are tagged with "message" or
"response" suffix to make it clear when they are messages or  
responses to messages.

Attributes

product-name=CDATA

This attribute contains the name or identification of the pap  
handling application that generated the message. It
may be useful in operational compatibility between various vendor  
implementations.
I also checked the 1.2.1 specs, document WAP-164-PAP-19991108-a.pdf  
(http://www1.wapforum.org/tech/terms.asp?doc=WAP-164-PAP-19991108- 
a.pdf), section 9.1, which is exactly the same.

,To conclude, Kannel should handle this ok ;) It might of course set  
the attribute in pap result documents as well.

Regards,

Bas.







Re: ppg push - product-name attr.

2003-03-20 Thread Bas A. Schulte
Hi Aarno,

On Thursday, March 20, 2003, at 11:19 AM, Aarno Syvänen wrote:

Actually Kannel baseline is 1.2 (as specified in MMS specs). But of  
course implementing product-name is useful, with it we can support  
quirks of at least some vendors.
Just to be sure, I checked the 1.2 specs as well, some story, see 
document "SPEC-PAP-19991108.pdf" 
(http://www1.wapforum.org/tech/terms.asp?doc=SPEC-PAP-19991108.pdf), 
section 9.1.

I might have some time today to see if I can find exactly where in the 
code this is handled but xml parsing in c looks really icky if you come 
from +5 years of perl and java ;)





Re: ppg push - product-name attr.

2003-03-20 Thread Stipe Tolj
> I might have some time today to see if I can find exactly where in the
> code this is handled but xml parsing in c looks really icky if you come
> from +5 years of perl and java ;)

I just doing this right now. So leave it unless you want to duplicate
work ;)

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



Re: ppg push - product-name attr.

2003-03-20 Thread Aarno Syvänen
Huh, then it is really a bug, thanks for the report.  And to Stipe for 
correcting it.

Aarno

On Thursday, March 20, 2003, at 11:50 AM, Bas A. Schulte wrote:

Hi Aarno,

On Thursday, March 20, 2003, at 11:19 AM, Aarno Syvänen wrote:

Actually Kannel baseline is 1.2 (as specified in MMS specs). But of  
course implementing product-name is useful, with it we can support  
quirks of at least some vendors.
Just to be sure, I checked the 1.2 specs as well, some story, see 
document "SPEC-PAP-19991108.pdf" 
(http://www1.wapforum.org/tech/terms.asp?doc=SPEC-PAP-19991108.pdf), 
section 9.1.

I might have some time today to see if I can find exactly where in the 
code this is handled but xml parsing in c looks really icky if you 
come from +5 years of perl and java ;)






Re: ppg push - product-name attr.

2003-03-20 Thread Stipe Tolj
Aarno Syvänen wrote:
> 
> Huh, then it is really a bug, thanks for the report.  And to Stipe for
> correcting it.

it's a bit tricky, but I'm fidling this out I guess ;)

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Bas A. Schulte
Hi,

here are two patches that solve crashing bug 
http://bugs.kannel.org/view_bug_page.php?f_id=8

First is gw/wap_push_ppg.c, in pap_request_thread. When there's no user 
involved in the request (with a trusted-pi), wapbox gets a bus error 
upon handling a push request. pap_request_thread now checks for this and 
uses the default smsc-id for routing the message.

Second is in gw/wap_push_ppg_pushuser.c, 
wap_push_ppg_pushuser_smsc_id_get references a NULL user when 
user_find_by_username returns NULL.

Patches attached.

Cheers,

Bas.



wap_push_ppg.c.patch
Description: Binary data





wap_push_ppg_pushuser.c.patch
Description: Binary data


Re: ppg push - product-name attr.

2003-03-20 Thread Stipe Tolj
ok, fix has been commited to cvs. Try using 

  $ test/test_pap 

for a quick shot.

Beware that the fix is more or less a kludge. We do parse the
'product-name' attribute of pap, but we can't "handle" it. Which means
currently the parser decides on a lower level which WAPEvent is to be
created, ie. push-message or response-message. So that we can't
"store" the product-name. It's simply parsed, but nothing happens with
it.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



Re: ppg push - product-name attr.

2003-03-20 Thread Bas A. Schulte
Stipe,

On Thursday, March 20, 2003, at 12:42 PM, Stipe Tolj wrote:

ok, fix has been commited to cvs. Try using

  $ test/test_pap 

for a quick shot.

Beware that the fix is more or less a kludge. We do parse the
'product-name' attribute of pap, but we can't "handle" it. Which means
currently the parser decides on a lower level which WAPEvent is to be
created, ie. push-message or response-message. So that we can't
"store" the product-name. It's simply parsed, but nothing happens with
it.
Just checked it with my java app and it is working now, cool ;)

I'd say the "product-name" attribute in the incoming ppg request doesn't 
seem all that important to handle in the ppg, does it? Unless somewhere 
along the line Kannel needs to special-case based on this to allow buggy 
PI's to work with Kannel's ppg ;)

Regards,

Bas.

ps. Anyone of you guys got an msisdn for me to test with? I won't be 
able to fully test my app until I have a phone on my desk that supports 
push ;(





[REQ] anyone interested on working on WTLS support?!

2003-03-20 Thread Stipe Tolj
Hi list,

Paul from Anam has done a lot of work for supporting WTLS inside
Kannel. Unfortunatly it's yet not finished.

Anyone having good SSL/TLS experience and would be willing to pick
this TODO up and comtinue Paul's work. We have a working WTLS
extention (the kwtls-1.0.3 package from 3ui, which no longer exists)
that woks. It "only" has to be addopted to Kannel's internals.

I think this would be a great benefit for Kannel in concerns of
security.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



[PATCH]ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Bas A. Schulte
Hi,

[reposted as per Stipe's request to use unified diffs and appr. subject 
line]

here are two patches that solve crashing bug 
http://bugs.kannel.org/view_bug_page.php?f_id=8

First is gw/wap_push_ppg.c, in pap_request_thread. When there's no user 
involved in the request (with a trusted-pi), wapbox gets a bus error 
upon handling a push request. pap_request_thread now checks for this and 
uses the default smsc-id for routing the message.

Second is in gw/wap_push_ppg_pushuser.c, 
wap_push_ppg_pushuser_smsc_id_get references a NULL user when 
user_find_by_username returns NULL.

Patches attached.

Cheers,

Bas.




wap_push_ppg.c.patch
Description: Binary data





wap_push_ppg_pushuser.c.patch
Description: Binary data


RE: [REQ] anyone interested on working on WTLS support?!

2003-03-20 Thread Paul Keogh
> Paul from Anam has done a lot of work for supporting WTLS inside
> Kannel. Unfortunatly it's yet not finished.

Actually, it was Nick and Yann from 3Glab...





Re: [REQ] anyone interested on working on WTLS support?!

2003-03-20 Thread Stipe Tolj
Paul Keogh wrote:
> 
> > Paul from Anam has done a lot of work for supporting WTLS inside
> > Kannel. Unfortunatly it's yet not finished.
> 
> Actually, it was Nick and Yann from 3Glab...

ups, wrong credits there. Ok:

  Paul.credits -= 100;
  Nick.credits += 100;
  Yann.credits += 100;

;))

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



Re: [PATCH]ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Stipe Tolj
Bas,

why is the 

  if (username == NULL || (octstr_str_compare(username,"") == 0)) {

  } else {

  }

necessary?!

AFAIS, wap_push_ppg_pushuser_smsc_id_get() will return NULL in case no
user is found. Ok at least it may be a performance thing not to look
into the dict hash if anyway no username is given. 

Is it because of that? Or is it really functionally necessary? I don't
see why.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



Re: [PATCH]ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Bas A. Schulte
Stipe,

On Thursday, March 20, 2003, at 01:26 PM, Stipe Tolj wrote:

why is the

  if (username == NULL || (octstr_str_compare(username,"") == 0)) {

  } else {

  }

necessary?!
If there's no user associated with the request (with "trusted-pi" = true 
and no incoming user information (no url parameters, no http basic 
auth), username gets set to "" (the NULL check might not be necessary, 
just to be safe I added it), and if there's no username to feed to 
wap_push_ppg_pushuser_smsc_id_get to work with, it doesn't make sense to 
even call it hence the check for availability of a username.


AFAIS, wap_push_ppg_pushuser_smsc_id_get() will return NULL in case no
user is found. Ok at least it may be a performance thing not to look
into the dict hash if anyway no username is given.
It actually crashes if username equals "", the code was like this:

u = user_find_by_username(username);

if ((smsc_id = forced_smsc(u)) != NULL)
return octstr_duplicate(smsc_id);
When user_find_by_username returns NULL, which is possible, forced_smsc 
does this:

return u->smsc_id;

on a NULL u hence it crashes.

In theory, only the patch to wap_push_ppg_pushuser.c is needed to 
prevent the crash. However, why bother to have pap_request_thread call 
wap_push_ppg_pushuser_smsc_id_get when you already know there is no 
username to make wap_push_ppg_pushuser_smsc_id_get do something usefull? 
Also, it allows to differentiate between the 2 situations if needed 
(e.g. logging).

But it's your call ;)

Regards,

Bas.





Re: [PATCH]ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Stipe Tolj
> In theory, only the patch to wap_push_ppg_pushuser.c is needed to
> prevent the crash. However, why bother to have pap_request_thread call
> wap_push_ppg_pushuser_smsc_id_get when you already know there is no
> username to make wap_push_ppg_pushuser_smsc_id_get do something usefull?
> Also, it allows to differentiate between the 2 situations if needed
> (e.g. logging).

yep, the fix inside wap_push_ppg_pushuser_smsc_id_get() is *definetly*
needed. Ok, with performance in mind we'll also add the if clause.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



Re: [PATCH]ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Stipe Tolj
I'd suggest this approach:

  retos = http_cgi_variable(cgivars, "smsc");
if (retos == NULL) {
/* if we have a valid username, get the user specific
routing */
if (username && octstr_length(username) > 0)
smsc_id =
wap_push_ppg_pushuser_smsc_id_get(username);
/* if there was no user specific or the user didn't
exist, 
 * then set the ppg global */
smsc_id = smsc_id ? 
smsc_id : (ppg_default_smsc ?
octstr_duplicate(ppg_default_smsc) : NULL);
} else {
smsc_id = octstr_duplicate(retos);
}
  

which means smsc_id = NULL while init and then call wap_xxx_id_get()
only if username has something usefull in it.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



Re: [PATCH]ppg push - crashing bug trusted-pi/no user

2003-03-20 Thread Bas A. Schulte
Stipe,

On Thursday, March 20, 2003, at 01:51 PM, Stipe Tolj wrote:

I'd suggest this approach:

  retos = http_cgi_variable(cgivars, "smsc");
if (retos == NULL) {
/* if we have a valid username, get the user specific
routing */
if (username && octstr_length(username) > 0)
smsc_id =
wap_push_ppg_pushuser_smsc_id_get(username);
/* if there was no user specific or the user didn't
exist,
 * then set the ppg global */
smsc_id = smsc_id ?
smsc_id : (ppg_default_smsc ?
octstr_duplicate(ppg_default_smsc) : NULL);
} else {
smsc_id = octstr_duplicate(retos);
}
which means smsc_id = NULL while init and then call wap_xxx_id_get()
only if username has something usefull in it.
Yep. that works as well. Not sure if there are other semantics involved 
when there is/isn't a user associated with the reqest. Maybe the way to 
find the default sms-c differs or should differ, that's beyond me ;)

BTW, I'd adjust the comments on the 3rd line though as this gets 
executed if we don't have a valid username as well.

Go ahead, do the right thing and close this one so we can get on with 
our work ;)





anyone tested the new 'reconnect-delay' with EMI2 links?!

2003-03-20 Thread Stipe Tolj
Hi list,

I just tried to restart our production server with a bunch of EMI/UCP
links and the new reconnect harmonized config, but *all* EMI2 links
failed to connect ;((

Anyone had the chance to test this? Seems something is wrong in here.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are



ppg test tool

2003-03-20 Thread Bas A. Schulte
Hi all,

I completed my ppg test tool based on Openwave's wap push library. It's 
java code and requires Openwave's library which is freely available in 
their Openwave SDK. All it does is behave as a PI and send a 
ServiceIndication push message to Kannel which does the usual thing in 
that case.

If anyone on here *with a working ppg setup* wants to play with it let 
me know and I'll send it to you. When it is known to actually work 
(haven't tested it with a Wap 1.2.x phone just yet), this could go in 
contrib as far as I am concerned.

It does require the latest CVS kannel as there were some issues that 
have recently been fixed in kannel. If nothing else, it can be used as 
an additional test tool for ppg (besides test/test_ppg.c).

Regards,

Bas.





Re: ppg test tool

2003-03-20 Thread Stipe Tolj
> It does require the latest CVS kannel as there were some issues that
> have recently been fixed in kannel. If nothing else, it can be used as
> an additional test tool for ppg (besides test/test_ppg.c).

and will be available in the upcoming 1.3.2 development release.

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are