[Asterisk-Users] Please help -- Syntax for dialing VoIP provider

John Todd jtodd at loligo.com
Sun Jul 6 11:53:36 MST 2003


>[snip]
>
>Now I can use the SIP phones internally at least. I can call from 
>Sip1 to Zap2 for example. Dialing into the PSTN from the Sip phones 
>is still problematic, ie calls dropping, tiny volume etc etc.

OK, but the fact that dialing is working is the problem  you were 
trying to solve, so we'll leave quality debugging for another thread. 
:)

>However, for as long as I cannot even dial into Nikotel (nor FWD nor 
>ICH) using one of the analog phones on (Zap2 or Zap3) I don't even 
>fancy to fiddle with the SIP phones. The fever things there are in 
>the call chain that could be responsible for it not working, the 
>better, so for now, I want to concentrate on getting the dialing out 
>via VoIP service provider working from the Zap lines.
>
>>>I wonder what the syntax is to dial a number via a VoIP provider. 
>>>This appears to be documented NOWHERE.
>>
>>I would disagree.  A VoIP provider is no different than a SIP 
>>phone; they are treated the same.
>
>If I dial into a SIP phone directly, I don't have to provide a third 
>party number because the SIP phone is the destination already. If I 
>dial into a VoIP service, I have to provide the number for my 
>desired destination in addition to my own credentials. As a result 
>the two cases are not the same as far as dialing syntax is concerned.
>
>>   If you are looking for examples, please see 
>>http://www.loligo.com/asterisk/   for my sample files, which 
>>contain some VoIP provider dial statements.
>
>Thanks, I had already been given the URL and I looked at it. One of 
>the problems I had is that I find it difficult to work out what the 
>*naked* dial string actually is because of all the macros and 
>variables used in there.
>
>I would prefer to start as barebones as it can possibly be and get 
>the basics working. Bells and whistles can be added in later - one 
>at a time.
>
>>>exten => _00N.,1,Dial,SIP/${EXTEN:2}@calamar0.nikotel.com,tr
>>>exten => _00N.,2,Congestion
>>>
>>>and sip debug tells me that the account doesn't match the one on 
>>>record, whatever that means.
>>>
>>>I tried this:
>>>
>>>; International long distance through VoIP service
>>>;
>>>exten => _00N.,1,Dial,SIP/myusername at calamar0.nikotel.com/${EXTEN:2},tr
>>
>>You may be having at least one error due to syntax.  The line above 
>>should look like:
>>
>>exten => _00N.,1,Dial(SIP/myusername at calamar0.nikotel.com/${EXTEN:2},100,r)
>
>Thanks for the hint. However, I am not quite so sure that this is 
>the correct syntax either. When I try this with "sip debug" Asterisk 
>does not even make an attempt to contact the remote VoIP service. It 
>chokes on the dial string already and goes no further.

Based on the changes below to the various files, change your dial line to:

[internal]
exten => _00N.,1,Dial(SIP/nikotel/${EXTEN:2},100,r)

I have assumed that the Dial statement above is in context [internal] 
- am I correct?

>SIP Registration comes back with a SIP/2.0 200 OK (ie registration 
>successful) for both ICH and Nikotel. Thus, I am confident that 
>registration is not the issue. However dialing out (from Zap) with 
>the various possibilities of syntax I could think of, simply doesn't 
>work.
>
>Here is what I have tried so far
>
>in zapata.conf ...
>-------------------------------------------------------------------------
>signalling=fxo_ks
>context=internal
>channel => 2,3
>-------------------------------------------------------------------------
>
>
>in sip.conf ...
>-------------------------------------------------------------------------
>register => user:pass at calamar0.nikotel.com/asterisk ; already tried 
>with user instead of asterisk and blank
>
>[nikotel]                       ; Service Provider Nikotel
>type=peer
>secret=pass
>username=user
>host=calamar0.nikotel.com


change to:

[nikotel]
type=friend
secret=pass
auth=md5     ; I assume it's md5 and not cleartext?
username=user
host=calamar0.nikotel.com

