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

Reply via email to