Sip custom tag in Header

Hello ,

I have a issues with sip header asterisk , i need to add in header tag custom variables,
one exemple:
exten => _X.,4,SIPAddHeader(X-IdLista: 123) (123 -> this should be dynamic from result in database where number call is number that are called)
exten => _X.,5,SIPAddHeader(X-CallId: 10005) ( and this)
exten => _X.,6,SIPAddHeader(X-IdContatto: 12587) ( and this)

If use ${CALLERID(num)} function i get the cli number but i need get id or name or other data in database where the number dialed is in the database

Can help me with one function asterisk for get this data from database or any other solution.

Thanks in advance for support. … sk-DB.html

I posted an exmaple on the following thread, this could help you viewtopic.php?f=1&t=96395

Thanks for support david55, i have tried this but not supported in asterisk 1.4

i have solution for 1.4 with odbc … +func_odbc