[SOLVED]FXO with DTMF digits received from asterisk not work

Hi,

Am using a Welltech Lan201, keypad type rfc2833, my asterisk is also using default rfc2833, and the WellTech 3702a gateway is using the same.

When i make a call from my Lan201, say 011254722******, a local trunk in Asterisk strips off the 011254 and adds a ‘0’ zero digit then forwards the number in this format 0722****** to an FXO port on the 3702. The FXO port has extension 30501 so Asterisk dials SIP/30501 for any local call. A GSM Module is connected to this FXO port.

The problem seems to be in the 3702 in that, when calls are made, the 3702 should wait for a dial tone from the GSM, then when it gets a ring tone, it ‘pastes’ the number in the GSM console. What ts doing now, when a call is made, instead of the GSM dialing the number, it gives a dialtone and waits for a number to be dialed again which is not what i want to achieve. How do i solve this? Below is the sip debug peer info

-Kim[/quote]

if you look at the documentation for the Dial() command, there is a ‘D’ option that allows you to send DTMF to the called party before the call is bridged.

timing is going to be important, so you are going to need to experiment with pauses to allow time for an answer/dialtone depending on the device.

At one time, the digits passed but instead of passing 10 digits, it passed 7 digits only and removed the 1st 3 digits. Now ive rebooted, its not working anymore. Strangle problem.

I checked on the D option, my dial string looks like this SIP/30501. How do i use the D command efficiently?..SIP/30501,D(2)…!

something like exten => _30501.,1,Dial(SIP/30501,15,D(ww${EXTEN:5}))

should do the trick (with a little wait at the start)

[quote=“baconbuttie”]something like exten => _30501.,1,Dial(SIP/30501,15,D(ww${EXTEN:5}))

should do the trick (with a little wait at the start)[/quote]

How do i enter that using FreePBX? I created a custom SIP Trunk SIP/30501@192.168.1.90,15,D(ww${EXTEN:5}) but it gives me loud beep sound and it does not pass the digits. Surprisingly earlier on, by sheer luck i guess, the WellGate 3702 was able to pass on the digits but instead of relaying the 10 digits it relayed the last 7 digits cutting off the first 3. Strange, now its not working…what might be wrong?

This is my outgoing trunk dial plan in FreePBX;

0+NXXXXXXXX
011254|NXXXXXXXX

As you see, it removes the 011254 then adds a 0 then forward the 10 digit number as 0NXXXXXXXX. I’ve created a custom SIP trunk SIP/30501@192.168.1.90 where all calls of above plan are forward to WellGate 3702 FXO port with extension 30501. Aint working guys. am i missing out something?

i don’t use FreePBX (or AMP anymore), but in i guess you would add a custom trunk with your modified dial string, then a new route that used the custom trunk.

personally i wouldn’t both with the GUI and would add it to [from-internal-custom] in extensions_custom.conf … your preference may be different :smiley:

I tried the above, its passing 2 digits to the GSM console instead of 10 digits. Weird…eehhh

post the log fragment for the call.

Log with sip debug peer 30501 on

[quote]asterisk1*CLI>
<-- SIP read from 192.168.1.90:5060:
SIP/2.0 200 OK
From: "Analog PAP"sip:333111@192.168.1.87;tag=as674b59b3
To: sip:30501@192.168.1.90:5060;tag=c0a8015a-13c4-44be3116-176c9f-6a61
Call-ID: 3db89ae0625f478b294d0b8b55e1d218@192.168.1.87
CSeq: 102 INVITE
Via: SIP/2.0/UDP 192.168.1.87:5060;branch=z9hG4bK576a5386
Supported: replaces
User-Agent: FXSO_GW
Contact: sip:30501@192.168.1.90:5060
Content-Type: application/sdp
Content-Length: 157

v=0
o=FXSO_GW 12367 0 IN IP4 192.168.1.90
s=Audio Session
i=Audio Session
c=IN IP4 192.168.1.90
t=0 0
m=audio 16386 RTP/AVP 8
a=rtpmap:8 PCMA/8000/1

