Pound/Hash Sign Problems

I am new to asterisk from the UK and after some initial struggles I have it up and going, installed from source in conjunction with freepbx on debian etch.

I am using the system with a Linksys SPA-3102 router which connects me to the British Telecom (BT) PSTN line and for the most part this is working fine.

The problem is that some BT feature services require the use of the hash/pound/# sign.

I am using 9|. as a dial pattern to access my PSTN line via the 3102

Using asterisk -vvvvvvr and also looking at what the 3102 is doing when I dial the # asterisk sends the 3102, %23 and the 3102 dials 23 on the pstn.

So in one example im tring to dial #21# on the pstn which is a bt feature code.

So I dial 9#21# from my sip phone, asterisk sends %2321%23 to the 3102, which i see the 3102 receives and puts out onto the pstn as effectively 232123 which obviously does not work.

Having done some testing and googling i’ve started to manage to get somewhere, if i setup a dial prefix on a trunk with freepbx of ‘w#21#’ and watch the cli

I get out put as follows:

– Executing DeadAGI(“SIP/200-08209e70”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/200-08209e70”, “OUTNUM=w#44#321”) in new stack
– Executing Set(“SIP/200-08209e70”, “custom=SIP/pound”) in new stack
– Executing GotoIf(“SIP/200-08209e70”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/200-08209e70”, “SIP/pound/w#44#321|300|”) in new stac

The pound/hashes get sent as a hash not %23

The out put from a standard ‘9’ dial is:

– Executing DeadAGI(“SIP/200-08209e70”, “fixlocalprefix”) in new stack
– Launched AGI Script /var/lib/asterisk/agi-bin/fixlocalprefix
– AGI Script fixlocalprefix completed, returning 0
– Executing Set(“SIP/200-08209e70”, “OUTNUM=%2344%23”) in new stack
– Executing Set(“SIP/200-08209e70”, “custom=SIP/Incoming”) in new stack
– Executing GotoIf(“SIP/200-08209e70”, “0?customtrunk”) in new stack
– Executing Dial(“SIP/200-08209e70”, “SIP/Incoming/%2344%23|300|”) in ne

In summary what I’m trying to achieve is after i dial 9 to access my bt pstn via the 3102 is that subsequent pound/hash/# are sent as a # not as %23

Can anyone help?