Index: addons/chan_ooh323.c =================================================================== --- addons/chan_ooh323.c (revision 398520) +++ addons/chan_ooh323.c (working copy) @@ -192,6 +192,7 @@ static struct ooh323_pvt { char rtpmaskstr[120]; int rtdrcount, rtdrinterval; /* roundtripdelayreq */ int faststart, h245tunneling; /* faststart & h245 tunneling */ + int aniasdni; /* use dialed number as answering identification */ struct ooh323_pvt *next; /* Next entity */ } *iflist = NULL; @@ -220,6 +221,7 @@ struct ooh323_user{ int rtdrcount, rtdrinterval; int faststart, h245tunneling; int g729onlyA; + int aniasdni; struct ooh323_user *next; }; @@ -317,6 +319,7 @@ static int gOutgoingLimit = 1024; OOBOOL gH323Debug = FALSE; static int gTRCLVL = OOTRCLVLERR; static int gRTDRCount = 0, gRTDRInterval = 0; +static int gANIasDNI = 0; static int t35countrycode = 0; static int t35extensions = 0; @@ -545,6 +548,8 @@ static struct ooh323_pvt *ooh323_alloc(int callref pvt->capability = gCapability; memcpy(&pvt->prefs, &gPrefs, sizeof(pvt->prefs)); + pvt->aniasdni = gANIasDNI; + ast_mutex_unlock(&pvt->lock); /* Add to interface list */ ast_mutex_lock(&iflock); @@ -1845,6 +1850,9 @@ int ooh323_onReceivedSetup(ooCallData *call, Q931M p->rtdrcount = user->rtdrcount; p->rtdrinterval = user->rtdrinterval; } + + p->aniasdni = user->aniasdni; + if (user->incominglimit) user->inUse++; ast_mutex_unlock(&user->lock); } else { @@ -1873,6 +1881,9 @@ int ooh323_onReceivedSetup(ooCallData *call, Q931M ast_log(LOG_ERROR, "Could not create ast_channel\n"); return -1; } + if (p->aniasdni) { + ooCallSetCallerId(call, p->exten); + } ast_mutex_unlock(&p->lock); if (gH323Debug) @@ -2326,6 +2337,8 @@ static struct ooh323_user *build_user(const char * user->t38support = T38_FAXGW; else if (!strcasecmp(v->value, "yes")) user->t38support = T38_ENABLED; + } else if (!strcasecmp(v->name, "aniasdni")) { + user->aniasdni = ast_true(v->value); } v = v->next; } @@ -2788,6 +2801,8 @@ int reload_config(int reload) } else if (!strcasecmp(v->name, "tracelevel")) { gTRCLVL = atoi(v->value); ooH323EpSetTraceLevel(gTRCLVL); + } else if (!strcasecmp(v->name, "aniasdni")) { + gANIasDNI = ast_true(v->value); } v = v->next; }