}
return 0;
}
- /* Initialize the context if it hasn't been already */
+ gotdest = get_destination(p, NULL);
+ /* Initialize the context if it hasn't been already;
+ note this is done _after_ handling any domain lookups,
+ because the context specified there is for calls, not
+ subscriptions
+ */
if (!ast_strlen_zero(p->subscribecontext))
ast_copy_string(p->context, p->subscribecontext, sizeof(p->context));
else if (ast_strlen_zero(p->context))
strcpy(p->context, default_context);
/* Get destination right away */
- gotdest = get_destination(p, NULL);
build_contact(p);
if (gotdest) {
if (gotdest < 0)
p = channel;
p = strchr (p, 'X');
if (p)
- fprintf (f, "%.*s%c%s\n", p - channel, channel, subaddress, p + 1);
+ fprintf (f, "%.*s%c%s\n", (int)(p - channel), channel, subaddress, p + 1);
else
fprintf (f, "%s\n", channel);
}
{
p = strchr (callerid, 'X');
if (p)
- fprintf (f, "%.*s%c%s", p - callerid, callerid, subaddress, p + 1);
+ fprintf (f, "%.*s%c%s", (int)(p - callerid), callerid, subaddress, p + 1);
else
fprintf (f, "%s", callerid);
}