Outbound proxy request option is not valid

Hello.
I am having 1 issue when I try to register SIP trunk.
My SIP provider uses outbound proxy as well as sip server.
I am using pjsip and in pjsip settings I added outbound proxy. But were unable to register the SIP.

On log, there is an error message.

[2022-11-21 06:14:36] ERROR[9531] res_pjsip.c: Unable to apply outbound proxy on request OPTIONS to endpoint Mobicom_trunk as outbound proxy URI ‘202.131.248.20’ is not valid
[2022-11-21 06:14:36] ERROR[9531] res_pjsip/pjsip_options.c: Unable to create request to qualify contact sip:[email protected]:5060 on AOR Mobicom_trunk

I must be missing something in the config.
I’ve already added the outbound proxy ip to the firewall and intrusion detection.
Thank you

Outbound Proxy:
sip:202.131.248.20\;lr\;hide

1 Like

Thank you for the reply.
I am new to the freepbx. I should just write this in outbound proxy field in pjsip settings, right? I never knew I could write addition commands in field. :smiley:
Thanks again.

Yes, it goes in the Outbound Proxy field for the trunk.

Can I ask you one more question? @Stewart1
When I try to call from the extension, freepbx tells that try again later. I have set up the extensions and extensions can call each other. But not calling outside number using trunk.
I have set up outbound route.

Nothing elaborate, just basics.

Here is the log while I tried to call

