Area code being prepended

(D E) #1


Can anyone tell from this log where the area code is being prepended? Thank you!

At line 132 01203 gets prepended to 08453300111 and I’m not sure why!


(Tom Ray) #2

What do your Outbound Routes tell you because that’s where it is happening. That or in the trunk.


Do you have a prefix set on that trunk?

(D E) #4

Thanks guys - nothing (AFAICS) is telling the call to be prepended with 01203 in either outbound routes or trunk. HOWEVER, Sipgate does have an ‘automatic area code’ “feature” which is turned on and that is set to 01203. I am wondering if it’s a bug with Sipgate, there have been others…

thank you

(Lorne Gaetz) #5

This is a common mistake we all make when we first start reading Asterisk logs, looking at log line 132, you see:

[2021-04-01 09:53:31]   VERBOSE[17042][C-00001ac5]  pbx.c: Executing [s@sub-flp-1:1] ExecIf("PJSIP/22-00001a1f", "0?Set(TARGET_FLP_1=0120308453300111)") in new stack       

We can see that this is an ExecIf application, which is similar to GosubIf, GotoIf, etc., in that these applications require a condition, the condition will evaluate to 0 (false) or 1 (true). What happens will depend on the condition evaluation. After the condition is a ? character and the part the follows that is what will happen if the condition is true. After that can be an optional part with a full colon : character which defines what happens if the condition is false.

The log line above shows that the condition evaluated to false (the 0 immediately prior to the ? char), so the command following the ? was not executed. There is no further command following that to execute if the condition is true, so the end result is that line 132 basically is ignored in the call flow. Further evidence to this follows on line 168, the trunk dial is done with the original dial string and does not have the prefix.