Call hangup handling and ${HASH(extension),number)}


#1

When a call is hung up there are certain actions I would like to perform. So in the appropriate context I have a hangup handler. For whatever reason, functions ${HASH(extension,number)} and ${CALLID(num)} are returning empty strings. To perform the operations I need to perform I need these values. On the other hand ${UNIQUEID} is returning a correct value for this channel. Is there someway I can use ${UNIQUEID} to the internal extension and the external callerID details, perhaps some kind of lookup? Btw, the call in question is always between an internal extension and an external number somewhere on the pstn.

Or is there someway to find out why HASH and CALLID are returning empty strings?


#2

CALLID doesn’t exist in 1.6.1.0. Did you mean CALLERID?

HASH will return an empty string if you have never stored anything with the same keys.


#3

[quote=“david55”]CALLID doesn’t exist in 1.6.1.0. Did you mean CALLERID?

HASH will return an empty string if you have never stored anything with the same keys.[/quote]

Yes, I meant to type CALLERID. I can see why they are returning blank, but is there some way to use ${UNIQUEID} to get information about the channel I’m hanging up, like extension #, etc?


#4

${CDR(…)} ??


#5

Is there anything I can do with the string value of UNIQUEID to find out what extensions/numbers are associated with that call/channel?


#6

I’m not aware of any interface within Asterisk that allows a lookup by UNIQUEID. All channel lookups need to be done by the channel name.

Obviously an external database which included it as a field could be accessed by it.

Most people who want real time information like this read back CDRs in the h extension, although you may have to set an option for this to work properly.


#7

[quote=“david55”]I’m not aware of any interface within Asterisk that allows a lookup by UNIQUEID. All channel lookups need to be done by the channel name.

Obviously an external database which included it as a field could be accessed by it.

Most people who want real time information like this read back CDRs in the h extension, although you may have to set an option for this to work properly.[/quote]

Thanks for the assistance. I’ll check this out.