sip.conf file <didforsale solved>

Added by Frank Tricamo 3 months ago

I wanted to load didforsale parameters into WAZO through sip.conf file. Not really interested in trying to use the GUI
IPBX>>Trunk management>>SIP protocol

I am adding to the /asterisk/sip.conf file directly as stated here https://projects.wazo.community/boards/1/topics/8792?r=8830#message-8830 but when i run the "/usr/bin/xivo-confgen asterisk/sip.conf" command i only see what was enabled in the GUI.

I restarted and reloaded...nothing. What am i missing?

[didforsale_in1]
host=209.216.2.211
type=peer
context=from-didforsale
disallow=all
allow=ulaw
nat=yes
canreinvite=yes
insecure=very
dtmfmode=rfc2833
qualify=yes

[didforsale_in2]
host=209.216.15.70
type=peer
context=from-didforsale
disallow=all
allow=ulaw
nat=yes
canreinvite=yes
insecure=very
dtmfmode=rfc2833
qualify=yes

[didforsale_out1]
host=209.216.2.212
type=peer
context=from-didforsale
disallow=all
allow=ulaw
nat=yes
canreinvite=yes
insecure=very
dtmfmode=rfc2833
qualify=yes

[didforsale_out2]
host=209.216.15.71
type=peer
context=from-didforsale
disallow=all
allow=ulaw
nat=yes
canreinvite=yes
insecure=very
dtmfmode=rfc2833
qualify=yes


Replies (6)

RE: sip.conf file - Added by Pascal Cadotte-Michaud 3 months ago

Hi,

the content of sip.conf does not modify the output of xivo-confgen.

The line "#exec /usr/bin/xivo-confgen asterisk/sip.conf" in sip.conf executes the xivo-confgen asterisk/sip.conf and inserts the output at the location of the "#exec" line.

RE: sip.conf file - Added by Pascal Cadotte-Michaud 3 months ago

Basically, you can add content to the file above or below the xivo-confgen line but the web interface will not be aware of those changes.

I also notice that some of the fields used in your configuration are not supported anymore in asterisk 14.

for example:

canreinvite has been replaced by direct
insecure=very should probably be insecure=port,invite

The most tricky port of this configuration is probably the "qualify=yes" part which is named "monitoring" in the web ui.

RE: sip.conf file - Added by Frank Tricamo 3 months ago

I can see that the trunks are up as you can see in the attached picture.

which was going to bring me to my next question

1) Since the web interface is not aware of any of the changes....i cannot use the interface to route the calls?

peerstatus.jpg (81.5 KB)

RE: sip.conf file - Added by Pascal Cadotte-Michaud 3 months ago

Of course if you configure your trunks manually you will have to do most of the configuration yourself.

If you want to route calls from the web interface you will have to configure the trunk using the web UI, which should be pretty straightforward with the information in my previous message.

RE: sip.conf file - Added by C G 3 months ago

So far I've only been able to receive calls using this configuration:

[didforsale_in1]
disallow = all
context = from-didforsale
call-limit = 0
amaflags = default
port = 5060
callerid = 1626xxxxxxx
transport = udp
nat = force_rport,comedia
qualify = yes
type = peer
directmedia = yes
insecure = port,invite
dtmfmode = rfc2833
host = 209.216.2.211
language = en_US
allow = ulaw
subscribemwi = no

[didforsale_in2]
disallow = all
context = from-didforsale
call-limit = 0
amaflags = default
port = 5060
callerid = 1626xxxxxxx
transport = udp
nat = force_rport,comedia
qualify = yes
type = peer
directmedia = yes
insecure = port,invite
dtmfmode = rfc2833
host = 209.216.15.70
language = en_US
allow = ulaw
subscribemwi = no

[didforsale_out1]
disallow = all
context = to-extern
call-limit = 0
amaflags = default
port = 5060
callerid = 1626xxxxxxx
transport = udp
nat = force_rport,comedia
qualify = yes
type = peer
directmedia = yes
insecure = port,invite
dtmfmode = rfc2833
host = 209.216.2.212
language = en_US
allow = ulaw
subscribemwi = no

[didforsale_out2]
disallow = all
context = to-extern
call-limit = 0
amaflags = default
port = 5060
callerid = 1626xxxxxxx
transport = udp
nat = force_rport,comedia
qualify = yes
type = peer
directmedia = yes
insecure = port,invite
dtmfmode = rfc2833
host = 209.216.15.71
language = en_US
allow = ulaw
subscribemwi = no
----------------------------------------

From their Asterisk Interconnection guide, this is the bit after the configuration information:

Now you have to create a dialplan entry to catch all incoming calls coming from DIDForsale. For doing that, open /etc/asterisk/extensions.conf and add the below entries

[from-didforsale]
exten=>_X.,1,Noop(Incoming calls from DIDForSale)
same=>n,Dial(SIP/1000)
same=>n,Hangup

The above dialplan entry catch all calls coming from didforsale and send it to the extension 1000 in your system. You can change that to forward calls to any other extension or ivr on your system.

For making outgoing calls from your system through didforsale, create the below dialplan entry

[outbound]
exten=>_X.,1,Dial(SIP/didforsale_out1/${EXTEN})
same=>n,Dial(SIP/didforsale_out2/${EXTEN})
same=>n,Hangup

Change the context name “outbound” in the above entry to the context name of your extensions.
-----------------------------------

My context when entering in /usr/bin/xivo-confgen asterisk/extensions.conf

[from-didforsale]
exten = i,1,Playback(no-user-find)
same = n,Hangup()
exten = s,1,NoOp()
same = n,GotoIf($[${CHANNEL} = SIP]?:not-sip)
same = n,GotoIf($["${XIVO_DID_NEXT_EXTEN}" = ""]?:error-loop)
same = n,Set(XIVO_DID_NEXT_EXTEN=${CUT,@,1),:,2)})
same = n,Set(XIVO_FROM_S=1)
same = n,Goto(from-didforsale,${XIVO_DID_NEXT_EXTEN},1)
same = n(not-sip),NoOp()
same = n,Log(ERROR, This s extension can only be used from a SIP channel)
same = n,Hangup()
same = n(error-loop),NoOp()
same = n,Log(ERROR, Dialplan loop detected. Got SIP header To: ${SIP_HEADER(To)})
same = n,Hangup()
exten = _+.,1,Goto(${EXTEN:1},1)

exten = 1626xxxxxxx,1,Set(XIVO_BASE_CONTEXT=${CONTEXT})
same = n,Set(XIVO_BASE_EXTEN=${EXTEN})
same = n,GotoIf(${XIVO_FROM_S}?:action)
same = n,CELGenUserEvent(XIVO_FROM_S)
same = n(action),GoSub(did,s,1(4,))
-------------------------------------------------------

I'm a newb at this and trying to still evaluate DIDforSale. Since I can't make calls, I'm stalled.

RE: sip.conf file - Added by Frank Tricamo 3 months ago

I did get it working just using the UI and default context (both in and out). see the attached screen shots

the key was 'monitoring' on the 3rd tab (as suggested by Pascal Cadotte)

(1-6/6)