dotnetdub
2010-Oct-10 13:46 UTC
[asterisk-users] Modifying cid.cid_name in app_parkandannounce.c
Hi List, I need to modify the callerID name of the call coming back when a parked call returns to the extension that parked it when it times out. Looking at app_parkandannounce.c /* Now place the call to the extention */ snprintf(buf, sizeof(buf), "%d", lot); memset(&oh, 0, sizeof(oh)); oh.parent_channel = chan; oh.vars = ast_variable_new("_PARKEDAT", buf); dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh); I assume (I hope not incorrectly) that I have to modify the variable chan->cid.cid_name Could one of the Asterisk gurus point me in the right direction as to how to do this? Thanks in advance Brian -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20101010/e536f2d9/attachment.htm
Stefan Schmidt
2010-Oct-11 08:11 UTC
[asterisk-users] Modifying cid.cid_name in app_parkandannounce.c
Am 10.10.10 15:46, schrieb dotnetdub:> Hi List, > > I need to modify the callerID name of the call coming back when a parked > call returns to the extension that parked it when it times out. > > Looking at app_parkandannounce.c > > /* Now place the call to the extention */ > > snprintf(buf, sizeof(buf), "%d", lot); > memset(&oh, 0, sizeof(oh)); > oh.parent_channel = chan; > oh.vars = ast_variable_new("_PARKEDAT", buf); > dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR, > dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh); > > I assume (I hope not incorrectly) that I have to modify the > variable chan->cid.cid_name > > > Could one of the Asterisk gurus point me in the right direction as to how to > do this? > > Thanks in advance > Brian > >Hello brian, this depends on your asterisk version. below 1.8 you would be fine with chan->cid.cid_name but to be honest use the buildin CALLERID(name) function would be much easier than changing this by yourself. Or just have a look how this function sets a calleridname. with 1.8 or trunk it would be chan->caller.id.name. there is also a asterisk-dev list to ask specially this questions which depends on asterisk code itself ;) best regards stefan