[SOLVED] Problems entering phone number at prompt

Hi,

I’m trying to create a PSTN access point for international calls, so that I dial a local number which connects via DID to my system in England, then routes calls via my ITSP. The other part I’ve added is a check to see the call originates from my cellphone, otherwise I assume someone wants to call me so I forward to the cellphone.

However, I’m having problems with the dialplan, and I guess I’m doing something stupid, please help ???

==== URI registered with my Shanghai ITSP ====
IAX2/fromshanghai@domain.com/20

==== iax.conf ====
[fromshanghai]
type=user
disallow=all
allow=gsm
allow=ilbc
context=shanghai

==== extensions.conf ====
[shanghai]
exten => 20,1,GotoIf($[${CALLERIDNUM:-11} = 55512345678]?200:10)
exten => 20,10,Playback(pls-wait-connect-call)
exten => 20,11,Dial(${trunk_3}/8655512345678,30)
exten => 20,12,VoiceMail(u20@default)
exten => 20,13,Hangup()
exten => 20,112,VoiceMail(b20@default)
exten => 20,113,Hangup()
exten => 20,200,Answer()
exten => 20,201,Set(TIMEOUT(digit)=2)
exten => 20,202,Set(TIMEOUT(response)=15)
exten => 20,203,Background(pls-entr-num-uwish2-call)
exten => _.,204,Goto(my-numberplan,${EXTEN},1)

Unfortunately, when I call the Shanghai DID and hear the prompt, regardless of what I dial, I get put through to extension 20.

I tried changing the Background to Playback and inserting WaitExten but then it tries to connect me to the first digit I dial e.g. “5” instead of “5556789”

Hear’s a trace using “asterisk -cvvv” to show what goes wrong …
Asterisk Ready.
*CLI> Apr 19 17:44:45 NOTICE[21900]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
– Accepting UNAUTHENTICATED call from 204.11.194.34:
> requested format = g729,
> requested prefs = (),
> actual format = gsm,
> host prefs = (gsm|ilbc),
> priority = mine
– Executing GotoIf(“IAX2/204.11.194.34:4569-4”, “1?200:10”) in new stack
– Goto (shanghai,20,200)
– Executing Answer(“IAX2/204.11.194.34:4569-4”, “”) in new stack
– Executing Set(“IAX2/204.11.194.34:4569-4”, “TIMEOUT(digit)=2”) in new stack
– Digit timeout set to 2
– Executing Set(“IAX2/204.11.194.34:4569-4”, “TIMEOUT(response)=15”) in new stack
– Response timeout set to 15
– Executing BackGround(“IAX2/204.11.194.34:4569-4”, “pls-entr-num-uwish2-call”) in new stack
– Playing ‘pls-entr-num-uwish2-call’ (language ‘en’)
– Executing Goto(“IAX2/204.11.194.34:4569-4”, “my-numberplan|20|1”) in new stack
– Goto (my-numberplan,20,1)

Despite setting digit timeout to 2 and response timeout to 15, I started pressing digits on my cellphone within less than a second of connection, and the trace showed that Asterisk had already gone on to dail extension 20 before I’d even pressed the first digit !!! (Atleast that’s my perception of the timing)

Please, any ideas?

[quote=“banjo67xxx”]==== URI registered with my Shanghai ITSP ====
IAX2/fromshanghai@domain.com/20

[sniff]

[shanghai]
exten => 20,203,Background(pls-entr-num-uwish2-call)
exten => _.,204,Goto(my-numberplan,${EXTEN},1)

Unfortunately, when I call the Shanghai DID and hear the prompt, regardless of what I dial, I get put through to extension 20.

[sniff]

-- Goto (my-numberplan,20,1)

[/quote]

Looks like exactly the behaviour your dial plan asked for: Your ITSP dials in and sent to [shanghai] by your iax.conf. It automatically enters extension 20 because that’s the extension you registered for. Then extension 20 flows to priority 204, then goes to ${EXTEN}@my-numberplan,1, where ${EXTEN} is exactly 20.

What else do you expect?

[quote=“valley”]
Looks like exactly the behaviour your dial plan asked for: Your ITSP dials in and sent to [shanghai] by your iax.conf. It automatically enters extension 20 because that’s the extension you registered for. Then extension 20 flows to priority 204, then goes to ${EXTEN}@my-numberplan,1, where ${EXTEN} is exactly 20.

What else do you expect?[/quote]
Ah! So you mean I should not specify an extension to my DID ITSP, and all my dialplan lines should use the “s” extension. Then it will work?

