# HG changeset patch # User Ethan Blanton # Date 1132718429 0 # Node ID 2f379ed0c26b423f4277829413ce899b89390419 # Parent d040123d2b69d059a960bf7977d6aececd12289c [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 diff -r d040123d2b69 -r 2f379ed0c26b src/protocols/simple/simple.c --- 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: ;tag=%s\r\n" diff -r d040123d2b69 -r 2f379ed0c26b src/protocols/simple/simple.h --- a/src/protocols/simple/simple.h Wed Nov 23 02:04:59 2005 +0000 +++ b/src/protocols/simple/simple.h Wed Nov 23 04:00:29 2005 +0000 @@ -81,6 +81,7 @@ int connecting; GaimAccount *account; gchar *sendlater; + gchar *regcallid; GSList *transactions; GSList *watcher; GSList *openconns;