Hi how can i retrieve the call unique id of asterisk in the dialplan? I have enabled the cdr logging on a postgres database. In the table cdr each record has a field that assumes an unique id (for example: 1141628669.51) Can i retrieve this from the dialplan? For example: exten => 203,1,Answer exten => 203,2,Set(CALLERID(name)=UNIQUE_ID - ${var_name_unique_id}) exten => 203,3,Dial(SIP/203) Can i do something similar that? How can i retrieve the unique_id generated? thanks. -- /*************/ nik600 https://sourceforge.net/projects/ccmanager https://sourceforge.net/projects/nikstresser
Alexander Lopez
2007-Jun-29 13:32 UTC
[asterisk-users] asterisk call unique id in dialplan
In the top directory of your asterisk source in the doc dir there is a file that explains channel variables.
many thanks! bye On 6/29/07, Alexander Lopez <Alex.Lopez at opsys.com> wrote:> In the top directory of your asterisk source in the doc dir there is a > file that explains channel variables. > > From that file: > ${UNIQUEID} * Current call unique identifier > > BEWARE the UNIQUEID can be repeated do not use this as a primary index > on your databse. > > > >>-----Original Message----- > >>From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users- > >>bounces at lists.digium.com] On Behalf Of nik600 > >>Sent: Friday, June 29, 2007 6:07 AM > >>To: Asterisk Users Mailing List - Non-Commercial Discussion > >>Subject: [asterisk-users] asterisk call unique id in dialplan > >> > >>Hi > >> > >>how can i retrieve the call unique id of asterisk in the dialplan? > >> > >>I have enabled the cdr logging on a postgres database. > >> > >>In the table cdr each record has a field that assumes an unique id > >>(for example: 1141628669.51) > >> > >>Can i retrieve this from the dialplan? > >> > >>For example: > >> > >>exten => 203,1,Answer > >>exten => 203,2,Set(CALLERID(name)=UNIQUE_ID - ${var_name_unique_id}) > >>exten => 203,3,Dial(SIP/203) > >> > >> > >>Can i do something similar that? > >>How can i retrieve the unique_id generated? > >>thanks. > >> > >> > >>-- > >>/*************/ > >>nik600 > >>https://sourceforge.net/projects/ccmanager > >>https://sourceforge.net/projects/nikstresser > >> > >>_______________________________________________ > >>--Bandwidth and Colocation Provided by http://www.api-digital.com-- > >> > >>asterisk-users mailing list > >>To UNSUBSCRIBE or update options visit: > >> http://lists.digium.com/mailman/listinfo/asterisk-users > > _______________________________________________ > --Bandwidth and Colocation Provided by http://www.api-digital.com-- > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users >-- /*************/ nik600 https://sourceforge.net/projects/ccmanager https://sourceforge.net/projects/nikstresser
Alexander Lopez wrote:> From that file: > ${UNIQUEID} * Current call unique identifier > > BEWARE the UNIQUEID can be repeated do not use this as a primary index > on your databse.A UNIQUEID value will never be used for more than a single channel on the same server. It is a combination of the current time, and a unique call counter. It could only happen if you both restarted Asterisk and messed around with the system clock. Even then, it is extremely unlikely. However, it is possible for there to be more than one CDR record for the same unique ID. That varies depending on configuration. -- Russell Bryant Software Engineer Digium, Inc.
On Fri, 2007-06-29 at 12:06 +0200, nik600 wrote:> Hi > > how can i retrieve the call unique id of asterisk in the dialplan? > > I have enabled the cdr logging on a postgres database. > > In the table cdr each record has a field that assumes an unique id > (for example: 1141628669.51) > > Can i retrieve this from the dialplan? > > For example: > > exten => 203,1,Answer > exten => 203,2,Set(CALLERID(name)=UNIQUE_ID - ${var_name_unique_id}) > exten => 203,3,Dial(SIP/203) > > > Can i do something similar that? > How can i retrieve the unique_id generated? > thanks. > >the uniqueID field can lead you to misery and heartbreak, possibly. In some transfer situations, the uniqueID will change on the channel (via masquerading), from the start of a bridge to the end of the bridge. (for instance, using Zap phones, do an unattended transfer via a hookflash (A picks up phone, dials B, B hookflashes; gets dialtone and dials C; then B hangs up before C answers.) Right now, I don't think the CHANNEL function returns the name or uniqueID fields. Nope. Just checked. I personally would like to see name as an option, so I could fetch the channel name, and uniqueID would also be a good one. You can fetch the uniqueid field from the CDR associated with the channel, tho! See ${CDR(uniqueid)}, it was set at some point from the uniqueid field in the channel. It may hold the original uniqueID from the channel, or it might also have been updated, had it changed, depending on life, circumstances, and the phase of the moon, mayhaps, tho. murf -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/x-pkcs7-signature Size: 3239 bytes Desc: not available Url : http://lists.digium.com/pipermail/asterisk-users/attachments/20070703/25a5d725/attachment.bin