53 [2022-11-22 03:22:54] VERBOSE[3731] netsock2.c: Using SIP RTP Audio TOS bits 184
54 [2022-11-22 03:22:54] VERBOSE[3731] netsock2.c: Using SIP RTP Audio TOS bits 184 in TCLASS field.
55 [2022-11-22 03:22:54] VERBOSE[3731] netsock2.c: Using SIP RTP Audio CoS mark 5
56 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] Macro(“PJSIP/202-0000002f”, “user-callerid,LIMIT,EXTERNAL,”) in new stack
57 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] Set(“PJSIP/202-0000002f”, “TOUCH_MONITOR=1669087374.48”) in new stack
58 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] Set(“PJSIP/202-0000002f”, “CHANCONTEXT=”) in new stack
59 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] Set(“PJSIP/202-0000002f”, “CHANCONTEXT=”) in new stack
60 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:4] Set(“PJSIP/202-0000002f”, “CHANEXTENCONTEXT=202-0000002f”) in new stack
61 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:5] Set(“PJSIP/202-0000002f”, “CHANEXTEN=202-0000002f”) in new stack
62 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:6] Set(“PJSIP/202-0000002f”, “CALLERID(number)=202”) in new stack
63 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:7] Set(“PJSIP/202-0000002f”, “AMPUSER=202”) in new stack
64 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:8] Set(“PJSIP/202-0000002f”, “HOTDESCKCHAN=202-0000002f”) in new stack
65 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:9] Set(“PJSIP/202-0000002f”, “HOTDESKEXTEN=202”) in new stack
66 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:10] Set(“PJSIP/202-0000002f”, “HOTDESKCALL=0”) in new stack
67 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:11] ExecIf(“PJSIP/202-0000002f”, “0?Set(HOTDESKCALL=1)”) in new stack
68 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:12] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(name)=)”) in new stack
69 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:13] GotoIf(“PJSIP/202-0000002f”, “0?report”) in new stack
70 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:14] ExecIf(“PJSIP/202-0000002f”, “1?Set(REALCALLERIDNUM=202)”) in new stack
71 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:15] Set(“PJSIP/202-0000002f”, “AMPUSER=202”) in new stack
72 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:16] GotoIf(“PJSIP/202-0000002f”, “0?limit”) in new stack
73 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:17] Set(“PJSIP/202-0000002f”, “AMPUSERCIDNAME=202”) in new stack
74 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:18] ExecIf(“PJSIP/202-0000002f”, “0?Set(__CIDMASQUERADING=TRUE)”) in new stack
75 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:19] GotoIf(“PJSIP/202-0000002f”, “0?report”) in new stack
76 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:20] Set(“PJSIP/202-0000002f”, “AMPUSERCID=202”) in new stack
77 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:21] Set(“PJSIP/202-0000002f”, “__DIAL_OPTIONS=HhTtr”) in new stack
78 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:22] Set(“PJSIP/202-0000002f”, “CALLERID(all)=“202” <202>”) in new stack
79 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:23] ExecIf(“PJSIP/202-0000002f”, “0?Set(CUSDIAL=)”) in new stack
80 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:24] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(all)=“202” <202>)”) in new stack
81 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:25] GotoIf(“PJSIP/202-0000002f”, “0?limit”) in new stack
82 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:26] ExecIf(“PJSIP/202-0000002f”, “1?Set(GROUP(concurrency_limit)=202)”) in new stack
83 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:27] ExecIf(“PJSIP/202-0000002f”, “0?Set(CHANNEL(language)=)”) in new stack
84 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:28] NoOp(“PJSIP/202-0000002f”, “Macro Depth is 1”) in new stack
85 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:29] GotoIf(“PJSIP/202-0000002f”, “1?report2:macroerror”) in new stack
86 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (macro-user-callerid,s,30)
87 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:30] GotoIf(“PJSIP/202-0000002f”, “1?continue”) in new stack
88 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (macro-user-callerid,s,49)
89 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:49] Set(“PJSIP/202-0000002f”, “CALLERID(number)=202”) in new stack
90 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:50] Set(“PJSIP/202-0000002f”, “CALLERID(name)=202”) in new stack
91 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:51] GotoIf(“PJSIP/202-0000002f”, “0?cnum”) in new stack
92 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:52] Set(“PJSIP/202-0000002f”, “CDR(cnam)=202”) in new stack
93 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:53] Set(“PJSIP/202-0000002f”, “CDR(cnum)=202”) in new stack
94 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:54] Set(“PJSIP/202-0000002f”, “CHANNEL(language)=en_GB”) in new stack
95 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] Gosub(“PJSIP/202-0000002f”, “sub-record-check,s,1(out,99039166,dontcare)”) in new stack
96 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] GotoIf(“PJSIP/202-0000002f”, “0?initialized”) in new stack
97 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] Set(“PJSIP/202-0000002f”, “__REC_STATUS=INITIALIZED”) in new stack
98 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] Set(“PJSIP/202-0000002f”, “NOW=1669087374”) in new stack
99 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:4] Set(“PJSIP/202-0000002f”, “__DAY=22”) in new stack
100 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:5] Set(“PJSIP/202-0000002f”, “__MONTH=11”) in new stack
101 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:6] Set(“PJSIP/202-0000002f”, “__YEAR=2022”) in new stack
102 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:7] Set(“PJSIP/202-0000002f”, “__TIMESTR=20221122-032254”) in new stack
103 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:8] Set(“PJSIP/202-0000002f”, “__FROMEXTEN=202”) in new stack
104 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:9] Set(“PJSIP/202-0000002f”, “__MON_FMT=wav”) in new stack
105 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:10] NoOp(“PJSIP/202-0000002f”, “Recordings initialized”) in new stack
106 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:11] ExecIf(“PJSIP/202-0000002f”, “0?Set(ARG3=dontcare)”) in new stack
107 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:12] Set(“PJSIP/202-0000002f”, “REC_POLICY_MODE_SAVE=”) in new stack
108 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:13] ExecIf(“PJSIP/202-0000002f”, “0?Set(REC_STATUS=NO)”) in new stack
109 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:14] GotoIf(“PJSIP/202-0000002f”, “3?checkaction”) in new stack
110 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (sub-record-check,s,17)
111 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:17] GotoIf(“PJSIP/202-0000002f”, “1?sub-record-check,out,1”) in new stack
112 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (sub-record-check,out,1)
113 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/202-0000002f”, “Outbound Recording Check from 202 to 99039166”) in new stack
114 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] Set(“PJSIP/202-0000002f”, “RECMODE=dontcare”) in new stack
115 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] ExecIf(“PJSIP/202-0000002f”, “1?Goto(routewins)”) in new stack
116 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (sub-record-check,out,7)
117 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:7] Gosub(“PJSIP/202-0000002f”, “recordcheck,1(dontcare,out,99039166)”) in new stack
118 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/202-0000002f”, “Starting recording check against dontcare”) in new stack
119 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] Goto(“PJSIP/202-0000002f”, “dontcare”) in new stack
120 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (sub-record-check,recordcheck,3)
121 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] Return(“PJSIP/202-0000002f”, “”) in new stack
122 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:8] Return(“PJSIP/202-0000002f”, “”) in new stack
123 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] ExecIf(“PJSIP/202-0000002f”, “0 ?Set(CDR(accountcode)=)”) in new stack
124 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:4] Set(“PJSIP/202-0000002f”, “_ROUTEID=2”) in new stack
125 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:5] Set(“PJSIP/202-0000002f”, “_ROUTENAME=Default”) in new stack
126 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:6] Set(“PJSIP/202-0000002f”, “MOHCLASS=default”) in new stack
127 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:7] ExecIf(“PJSIP/202-0000002f”, “1?Set(TRUNKCIDOVERRIDE=75058383)”) in new stack
128 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:8] Set(“PJSIP/202-0000002f”, “_CALLERIDNAMEINTERNAL=202”) in new stack
129 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:9] Set(“PJSIP/202-0000002f”, “_CALLERIDNUMINTERNAL=202”) in new stack
130 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:10] Set(“PJSIP/202-0000002f”, “_EMAILNOTIFICATION=FALSE”) in new stack
131 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:11] Set(“PJSIP/202-0000002f”, “_NODEST=”) in new stack
132 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:12] Macro(“PJSIP/202-0000002f”, “dialout-trunk,1,99039166,off”) in new stack
133 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] Set(“PJSIP/202-0000002f”, “DIAL_TRUNK=1”) in new stack
134 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] ExecIf(“PJSIP/202-0000002f”, “0?Set(DIAL_OPTIONS=Hhtr)”) in new stack
135 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] GosubIf(“PJSIP/202-0000002f”, “0?sub-pincheck,s,1()”) in new stack
136 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:4] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(num)=202)”) in new stack
137 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:5] GotoIf(“PJSIP/202-0000002f”, “0?disabletrunk,1”) in new stack
138 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:6] Set(“PJSIP/202-0000002f”, “DIAL_NUMBER=99039166”) in new stack
139 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:7] Set(“PJSIP/202-0000002f”, “DIAL_TRUNK_OPTIONS=HhTtr”) in new stack
140 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:8] Set(“PJSIP/202-0000002f”, “OUTBOUND_GROUP=OUT_1”) in new stack
141 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:9] Set(“PJSIP/202-0000002f”, “DIAL_TRUNK_OPTIONS=T”) in new stack
142 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:10] GotoIf(“PJSIP/202-0000002f”, “1?nomax”) in new stack
143 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (macro-dialout-trunk,s,12)
144 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:12] GotoIf(“PJSIP/202-0000002f”, “0?skipoutcid”) in new stack
145 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:13] Macro(“PJSIP/202-0000002f”, “outbound-callerid,1”) in new stack
146 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] NoOp(“PJSIP/202-0000002f”, “202”) in new stack
147 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:2] NoOp(“PJSIP/202-0000002f”, “”) in new stack
148 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:3] NoOp(“PJSIP/202-0000002f”, “off”) in new stack
149 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:4] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(name-pres)=)”) in new stack
150 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:5] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(num-pres)=)”) in new stack
151 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:6] Set(“PJSIP/202-0000002f”, “HOTDESCKCHAN=202-0000002f”) in new stack
152 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:7] Set(“PJSIP/202-0000002f”, “HOTDESKEXTEN=202”) in new stack
153 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:8] Set(“PJSIP/202-0000002f”, “HOTDESKCALL=0”) in new stack
154 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:9] ExecIf(“PJSIP/202-0000002f”, “0?Set(HOTDESKCALL=1)”) in new stack
155 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:10] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(name)=)”) in new stack
156 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:11] Set(“PJSIP/202-0000002f”, “ALLOWTHISROUTE=NO”) in new stack
157 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:12] ExecIf(“PJSIP/202-0000002f”, “0?Set(ALLOWTHISROUTE=YES)”) in new stack
158 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:13] ExecIf(“PJSIP/202-0000002f”, “0?Hangup()”) in new stack
159 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:14] ExecIf(“PJSIP/202-0000002f”, “0?Set(REALCALLERIDNUM=202)”) in new stack
160 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:15] ExecIf(“PJSIP/202-0000002f”, “0?Set(AMPUSER=202)”) in new stack
161 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:16] GotoIf(“PJSIP/202-0000002f”, “1?normcid”) in new stack
162 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (macro-outbound-callerid,s,20)
163 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:20] Set(“PJSIP/202-0000002f”, “USEROUTCID=75058383”) in new stack
164 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:21] Set(“PJSIP/202-0000002f”, “EMERGENCYCID=”) in new stack
165 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:22] ExecIf(“PJSIP/202-0000002f”, “0?Set(SCDEXT=YES)”) in new stack
166 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:23] ExecIf(“PJSIP/202-0000002f”, “0?Set(EMERGENCYCID=)”) in new stack
167 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:24] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(name)=)”) in new stack
168 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:25] ExecIf(“PJSIP/202-0000002f”, “0?Set(EMERGENCYCID=)”) in new stack
169 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:26] Set(“PJSIP/202-0000002f”, “TRUNKOUTCID=75058383”) in new stack
170 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:27] GotoIf(“PJSIP/202-0000002f”, “1?trunkcid”) in new stack
171 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (macro-outbound-callerid,s,33)
172 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:33] ExecIf(“PJSIP/202-0000002f”, “1?Set(CALLERID(all)=75058383)”) in new stack
173 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:34] ExecIf(“PJSIP/202-0000002f”, “1?Set(CALLERID(all)=75058383)”) in new stack
174 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:35] ExecIf(“PJSIP/202-0000002f”, “1?Set(CALLERID(all)=75058383)”) in new stack
175 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:36] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(all)=202)”) in new stack
176 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:37] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(all)=202)”) in new stack
177 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:38] Set(“PJSIP/202-0000002f”, “TIOHIDE=no”) in new stack
178 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:39] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(name-pres)=prohib_passed_screen)”) in new stack
179 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:40] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(num-pres)=prohib_passed_screen)”) in new stack
180 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:41] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(name-pres)=prohib_passed_screen)”) in new stack
181 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:42] ExecIf(“PJSIP/202-0000002f”, “0?Set(CALLERID(num-pres)=prohib_passed_screen)”) in new stack
182 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:43] Set(“PJSIP/202-0000002f”, “CDR(outbound_cnum)=75058383”) in new stack
183 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:44] Set(“PJSIP/202-0000002f”, “CDR(outbound_cnam)=”) in new stack
184 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:14] GosubIf(“PJSIP/202-0000002f”, “1?sub-flp-1,s,1()”) in new stack
185 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] ExecIf(“PJSIP/202-0000002f”, “1?Return()”) in new stack
186 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:15] Set(“PJSIP/202-0000002f”, “OUTNUM=99039166”) in new stack
187 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:16] Set(“PJSIP/202-0000002f”, “custom=PJSIP”) in new stack
188 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:17] ExecIf(“PJSIP/202-0000002f”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default)T)”) in new stack
189 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:18] ExecIf(“PJSIP/202-0000002f”, “0?Set(DIAL_TRUNK_OPTIONS=TM(confirm))”) in new stack
190 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:19] GotoIf(“PJSIP/202-0000002f”, “1?gocall”) in new stack
191 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx_builtins.c: Goto (macro-dialout-trunk,s,21)
192 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:21] Macro(“PJSIP/202-0000002f”, “dialout-trunk-predial-hook,”) in new stack
193 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:1] MacroExit(“PJSIP/202-0000002f”, “”) in new stack
194 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:22] GotoIf(“PJSIP/202-0000002f”, “0?skipcrm”) in new stack
195 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:23] Set(“PJSIP/202-0000002f”, “__CRM_DIRECTION=OUTBOUND”) in new stack
196 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:24] Set(“PJSIP/202-0000002f”, “__CRM_DESTINATION=99039166”) in new stack
197 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:25] Set(“PJSIP/202-0000002f”, “__CRM_SOURCE=202”) in new stack
198 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:26] AGI(“PJSIP/202-0000002f”, “agi://127.0.0.1/sangomacrm.agi”) in new stack
199 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] res_agi.c: <PJSIP/202-0000002f>AGI Script agi://127.0.0.1/sangomacrm.agi completed, returning 0
200 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:27] Set(“PJSIP/202-0000002f”, “CHANNEL(hangup_handler_push)=crm-hangup,s,1”) in new stack
201 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:28] NoOp(“PJSIP/202-0000002f”, “CRM Finished”) in new stack
202 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:29] GotoIf(“PJSIP/202-0000002f”, “0?bypass,1”) in new stack
203 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]ut-trunk:30] ExecIf(“PJSIP/202-0000002f”, “1?Set(CONNECTEDLINE(num,i)=99039166)”) in new stack
204 [2022-11-22 03:22:54] VERBOSE[3859][C-00000016] pbx.c: Executing [[email protected]:31] ExecIf(“PJSIP/202-0000002f”, “1?Set(CONNECTEDLINE(name,i)=CID:75058383)”) in new stack

