Index: channels/chan_gtalk.c =================================================================== --- channels/chan_gtalk.c (revision 55864) +++ channels/chan_gtalk.c (working copy) @@ -895,6 +895,7 @@ int fmt; int what; const char *n2; + char *data = NULL, *cid = NULL; if (title) n2 = title; @@ -955,9 +956,21 @@ ast_copy_string(tmp->exten, i->exten, sizeof(tmp->exten)); /* Don't use ast_set_callerid() here because it will * generate a needless NewCallerID event */ - tmp->cid.cid_num = ast_strdup(i->cid_num); - tmp->cid.cid_ani = ast_strdup(i->cid_num); - tmp->cid.cid_name = ast_strdup(i->cid_name); + if (!strcasecmp(client->name, "guest")) { + if (strchr(i->them, '/')) { + char *aux; + data = ast_strdup((char *)i->them); + aux = data; + cid = strsep(&aux, "/"); + } else + cid = i->them; + } else { + cid = client->user; + } + cid = strsep(&cid, "@"); + tmp->cid.cid_num = ast_strdup(cid); + tmp->cid.cid_ani = ast_strdup(cid); + tmp->cid.cid_name = ast_strdup(i->them); if (!ast_strlen_zero(i->exten) && strcmp(i->exten, "s")) tmp->cid.cid_dnid = ast_strdup(i->exten); tmp->priority = 1; @@ -970,6 +983,8 @@ tmp = NULL; } + if (data) + free(data); return tmp; }