[Devel] Registrar, save and flags

Jean-Michel Foucher jean-michel.foucher at wengo.fr
Thu Aug 3 15:46:24 CEST 2006


> have you looked on this:
>    http://openser.org/docs/modules/1.1.x/registrar.html#AEN288


no, i had not.
This looks quite interesting.

>
> the supported methods (advertised during registration) are saved in 
> usrloc; when lookup() is done, a matching test will be done for the 
> request name.



- Concerning the lookup part, this is exactly what i need.
- Concerning the registration part, something is missing.

Correct me if i am wrong, the supported methods (saved in usrloc) are 
defined in pack_ci function here in modules/registrar/save.c :

/* Get methods of contact */
if (_c->methods) {
   if (parse_methods(&(_c->methods->body), &ci.methods) < 0) {
       rerrno = R_PARSE;
       LOG(L_ERR, "ERROR:usrloc:pack_ci: failed to parse "
           "contact methods\n");
       goto error;
   }
} else {
   /* check on Allow hdr */
   if (allow_parsed == 0) {
       if (m && parse_allow( m ) != -1) {
           allowed = get_allow_methods(m);
       } else {
           allowed = ALL_METHODS;
       }
       allow_parsed = 1;
   }
   ci.methods = allowed;
}

As far as i understand the code, the supported methods, advertised 
during registration, correspond to the methods written in Allow Header.

The problem is most of softphones do not write Allow Header in their 
REGISTER messages but in INVITE messages.

And i need to know as soon as a softphone registers wheter it can handle 
SUBSCRIBE, NOTIFY and MESSAGE, which is why i added FL_XXXX flags.
Then, after a lookup, i just had to apply some isflagset.

However, i have to admit method_filtering system is much more stable and 
easier to use.

All right, i'm gonna have to add an Allow header in all REGISTER messages.

Thank you for the information.

Regards,

jm


>
> Jean-Michel Foucher wrote:
>
>> Hello,
>>
>> At some point, i needed to  check if a contact could receive a 
>> MESSAGE, SUBSCRIBE or NOTIFY message.
>>
>> Therefore i needed lookup("location") to check if a contact can 
>> support them.
>>
>
>


-- 
Jean-Michel Foucher
OpenWengo, the free and multiplatform VoIP client
http://dev.openwengo.com/





More information about the Devel mailing list