Extensions_custom.conf - empty header - replace possible?

dear community,

i have the following problem:

in my dialplan i have this (old setup, i cannot change):
exten => _X.,n,Set(CALLERID(num)=${SIP_HEADER(cid)})

now i will need only this (is this possible to solve?)

if(CALLERID(num)=="")
{
exten => _X.,n,Set(CALLERID(num)=${SIP_HEADER(cid)})
}

or are possibility for that function?

currently if the CALLERID(num) will be send, then my SIP_HEADER(cid) always replace my CALLERID(num). but i only need the replacement if i get no CALLERID(num) ?

thank you so much

What is this dialplan supposed to do? There is probably a better way to accomplish your goal.

dear igaetz,

i have some custom configurerd asterisks what add via SIP_HEADER(cid),
but unfortunately the value CALLERID is now replaced even if no data is sent in the SIP HEADER(cid).

now i want do a goto or a if no SIP _HEADER(cid) will be send, that then the Set(CALLERID… will not be processed.

can you help me how do handle that?

thank you

The supported way to add custom dialplan like this is to use a dialplan hook: Hooking for fun and income

But even better, if these are calls arriving on a specific trunk that need this treatment, then you should have a special context for the trunk.

You can test for the value of CALLERID(number) before setting with a line like this:

SetIf($["CALLERID(number)"=""]?CALLERID(number)=${SIP_HEADER(cid)})

lr;dt = looks right; didn’t test

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.