[asterisk-users] asterisk call unique id in dialplan

Steve Murphy murf at parsetree.com
Tue Jul 3 14:45:38 CDT 2007


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 


More information about the asterisk-users mailing list