[Solved] Problems with executing ExecIf


I have problems in executing “ExecIf” in Asterisk 13.18.2 for reformat CallerID(num)

My output in log is this :

  • Executing [h@easybell:12] ExecIf(“SIP/0049283298091-00000044”, “(1?Set(CALLERID(num)=”+49283xxxxxxxxx"))")
    [Nov 13 18:49:52] ERROR[22636][C-00000026]: app_exec.c:243 execif_exec: Usage: ExecIf(?()[:(<args)])

In Extension table (I use mysql) I use :

from_trunk _. ExecIf ($["${CALLERID(num):0:2}" = “02”]?Set(CALLERID(num)="+492${CALLERID(num):2}"))

Whats wrong with this syntax ?

Regards, Daniel

The only thing I see that looks odd is your quoting the number passed into CALLERID(num), I don’t think you need or want to do that.

What exactly do you mean with extensions table, are you using realtime ?

Yes, I use realtime.

Thank you for your hint. It was the double quotes at callerid(num). Must have something to do with realtime because I tried so many examples and all did not work. I thought it is maybe a bug in execif.c