— (11 headers 8 lines)—
Found RTP audio format 8
Peer audio RTP is at port 192.168.1.90:16386
Found description format PCMA
Capabilities: us - 0x1f07ff (g723|gsm|ulaw|alaw|g726|adpcm|slin|lpc10|g729|speex|ilbc|jpeg|png|h261|h263|h263p), peer - audio=0x8 (alaw)/video=0x0 (nothing), combined - 0x8 (alaw)
Non-codec capabilities: us - 0x1 (telephone-event), peer - 0x0 (nothing), combined - 0x0 (nothing)
list_route: hop: sip:30501@192.168.1.90:5060
set_destination: Parsing sip:30501@192.168.1.90:5060 for address/port to send to
set_destination: set destination to 192.168.1.90, port 5060
Transmitting (no NAT) to 192.168.1.90:5060:
ACK sip:30501@192.168.1.90:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.87:5060;branch=z9hG4bK22bd92bb
From: “Analog PAP” sip:333111@192.168.1.87;tag=as674b59b3
To: sip:30501@192.168.1.90:5060;tag=c0a8015a-13c4-44be3116-176c9f-6a61
Contact: sip:333111@192.168.1.87
Call-ID: 3db89ae0625f478b294d0b8b55e1d218@192.168.1.87
CSeq: 102 ACK
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0
[/quote]

i was actually interested in seeing the Asterisk log

The Logs

[quote]Jul 19 17:12:40 VERBOSE[2635] logger.c: Transmitting (no NAT) to 192.168.1.90:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.90:5060;branch=z9hG4bK-44be3dba-2afd73-38bd;received=192.168.1.90
From: ;tag=c0a8015a-13c4-44be3db9-2afba2-7450
To: ;tag=as6d79bc3a
Call-ID: c0a8015a-13c4-44be3db9-2afba2-4102
CSeq: 2 REGISTER
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Expires: 60
Contact: ;expires=60
Date: Wed, 19 Jul 2006 14:12:40 GMT
Content-Length: 0


Jul 19 17:12:40 VERBOSE[2635] logger.c: Scheduling destruction of call ‘c0a8015a-13c4-44be3db9-2afba2-4102’ in 15000 ms
Jul 19 17:12:40 DEBUG[4472] app_queue.c: Device ‘SIP/30501’ changed to state ‘2’ (In use) but we don’t care because they’re not a member of any queue.
Jul 19 17:12:42 DEBUG[4466] rtp.c: Got RTCP report of 68 bytes
Jul 19 17:12:45 DEBUG[4466] channel.c: Didn’t get a frame from channel: SIP/333111-c0b6
Jul 19 17:12:45 DEBUG[4466] channel.c: Bridge stops bridging channels SIP/333111-c0b6 and SIP/30501-263c
Jul 19 17:12:45 DEBUG[4466] channel.c: Hanging up channel 'SIP/30501-263c’
Jul 19 17:12:45 DEBUG[4466] chan_sip.c: Hangup call SIP/30501-263c, SIP callid 5a311bf93c67302e032359e279d51960@192.168.1.87)
Jul 19 17:12:45 DEBUG[4466] chan_sip.c: update_call_counter(30501) - decrement call limit counter
Jul 19 17:12:45 VERBOSE[4466] logger.c: set_destination: Parsing for address/port to send to
Jul 19 17:12:45 VERBOSE[4466] logger.c: set_destination: set destination to 192.168.1.90, port 5060
Jul 19 17:12:45 VERBOSE[4466] logger.c: Reliably Transmitting (no NAT) to 192.168.1.90:5060:
BYE sip:30501@192.168.1.90:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.87:5060;branch=z9hG4bK66c43f45
From: “Analog PAP” ;tag=as480f88ac
To: ;tag=c0a8015a-13c4-44be3db8-2af5ee-529b
Contact:
Call-ID: 5a311bf93c67302e032359e279d51960@192.168.1.87
CSeq: 103 BYE
User-Agent: Asterisk PBX
Max-Forwards: 70
Content-Length: 0


