rendered paste bodyIndex: chan_sip.c
===================================================================
--- chan_sip.c (revision 2262)
+++ chan_sip.c (working copy)
@@ -16596,8 +16596,17 @@
/* we'll issue the redirect message here */
if (!host)
{
+
char *localtmp;
+ char data[256];
+ char *scan;
+ if (!opbx_db_get("SIP/Registry", extension, data, sizeof(data))) {
+ scan = data;
+ host = strsep(&scan, ":");
+ port = strsep(&scan, ":");
+ } else {
+
opbx_copy_string(tmp, get_header(&p->initreq, "To"), sizeof(tmp));
if (!strlen(tmp))
{
@@ -16635,6 +16644,7 @@
}
}
}
+ } // else If the device is not registered
}
snprintf(p->our_contact, sizeof(p->our_contact), "Transfer <sip:%s@%s%s%s>", extension, host, port ? ":" : "", port ? port : "");
-------------------- CUT HERE