different operators eg mblox, m-qube need different TLV parameters.
I really dislike maintaining a different version kannel for each,
Ideally if I had the time, this whole kannel be written in c++,then these issues are
taken care of by inheritance.
 
but as it is my solution is for example
 
#define TLV_NULTERMINATED(vendor, name, max_len)
 
eg
void smpp_pdu_dump(SMPP_PDU *pdu)
{
..............................
    #define TLV_NULTERMINATED(vendor, name, max_len) \
        if ((p->name._vendor ==_VENDOR_NA || p->name._vendor==g_vendorId ) && p->name._name != NULL) { \
   octstr_dump_short(p->name._name, 2, #name);\
        }
........................
in smpp_pdu.def there is like
.....
    TLV_NULTERMINATED(_VENDOR_MQUBE,mqube_carrierId, 45)
    TLV_NULTERMINATED(_VENDOR_MBLOX,mblox_operator,100)
    TLV_NULTERMINATED(_VENDOR_NA,receipted_message_id, 65)         << applicable to all vendors
 
 
 


 
so there is a global variable g_vendorId  which is configured.
 
In practice this is working out well I think.....
 
any comments please? bag it or whatever............. J
 

Reply via email to