Jul 19 17:12:45 DEBUG[4466] app_dial.c: Exiting with DIALSTATUS=ANSWER.
Jul 19 17:12:45 DEBUG[4466] app_macro.c: Spawn extension (macro-dialout-trunk,s,21) exited non-zero on ‘SIP/333111-c0b6’ in macro ‘dialout-trunk’
Jul 19 17:12:45 DEBUG[4466] pbx.c: Spawn extension (macro-dialout-trunk,s,21) exited non-zero on ‘SIP/333111-c0b6’
Jul 19 17:12:45 DEBUG[4473] app_queue.c: Device ‘SIP/30501’ changed to state ‘1’ (Not in use) but we don’t care because they’re not a member of any queue.
Jul 19 17:12:45 DEBUG[4466] cdr_addon_mysql.c: cdr_mysql: inserting a CDR record.
Jul 19 17:12:45 DEBUG[4466] cdr_addon_mysql.c: cdr_mysql: SQL command as follows: INSERT INTO cdr (calldate,clid,src,dst,dcontext,channel,dstchannel,lastapp,lastdata,duration,billsec,disposition,amaflags,accountcode,uniqueid) VALUES (‘2006-07-19 17:12:37’,’“Analog PAP” <333111>’,‘333111’,‘011254722636102’,‘from-internal’, ‘SIP/333111-c0b6’,‘SIP/30501-263c’,‘Dial’,‘SIP/30501|120|T’,8,7,‘ANSWERED’,3,’’,‘1153318357.5’)
Jul 19 17:12:45 DEBUG[4466] channel.c: Hanging up channel 'SIP/333111-c0b6’
Jul 19 17:12:45 DEBUG[4466] chan_sip.c: Hangup call SIP/333111-c0b6, SIP callid 6a3233bb-bc9de9a7@192.168.1.29)
Jul 19 17:12:45 DEBUG[4466] chan_sip.c: update_call_counter(333111) - decrement call limit counter
Jul 19 17:12:45 DEBUG[4474] app_queue.c: Device ‘SIP/333111’ changed to state ‘1’ (Not in use) but we don’t care because they’re not a member of any queue.
Jul 19 17:12:45 VERBOSE[2635] logger.c:
<-- SIP read from 192.168.1.90:5060:
SIP/2.0 200 OK
From: “Analog PAP”;tag=as480f88ac
To: ;tag=c0a8015a-13c4-44be3db8-2af5ee-529b
Call-ID: 5a311bf93c67302e032359e279d51960@192.168.1.87
CSeq: 103 BYE
Via: SIP/2.0/UDP 192.168.1.87:5060;branch=z9hG4bK66c43f45
Supported: replaces
User-Agent: FXSO_GW
Content-Length: 0 [/quote]

:open_mouth:

that looks like just the end of the call log. perhaps you can turn off sip debugging for now

Ok ive turned off sip debuging and this is the only output from the CLI

[quote] recordingcheck|20060719-172529|1153319129.9: Outbound recording not enabled
fixlocalprefix: Added prefix. New number: 0722636102
[/quote]

Is there something am missing out? :unamused: :frowning:

you’re a bit scant with the details. that’s the only output ?? what number are you dialling, and what are you expecting to pass to the gateway ?

Actually that’s all there is on the CLI since am using Trixbox 1.1 Let me explain the whole setup;

I’ve created an SIP extension 30501. Ive created an Outbound Trunk that will make calls of this format 072XXXXXXX or 0NNXXXXXXX. A user makes a call in this format 01125472XXXXXXX but 011254 are stripped off and replaced with a ‘0’ then passed on to the Welltech FXO port whereby a GSM Gateway is connected.

Am using rfc2833 in all my Weltech LAN201 IP phone, Welltech 3702 gateway and Asterisk. My Outbound route pattern is as follows;
0+NXXXXXXXX
011254|NXXXXXXXX

My Trunk is outgoing dial rules
011254|NXXXXXXXX
0+NXXXXXXXX

Outgoing Settings: Custom Dial String
SIP/30501

So far, the custom dial string does not relay the 10 digits to the GSM Console for some reason. The GSM instead gives a dialtone expecting a number 2 b dialled.

now i’m getting very confused. i thought the idea was to dial a number you wanted to reach. Asterisk then takes this, strips the 011254, prefixes a 0, dials SIP/30501 and plays a DTMF string of the modified number to the trunk/gateway before bridging the call.

TrixBox or not, you should see output unless there is no match. but if you’ve created the trunk and route in FreePBX it should be there.

Thank baconbuttie for this SOLUTION & moreso for your tireless assistance on this. It finally worked. The solution;

Added below extension in the [from-internal-custom] in extensions_custom.conf,

exten => _011254.,1,Dial(SIP/30501,15,D(ww0${EXTEN:6}))

Which will take any number beginning with 011254 and then dial SIP/3501. before the call is bridged (i.e. the caller and callee get connected) Dial() will then pass 0 and the extension dialled, minus the first 6 digits.

You will need to remove the line “011254|NXXXXXXXX” from the Local Calls trunk in the GUI and reload.

Kim