Shared registration string for carrier inbound/outbound?

Is it ok for the single registration string as below:

for both BABYTEL_IN and BABYTEL_OUT?

(At the moment, there’s total duplication between BABYTEL_IN and BABYTEL_OUT. For the time being, I want to split the configuration betwee inbound and outbound, but am just wondering whether I need one or two registration strings.)

; WARNING- THIS FILE IS AUTO-GENERATED BY VICIDIAL, ANY EDITS YOU MAKE WILL BE LOST
register => 1234567890@sip.babytel.ca:ghjkgjkffghjfjh5474fghfjh:1234567890@nat5.babytel.ca:5065/1234567890

; VICIDIAL Carrier: BABYTEL_IN - BABYTEL_INBOUND
; some carrier 
[babytel]
type=peer
qualify=no
insecure=no
host=nat5.babytel.ca
port=5065
username=1234567890
host=nat5.babytel.ca
outboundproxy=nat5.babytel.ca:5065
secret=ghjkgjkffghjfjh5474fghfjh
canreinvite=no
insecure=invite

; VICIDIAL Carrier: BABYTEL_OUT - BABYTEL_OUTBOUND
; some carrier 
[babytel]
type=peer
qualify=no
insecure=no
host=nat5.babytel.ca
port=5065
username=1234567890
host=nat5.babytel.ca
outboundproxy=nat5.babytel.ca:5065
secret=ghjkgjkffghjfjh5474fghfjh
canreinvite=no
insecure=invite



[201]
username=201
secret=password
accountcode=201
callerid="jitsi201" <201>
mailbox=201
context=default
type=friend
host=dynamic

[202]
username=202
secret=password
accountcode=202
callerid="jitsi202" <202>
mailbox=202
context=default
type=friend
host=dynamic

[gs102]
username=gs102
secret=EfTj2JWuQBxC33h
accountcode=gs102
callerid="Test Admin Phone" <>
mailbox=102
context=default
type=friend
host=dynamic


; END OF FILE    Last Forced System Reload: 2015-03-20 07:27:40

in relation to:

; WARNING- THIS FILE IS AUTO-GENERATED BY VICIDIAL, ANY EDITS YOU MAKE WILL BE LOST
TRUNKloop = IAX2/ASTloop:3TdJ8fmKkyNaGoF@127.0.0.1:40569
TRUNKblind = IAX2/ASTblind:3TdJ8fmKkyNaGoF@127.0.0.1:41569
TRUNKplay = IAX2/ASTplay:3TdJ8fmKkyNaGoF@127.0.0.1:42569
BABYTELTRUNK = SIP/babytel



; agent phones restricted to only internal extensions
[default---agent]
exten => s,1,Answer
exten => s,n,AGI(agi-VDAD_inbound_calltime_check.agi,-----NO-----default---agent-------------------------NO)
exten => s,n,Set(INVCOUNT=0) 
exten => s,n,Background(sip-silence)
exten => s,n,WaitExten(20)


; hangup
exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup()
exten => i,1,Goto(s,4)
exten => i,n,Hangup()
; hangup
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})

; custom dialplan entries
include => vicidial-auto-internal
include => vicidial-auto-phones




; logging of all outbound calls from agent phones
[defaultlog]
exten => s,1,Answer
exten => s,n,AGI(agi-VDAD_inbound_calltime_check.agi,-----NO-----defaultlog-------------------------NO)
exten => s,n,Set(INVCOUNT=0) 
exten => s,n,Background(sip-silence)
exten => s,n,WaitExten(20)


; hangup
exten => t,1,Playback(vm-goodbye)
exten => t,n,Hangup()
exten => i,1,Goto(s,4)
exten => i,n,Hangup()
; hangup
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})

; custom dialplan entries
exten => _X.,1,AGI(agi-NVA_recording.agi,BOTH------Y---Y---Y)
exten => _X.,n,Goto(default,${EXTEN},1)




[vicidial-auto-external]
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})

; Local Server: 192.168.0.99
exten => _192*168*000*099*.,1,Goto(default,${EXTEN:16},1)
exten => _192*168*000*099*.,2,Hangup()
exten => _**192*168*000*099*.,1,Goto(default,${EXTEN:18},1)
exten => _**192*168*000*099*.,2,Hangup()

; Agent session audio playback meetme entry
exten => _473782178600XXX,1,Meetme(${EXTEN:8},q)
exten => _473782178600XXX,n,Hangup()
; Agent session audio playback loop
exten => _473782168600XXX,1,Dial(${TRUNKplay}/47378217${EXTEN:8},5,To)
exten => _473782168600XXX,n,Hangup()
; Agent session audio playback extension
exten => 473782158521111,1,Answer
exten => 473782158521111,n,ControlPlayback(${CALLERID(name)},99999,0,1,2,3,4)
exten => 473782158521111,n,Hangup()
; SendDTMF to playback channel to control it
exten => _473782148521111.,1,Answer
exten => _473782148521111.,n,SendDTMF(${CALLERID(num)},250,250,IAX2/ASTplay-${EXTEN:15})
exten => _473782148521111.,n,Hangup()
; Silent wait channel for DTMFsend
exten => 473782138521111,1,Answer
exten => 473782138521111,n,Wait(5)
exten => 473782138521111,n,Hangup()
; VICIDIAL Carrier: BABYTEL_IN - BABYTEL_INBOUND
; some carrier 
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${BABYTELTRUNK}/${EXTEN:2},,To)
exten => _91999NXXXXXX,3,Hangup

; VICIDIAL Carrier: BABYTEL_OUT - BABYTEL_OUTBOUND
; some carrier 
exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _91999NXXXXXX,2,Dial(${BABYTELTRUNK}/${EXTEN:2},,To)
exten => _91999NXXXXXX,3,Hangup


[vicidial-auto-internal]
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})
; Voicemail Extensions:
exten => _85026666666666.,1,Wait(1)
exten => _85026666666666.,n,Voicemail(${EXTEN:14},u)
exten => _85026666666666.,n,Hangup()
exten => _85026666666667.,1,Wait(1)
exten => _85026666666667.,n,Voicemail(${EXTEN:14},su)
exten => _85026666666667.,n,Hangup()
exten => 8500,1,VoicemailMain
exten => 8500,2,Goto(s,6)
exten => 8500,3,Hangup()
exten => 8501,1,VoicemailMain(s${CALLERID(num)})
exten => 8501,2,Hangup()

; Prompt Extensions:
exten => 8167,1,Answer
exten => 8167,2,AGI(agi-record_prompts.agi,wav-----720000)
exten => 8167,3,Hangup()
exten => 8168,1,Answer
exten => 8168,2,AGI(agi-record_prompts.agi,gsm-----720000)
exten => 8168,3,Hangup()

; this is used for recording conference calls, the client app sends the filename
;    value as a callerID recordings go to /var/spool/asterisk/monitor (WAV)
;    Recording is limited to 1 hour, to make longer, just change the server
;    setting ViciDial Recording Limit
;     this is the WAV verison, default
exten => 8309,1,Answer
exten => 8309,2,Monitor(wav,${CALLERID(name)})
exten => 8309,3,Wait(3600)
exten => 8309,4,Hangup()
;     this is the GSM verison
exten => 8310,1,Answer
exten => 8310,2,Monitor(gsm,${CALLERID(name)})
exten => 8310,3,Wait(3600)
exten => 8310,4,Hangup()

;     agent alert extension
exten => 83047777777777,1,Answer
exten => 83047777777777,2,Playback(${CALLERID(name)})
exten => 83047777777777,3,Hangup()
; This is a loopback dial-around to allow for immediate answer of outbound calls
exten => _8305888888888888.,1,Answer
exten => _8305888888888888.,n,Wait(${EXTEN:16:1})
exten => _8305888888888888.,n,Dial(${TRUNKloop}/${EXTEN:17},,To)
exten => _8305888888888888.,n,Hangup()
; No-call silence extension
exten => _8305888888888888X999,1,Answer
exten => _8305888888888888X999,n,Wait(3600)
exten => _8305888888888888X999,n,Hangup()

[vicidial-auto-phones]
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})

; Phones direct dial extensions:
exten => 201,1,Dial(SIP/201,60,)
exten => 201,2,Goto(default,85026666666666201,1)
exten => 201,3,Hangup()
exten => 202,1,Dial(SIP/202,60,)
exten => 202,2,Goto(default,85026666666666202,1)
exten => 202,3,Hangup()
exten => 102,1,Dial(SIP/gs102,60,)
exten => 102,2,Goto(default,85026666666666102,1)
exten => 102,3,Hangup()

[vicidial-auto]
exten => h,1,AGI(agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----${HANGUPCAUSE}-----${DIALSTATUS}-----${DIALEDTIME}-----${ANSWEREDTIME})

include => vicidial-auto-internal
include => vicidial-auto-phones
include => vicidial-auto-external


; END OF FILE    Last Forced System Reload: 2015-03-20 07:27:40

At the moment, there’s duplication, 100%, between the inbound and outbound contexts – I’ll change that going forward.

Asterisk doesn’t require separate in and out sections, so maybe you should ask the vicidial people. (Some systems may source calls from different addresses from that on which they accept calls, and will require one “incoming” section for each source address.)

In any case, registration only really applies to incoming calls, although some implementations may use it to set IP address filters for outgoing ones. The purpose of registration is to tell the registrar where you are, so that it knows where to send incoming calls.

Also insecure=invite is only meaningful for incoming requests, and canreinvite is at least deprecated and may be obsolete.

[quote=“david55”]Asterisk doesn’t require separate in and out sections, so maybe you should ask the vicidial people. (Some systems may source calls from different addresses from that on which they accept calls, and will require one “incoming” section for each source address.)

In any case, registration only really applies to incoming calls, although some implementations may use it to set IP address filters for outgoing ones. The purpose of registration is to tell the registrar where you are, so that it knows where to send incoming calls.

Also insecure=invite is only meaningful for incoming requests, and canreinvite is at least deprecated and may be obsolete.[/quote]

Thanks. It’s the carrier whom suggests (insists on) the seperate in and out sections – which just complicates my trying to shoehorn that config into vicidial; thanks.

Whom or what is the registrar? (I’m checking the “definitive guide” now for that term.)

By IP address filters, that would mean, based on the IP address of the “origin” of the SIP call? That when a call is placed from a specific IP address to use a specific carrier to place the call? I just have the one carrier, but that’s intriguing.

Their specific e-mail is to config as:

[babytel_incoming] type=peer qualify=no insecure=no host=nat5.babytel.ca port=5065

and

[babytel_incoming] [babytel_outbound] type=peer username=1234567890 host=nat5.babytel.ca outboundproxy=nat5.babytel.ca:5065 secret=jfdsfj544jdskl24 canreinvite=no insecure=invite

So, I can update the “sip-vicidial.conf” file to that fairly easily.

In “extensions-vicidial.conf” they both use the same “BABYTELTRUNK = SIP/babytel”?

p 149 of the “definitive guide” has this corresponding entry:

“TOLL = SIP/YourVoipCarrier” and the comment is that this is as defined in sip.conf — but what does that really mean when you break it down? That’s a vague explanation. At least, I don’t know what it means.

Both inbound and outbound should have:

“exten => _91999NXXXXXX,2,Dial(${BABYTELTRUNK}/${EXTEN:2},To)” ?

Apparently, this is to allow people to dial “9” before placing a call? Extraneous, but ok. Only necessary for outbound, right?

I realize that’s beyond the original questions scope.

ITSPs have a habit of giving information that worked at one time, but is often badly designed, e.g. unnecessarily insecure, or based on a misunderstanding of what is really required (e.g. based on examples where the inbound and outbound addresses differ). When they say you must do it a particular way, it really just means that eight years ago we found that this worked.

In fact, there is no guarantee as to which section will actually match for incoming calls, to there is really no point in having a separate incoming section, as you may find that all the incoming calls are actually matching the outgoing section.

However, in this case, their inbound and outbound are not the same, as the outbound section will match the default port number for incoming calls, not the, non-standard, 5065, that they use. I suspect that is due to an unnecessary explicit proxy specification in the outbound one.

This means that there is a section in your sip.conf, headed:

[YourVoipCarrier]

where YourVoipCarrier is really whatever needs to be there to work, and which contains appropriate setting for making outgoing calls through that carrier. Whilst some of the sip.conf settings are confusing, that really should have been fairly obvious. (In practice, if you have separate incoming and outgoing sections, the name of the outgoing section is irrelevant, as long as it doesn’t clash.)

TOLL is then used in the Dial string, but you could also use its value literally, and not use a variable, at all.

LOL, yes, that was my take on the ITSP directions :smile: And, thanks for the TLA of ITSP :smile:

It’s interesting, sip.conf isn’t effected by vicidial, just sip-vicidial.conf – it’s tempting to add a section of [YourVoipCarrier] directly in sip.conf, but I think I’ll hold off on that. I’m dealing with three fine manuals, so it’s RTFM * 3: the ITSP, Asterisk and ViciDial – and they don’t always agree with each other or make sense. Plus, I’m a bit over my head.

For the “explicit proxy specification” I know when I’m testing the connection with Jitsi that the proxy specification seems required. I’m 99% sure, but can double-check.

Is there a duplication in the proxy specification by having it, as I recall, both in the registration string and in the sip.conf settings? I think so, but hesitate to alter either. (I know it’s easy to change back, I just want to go very carefully so I don’t get lost.)

For what it’s worth, CSIPsimple, which works perfectly:

code.google.com/p/csipsimple/sou … bytel.java

and they seem to set the port explicitly:

    account.proxies = new String[] {"sip:nat.babytel.ca:5065"};

although I can’t tell if that’s just for outbound, and it’s probably not worth chasing through their code to find out. Curious that they hardcode the settings, but it works, I guess. Ironically, or perhaps not, the ITSP supplied “roambaby” app just crashes, at least for me.