Problem with Asteriks based PBX (IPTAM)

hi folks ,

I Have a problem with a voip call.
The szenario:
IPTAM PBX Version 1.4.3 Build 5991
its using an asteriks version.
i have an thaitel BYOD account und it is registred correctly.
If i dial 9 (thats to signal to use the thaitel voip acc) and then as they require 668 (66 for Thailand Country code instead of 0066 and 8 for Mobil) then i get what the logfile say below the asteriks send 0231668 instead of 668 to the sip server.
if i dial 900668 than all works fine and will transfer correct but thaitel can not handle this und the call comes to a wrong number.
So why is this ?
Here the log that shows when it goes wrong.

[quote]U 192.168.2.8:5060 -> 192.168.2.12:5060
SIP/2.0 100 Trying.
Via: SIP/2.0/UDP 192.168.2.12:5060;branch=xxxxxxxx-xxxxxxxx.
From: Kruafa sipxxxxxxx@comlink.silberwolf.local;tag=fxxxxx xxxo0.
To: sip:96687xxxxxxxx@comlink.silberwolf.local.
Call-ID: xxxxxxxx@192.168.2.12.
CSeq: 102 INVITE.
User-Agent: IPTAM PBX.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.
Supported: replaces.
Contact: sip:9668xxxxxxxx@192.168.2.8:25060.
Content-Length: 0.
.

U 192.168.2.8:25060 -> 61.90.185.175:5060
INVITE sip:0231668xxxxxxxx@byod.thaitelplus.com SIP/2.0.
Via: SIP/2.0/UDP 84.61.3.65:25060;branch=z9hG4bK2aefd4cf;rport.
From: “00xxxxxxxxxx” sip:00xxxxxxxxx@byod.thaitelplus.com;tag=as59d8d 1d5.
To: sip:0231668xxxxxxxx@byod.thaitelplus.com.
Contact: sip:002xxxxxxxxxxx@84.61.3.65:25060.
Call-ID: xxxxxxxxxxxxxxxxxxxx@byod.thaitelplus.com.
CSeq: 102 INVITE.
User-Agent: IPTAM PBX.
Max-Forwards: 70.
Date: Tue, 04 Aug 2009 10:14:48 GMT.
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY.
Supported: replaces.
P-Preferred-Identity: sip:00xxxxxxx@byod.thaitelplus.com.
Content-Type: application/sdp.
Content-Length: 258.
.
v=0.
o=root 5627 5627 IN IP4 84.61.3.65.
s=session.
c=IN IP4 84.61.3.65.
t=0 0.
m=audio 16888 RTP/AVP 8 0 101.
a=rtpmap:8 PCMA/8000.
a=rtpmap:0 PCMU/8000.
a=rtpmap:101 telephone-event/8000.
a=fmtp:101 0-16.
a=silenceSuppff - - - -.
a=ptime:20.
a=sendrecv.[/quote]
Could some one Explain
a) why asteriks is adding my city code to the number
b) where can ich change this behavior.
I think it is a problem of the dial plan or?
Like this site indicates
broadvoice.com/support_install_asterisk.html

I have found an entry that may be the source of the problem but i dont now what i have to change.

;----------------------------------------------------------------------------- ; Macro: dialout-sip-multi ; Parameter: Destination, Prefix ;----------------------------------------------------------------------------- [macro-dialout-sip-multi] exten => s,1,Set(OrigCIDNUM=${CALLERID(num)}) exten => s,n,Set(CDR(userfield)=${CDR(userfield)}S:${CALLERID(num)}\;D:9${IF($[ ${ARG1:1:3} = 231]?${ARG1:4}:${ARG1})}\;) exten => s,n,Set(GROUP(SIPTRUNK)=SIPTRUNK) exten => s,n,GotoIf($[${GROUP_COUNT(SIPTRUNK@SIPTRUNK)} > 3]?nobw) exten => s,n,AGI(clip.agi,3,${CALLERID(num)},49,231,0) exten => s,n,GotoIf($[${LEN(${SIPTRUNK})} > 0]?cont) exten => s,n,UserEvent(PSTNFallback,Cause: No default account) exten => s,n,Goto(nobw) exten => s,n(cont),GotoIf($["${CLIR}" = "1"]?clir) exten => s,n,Set(clir=${DB(CLIR/${OrigCIDNUM})}) exten => s,n,GotoIf($["${clir}" != "1"]?dial) exten => s,n(clir),GotoIf($["${CLIR_PRIVACY}" != "1"]?clir2) exten => s,n,SIPAddheader(privacy: user) exten => s,n(clir2),GotoIf($["${CLIR_ANONYMOUS}" != "1"]?clir3) exten => s,n,Set(CALLERID(name)=Anonymous) exten => s,n(clir3),GotoIf($["${CLIR_RFC3325}" != "1"]?dial) exten => s,n,SIPAddheader(Privacy: id) exten => s,n(dial),Dial(SIP/${ARG2}${ONKZ}${ARG1}@sip-acc-${SIPTRUNK},180,W) exten => s,n,Macro(dial-result) exten => s,n(nobw),Congestion exten => h,1,Noop exten => h,1,Noop

i think the line
exten => s,n,Set(CDR(userfield)=${CDR(userfield)}S:${CALLERID(num)};D:9${IF($[ ${ARG1:1:3} = 231]?${ARG1:4}:${ARG1})}:wink:
Causes the “problem” or ??
I found it in the file outgoing.inc

Any help is welcome.
PS:
sorry for my bad english :slight_smile:

thanks
Shodan

What GUI are you using ? You have in your dial plan agi’s and macro’s. You need to post your entire plan that has to do with outbound calls.