So if you can’t enter another extension after one has already been specified, how would Asterisk replicate the remote call forwarding feature that my last company’s PBX had? i.e. call the IVR extension 22222 then dial *03 at the prompt to signify call forwarding, then dial extension 12345# then PIN 0000# then 95551234 to make the PBX forward all calls for ext 12345 to 9,5551224. Do you have an example dialplan for this sort of setup?

[quote=“valley”]
Looks like exactly the behaviour your dial plan asked for: Your ITSP dials in and sent to [shanghai] by your iax.conf. It automatically enters extension 20 because that’s the extension you registered for. Then extension 20 flows to priority 204, then goes to ${EXTEN}@my-numberplan,1, where ${EXTEN} is exactly 20.[/quote]

I tried what you said. I changed my DID ITSP URI to:

IAX2/fromshanghai@domain.com

and I changed my extensions.conf to

exten => s,1,GotoIf($[${CALLERIDNUM:-11} = 55512345678]?200:10)
exten => s,10,Playback(pls-wait-connect-call)
exten => s,11,Dial(${trunk_3}/8655512345678,30)
exten => s,12,VoiceMail(u20@default)
exten => s,13,Hangup()
exten => s,112,VoiceMail(b20@default)
exten => s,113,Hangup()
exten => s,200,Answer()
exten => s,201,Set(TIMEOUT(digit)=2)
exten => s,202,Set(TIMEOUT(response)=15)
exten => s,203,Background(pls-entr-num-uwish2-call)
exten => _.,204,Goto(my-numberplan,${EXTEN},1)

But this time it fails with extension “s” not defined in context “my-numberplan”

So, even though I’m not telling it to dial extension 20 anymore, its still ignoring what I press on the cellphone’s keypad!

In which context of extensions.conf? Assumig [shanghai].

This is also correct, because you ask Asterisk to Goto(my-numberplan,${EXTEN},1) when ${EXTEN} is precisely ‘s’. Unless you can dial the number really quick - you seem to have a long string to dial.

[quote=“banjo67xxx”]
i.e. call the IVR extension 22222 then dial *03 at the prompt to signify call forwarding, then dial extension 12345# then PIN 0000# then 95551234 to make the PBX forward all calls for ext 12345 to 9,5551224.[/quote]

Your former company is really painstaking :laughing: (or the admin is). It’s not clear which caller would do this; assume this is yourself, calling from 55512345678. Not sure what’s the purpose of 22222, either. Any way, I assume that you are handling all this in [my-numberplan]. The easiest way to get your plan to do what you want is to change _.,204 to _.,1, like

Now I guess you’ve seen that warning about _. and annoyed. Slightly safer way would be

If you must know why your original plan does not want to handle any digit you pressed, that’s because it doesn’t know how. Every extension must start with priority 1.

Yes, I’m trying to dial a full international phone number, but waitexten() and background() aren’t giving me sufficient time to enter all the digits.

So long as I’m prepared to press # at the end read() is actually the function I should be using.

[quote][quote=“banjo67xxx”]
i.e. call the IVR extension 22222 then dial *03 at the prompt to signify call forwarding, then dial extension 12345# then PIN 0000# then 95551234 to make the PBX forward all calls for ext 12345 to 9,5551224.[/quote]

Your former company is really painstaking :laughing: (or the admin is). It’s not clear which caller would do this; assume this is yourself, calling from 55512345678. Not sure what’s the purpose of 22222, either.
[/quote]
That’s just the way Avaya made their PBX

[quote]
Any way, I assume that you are handling all this in [my-numberplan]. The easiest way to get your plan to do what you want is to change _.,204 to _.,1, like

Now I guess you’ve seen that warning about _. and annoyed. Slightly safer way would be

If you must know why your original plan does not want to handle any digit you pressed, that’s because it doesn’t know how. Every extension must start with priority 1.[/quote]
Tried that and it didn’t work, but what did work was using Read() instead …

[shanghai]
exten => s,1,GotoIf($[${CALLERIDNUM:-11} = 55512345678]?200:10)
exten => s,10,Playback(pls-wait-connect-call)
exten => s,11,Dial(${trunk_3}/8655512345678,30)
exten => s,12,VoiceMail(u20@default)
exten => s,13,Hangup()
exten => s,112,VoiceMail(b20@default)
exten => s,113,Hangup()
exten => s,200,Answer()
exten => s,201,Set(TIMEOUT(digit)=10)
exten => s,202,Set(TIMEOUT(response)=60)
exten => s,203,Playback(pls-entr-num-uwish2-call)
exten => s,204,Playback(followed-by)
exten => s,205,Read(NUMBER,hash)
exten => s,206,Dial(${trunk_3}/${NUMBER},30)
exten => s,207,Congestion()
exten => s,307,Congestion()

