#! /bin/sh /usr/share/dpatch/dpatch-run ## ## All lines beginning with `## DP:' are a description of the patch. ## DP: Use installed libgsm if availble @DPATCH@ --- ./channels/chan_sip.c~ 2008-04-26 04:21:47.000000000 +0100 +++ ./channels/chan_sip.c 2008-04-27 04:49:59.000000000 +0100 @@ -5540,7 +5540,7 @@ struct sip_request req; char from[256]; char to[256]; - char tmp[80]; + char tmp[80], *tmp2; char via[80]; char addr[80]; struct sip_pvt *p; @@ -5643,12 +5643,17 @@ ast_log(LOG_DEBUG, "Scheduled a registration timeout for %s id #%d \n", r->hostname, r->timeout); } - if (strchr(r->username, '@')) { + if (tmp2=strchr(r->username, '@')) { snprintf(from, sizeof(from), ";tag=%s", r->username, p->tag); if (!ast_strlen_zero(p->theirtag)) snprintf(to, sizeof(to), ";tag=%s", r->username, p->theirtag); else snprintf(to, sizeof(to), "", r->username); + + /* If the registration username contains '@', then the RHS + Is the equivalent of "fromdomain" for the registration */ + if (ast_strlen_zero(p->fromdomain)) + snprintf(p->fromdomain, sizeof(p->fromdomain), "%s", tmp2+1 ); } else { snprintf(from, sizeof(from), ";tag=%s", r->username, p->tohost, p->tag); if (!ast_strlen_zero(p->theirtag))