>-------------------------------------------------------------------------
>
>
>in extensions.conf ...
>-------------------------------------------------------------------------
>[globals]
>REDPHONE => Zap/3
>
>[voipintl]
>;
>; International long distance through VoIP service
>;
>; Assuming Prefix Syntax without password
>exten => _001N.,1,Dial(SIP/${EXTEN:3}/user at calamar0.nikotel.com,45,r)
>;
>; Assuming Prefix Syntax with password
>exten => _002N.,1,Dial(SIP/${EXTEN:3}/user:pass at calamar0.nikotel.com,45,r)
>;
>; Assuming Postfix Syntax without password
>exten => _003N.,1,Dial(SIP/user at calamar0.nikotel.com/${EXTEN:3},45,r)
>;
>; Assuming Postfix Syntax with password
>exten => _004N.,1,Dial(SIP/user:pass at calamar0.nikotel.com/${EXTEN:3},45,r)
>;
>exten => _00[1234]N.,2,Congestion
>
>;and further down
>
>[international]
>include => voipintl
>
>[internal]
>exten => 112,1,Dial(${REDPHONE},20,tr)	; phone on Zap/3
>include = international
>-------------------------------------------------------------------------
>
>
>With this I tested all the four syntax test cases dialing out from 
>REDPHONE (Zap/3) and with "sip debug".
>
>In brief, none works, but at least the two prefix syntax tests show 
>SIP activity, while the two postfix syntax tests do not show any SIP 
>activity whatsoever, which leads me to believe that Asterisk doesn't 
>even try to contact the remote SIP service provider when using the 
>postfix syntax as you suggested.

Look more closely at the example statements.  The dialed number is at 
the end of the SIP dial line.

Make it look like this:

[globals]
REDPHONE => Zap/3

[voipintl]
;
; International long distance through VoIP service
;
; Assuming Prefix Syntax without password
exten => _001N.,1,Dial(SIP/${EXTEN:3}@nikotel,45,r)
;
; Assuming Prefix Syntax with password
exten => _002N.,1,Dial(SIP/${EXTEN:3}@nikotel,45,r)
;
; Assuming Postfix Syntax without password
exten => _003N.,1,Dial(SIP/${EXTEN:3}@nikotel,45,r)
;
; Assuming Postfix Syntax with password
exten => _004N.,1,Dial(SIP/${EXTEN:3}@nikotel,45,r)
;
exten => _00[1234]N.,2,Congestion

;and further down

[international]
include => voipintl

[internal]
exten => 112,1,Dial(${REDPHONE},20,tr)	; phone on Zap/3
include = international


>I am happy to hunt down errors, but a situation where you spent 
>three 15 hour days trying while searching for documentation/hints 
>and you STILL DON'T KNOW WHAT THE SYNTAX IS SUPPOSED TO BE is really 
>very frustrating. I feel like I am stuck in a room with no windows 
>and no light - in total darkness.
>
>>You don't need the "t" unless you want the answering party to be 
>>able to transfer your calls in your own system (probably bad) and 
>>you need the "100" to tell the Dial statement how long to attempt 
>>the dial. If you don't want to specify number of seconds, you'd 
>>need to leave that area blank. (i.e.: ...TEN:2},,r)  )
>
>thanks.
>
>BTW, what is the difference between
>
>Dial,SIP/abcabcabcabc		and		Dial(SIP/abcabcabcabc)  ?

Nothing.  The parenthetical case is the "modern" method of specifying 
command variables.  Both work.

>
>>>Does anybody know how to dial a PSTN number through a VoIP service?
>>>
>>>Is this standardised, at least within SIP? Or does it vary from 
>>>provider to provider?
>>
>>To the best of my experiences, it does not vary from provider to provider.
>
>Well, that gives me some comfort, but I must be doing something 
>wrong, because I can't place any VoIP calls from Asterisk with 
>neither Nikotel nor ICH. It works fabulously when I register the SIP 
>phone directly with the service provider and not go through 
>Asterisk, though.
>
>thanks again
>rgds
>bk
>
>PS: Below are my debug logs, just in case anybody can figure out 
>what's wrong ...
>
[snip]



More information about the asterisk-users mailing list