Now the next questions are.

  1. How to I combine pls-entr-num-uwish2-call followed-by and hash into a single prompt?
    e.g. in the background() command you can combine prompts with &
    I tried it with read() and got
    file.c:512 ast_openstream_full: File pls-entr-num-uwish2-call & followed-by & hash does not exist in any format

  2. Why am I only getting one-way audio with this dial plan on some numbers? How do I debug one-way audio?

Strangely, if I dial my Asterisk server, then at the prompt enter my wife’s cellphone number, she can hear me but I can’t hear her.
However, if I dial my Asterisk server, and at the prompt enter the London number for my ITSPs IVR, I can hear the IVR (no idea if they can hear me).

I’ve got the output from asterisk -cvvv, but what else would help diagnosis …

-- Accepting UNAUTHENTICATED call from 204.11.194.34:
   > requested format = g729,
   > requested prefs = (),
   > actual format = gsm,
   > host prefs = (gsm|ilbc),
   > priority = mine
-- Executing GotoIf("IAX2/204.11.194.34:4569-5", "1?200:10") in new stack
-- Goto (shanghai,s,200)
-- Executing Answer("IAX2/204.11.194.34:4569-5", "") in new stack
-- Executing Set("IAX2/204.11.194.34:4569-5", "TIMEOUT(digit)=10") in new stack
-- Digit timeout set to 10
-- Executing Set("IAX2/204.11.194.34:4569-5", "TIMEOUT(response)=60") in new stack
-- Response timeout set to 60
-- Executing Playback("IAX2/204.11.194.34:4569-5", "pls-entr-num-uwish2-call") in new stack
-- Playing 'pls-entr-num-uwish2-call' (language 'en')
-- Executing Playback("IAX2/204.11.194.34:4569-5", "followed-by") in new stack
-- Playing 'followed-by' (language 'en')

Apr 24 20:43:27 NOTICE[14299]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
– Executing Read(“IAX2/204.11.194.34:4569-5”, “NUMBER|hash”) in new stack
– Playing ‘hash’ (language ‘en’)
– User entered ‘8655587654321’
– Executing Dial(“IAX2/204.11.194.34:4569-5”, “IAX2/trunk_3/8655587654321|30”) in new stack
– Called trunk_3/8655587654321
– Call accepted by 62.4.81.180 (format gsm)
– Format for call is gsm
– IAX2/trunk_3-8 is making progress passing it to IAX2/204.11.194.34:4569-5
Apr 24 20:43:57 NOTICE[14299]: res_musiconhold.c:533 monmp3thread: Request to schedule in the past?!?!
– IAX2/trunk_3-8 answered IAX2/204.11.194.34:4569-5
– Attempting native bridge of IAX2/204.11.194.34:4569-5 and IAX2/trunk_3-8
– Channel ‘IAX2/trunk_3-8’ ready to transfer
– Channel ‘IAX2/204.11.194.34:4569-5’ ready to transfer
– Releasing IAX2/204.11.194.34:4569-5 and IAX2/trunk_3-8
– Hungup ‘IAX2/trunk_3-8’
== Spawn extension (shanghai, s, 206) exited non-zero on ‘IAX2/204.11.194.34:4569-5’
– Hungup ‘IAX2/204.11.194.34:4569-5’

Making them one file?

Search “Asterisk one-way audio” in voip-info.org, this forum, or google. It’s unclear which of the several scenarios you described produced the CLI output in your post.

Anyway, when the original issue is resolved, it’s best to post another thread for new problems. (And mark original resolved in the title.

[quote=“valley”][quote=“banjo67xxx”]

  1. How to I combine pls-entr-num-uwish2-call followed-by and hash into a single prompt?
    [/quote]

Making them one file?
[/quote]
Doh!

cat pls-entr-num-uwish2-call.gsm followed-by.gsm hash.gsm > pls-entr-num-uwish2-call-followed-by-hash.gsm

Works brilliantly :smile:

[quote][quote=“banjo67xxx”]
2) Why am I only getting one-way audio with this dial plan on some numbers? How do I debug one-way audio?
[/quote]
Search “Asterisk one-way audio” in voip-info.org, this forum, or google. It’s unclear which of the several scenarios you described produced the CLI output in your post.

Anyway, when the original issue is resolved, it’s best to post another thread for new problems. (And mark original resolved in the title.[/quote]

Actually it all works fine now albeit with the poor quality you would expect from routing between Chinese Cellphone, US-based DID in China, slow performance Asterisk server in UK over ADSL, US-based ITSP routing back to UK PSTN. (I think that’s twice round the world)

But atleast it works :smile: