Mercurial > pidgin.yaz
diff src/protocols/simple/simple.c @ 12196:2f379ed0c26b
[gaim-migrate @ 14498]
This patch from Thomas Butter fixes some Asterisk compatability issues
with SIMPLE. Thanks to Cosimo Alfarano for finding this problem and
testing the changes.
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Wed, 23 Nov 2005 04:00:29 +0000 |
parents | cbebda5f019c |
children | 4d3119205a33 |
line wrap: on
line diff
--- a/src/protocols/simple/simple.c Wed Nov 23 02:04:59 2005 +0000 +++ b/src/protocols/simple/simple.c Wed Nov 23 04:00:29 2005 +0000 @@ -494,6 +494,10 @@ static void send_sip_request(GaimConnection *gc, gchar *method, gchar *url, gchar *to, gchar *addheaders, gchar *body, struct sip_dialog *dialog, TransCallback tc) { struct simple_account_data *sip = gc->proto_data; char *callid= dialog ? g_strdup(dialog->callid) : gencallid(); + if(!strcmp(method,"REGISTER")) { + if(sip->regcallid) callid = g_strdup(sip->regcallid); + else sip->regcallid = g_strdup(callid); + } char *auth=""; char *addh=""; gchar *branch = genbranch(); @@ -514,6 +518,10 @@ gaim_debug(GAIM_DEBUG_MISC, "simple", "header %s", auth); } + if(!sip->ip || !strcmp(sip->ip,"0.0.0.0")) { // if there was no known ip retry now + g_free(sip->ip); + sip->ip = g_strdup(gaim_network_get_public_ip()); + } buf = g_strdup_printf("%s %s SIP/2.0\r\n" "Via: SIP/2.0/%s %s:%d;branch=%s\r\n" "From: <sip:%s@%s>;tag=%s\r\n"