osip_message_t *info;
char dtmf_body[1000];
int i;
eXosip_lock ();
i = eXosip_call_build_info (ca->did, &info);
if (i == 0)
{
snprintf (dtmf_body, 999, "Signal=%c\r\nDuration=250\r\n", c);
osip_message_set_content_type (info, "application/dtmf-relay");
osip_message_set_body (info, dtmf_body, strlen (dtmf_body));
i = eXosip_call_send_request (ca->did, info);
}
eXosip_unlock ();
1.3 How-To send or update registrations.
eXosip2 offers a flexible API to help you to register one or several identities.
1.3.1 Initiate a registration
To start a registration, you need to build a default REGISTER request bby providing several mandatory headers
osip_message_t *reg = NULL;
int id;
int i;
eXosip_lock ();
id = eXosip_register_build_initial_register (identity, registrar,NULL,1800, ®);
if (id < 0)
{
eXosip_unlock ();
return -1;
}
osip_message_set_supported (reg, "100rel");
osip_message_set_supported(reg, "path");
i = eXosip_register_send_register (id, reg);
eXosip_unlock ();
return i;
The returned element of eXosip_register_build_initial_register is the registration identifier that you can use to
update your registration. In future events about this registration, you'll see that registration identifier when
applicable.
评论2