Thank you.

The log that you posted ends before Asterisk attempted to dial on the trunk. A SIP trace would also be useful, as it’s likely that Mobicom rejected the call.

At the Asterisk command prompt, type
pjsip set logger on
make a failing test call, paste the Asterisk log for the call at pastebin.freepbx.org and post the link here. If you are too new to post links, just post the last eight hex digits of the URL.

@Stewart1
Here is the link. Thanks again

Error - FreePBX Pastebin

On line 305:
5065 SIP/2.0 403 Forbidden
Mobicom rejected the call. Unfortunately, they don’t include a header telling why.

In the trunk settings, try setting From Domain to mobileoffice.mn and setting From User to the same value that you have in Username. It’s possible that it will get further but the call will fail for another reason. If so and you can’t figure out what’s wrong, paste another log.

If you still get a 403 error on the initial INVITE, try +97675058383 or +97675058383202 for From User.

@Stewart1
It worked like a charm. Thank you.
One last thing. Could you recommend any study material for free pbx?
I need to set this freepbx to be accessible from internet and configure IVR.

Crosstalk Solutions has a highly acclaimed series of “FreePBX 101” videos; see

If you prefer written documentation, you might start from Dashboard - Documentation
especially the module descriptions such as Trunks Module - PBX GUI - Documentation .