SIP TRUNK Config for Voicepulse and Vicidial Server

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

SIP TRUNK Config for Voicepulse and Vicidial Server

Postby infamoose » Tue Nov 17, 2009 5:21 pm

Hi,

First time user and I am having a bit of trouble adding the following to my .conf (both sip and extension). Should I do the aforementioned voicepulse- backup, replace, reload - or add the following to my vicidial sip.conf and extension.conf?

This is what voicepulse wants and whats already in play are two different things. I need to modify sip.conf and extensions.conf appropriately.

I can't paste code due to new user rights but could someone possibly point me in the right direction? If emailing you is an option that would be great.



What would be the appropriate way to do this?? Any help is greatly appreciated.
infamoose
 
Posts: 9
Joined: Mon Nov 16, 2009 2:14 am

Postby mflorell » Tue Nov 17, 2009 5:45 pm

admin.php version and build?
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby infamoose » Tue Nov 17, 2009 6:04 pm

mflorell wrote:admin.php version and build?


VERSION: 2.0.5-173
BUILD: 90320-0424
infamoose
 
Posts: 9
Joined: Mon Nov 16, 2009 2:14 am

Postby mflorell » Tue Nov 17, 2009 8:17 pm

PM me what they sent you(replace user/pass with XXXXXs) and I will post
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby mflorell » Wed Nov 18, 2009 6:38 am

Here are the conf files that he sent me:

infamoose wrote:Mr. Florell,
sip.conf

Code: Select all
     ; Sample /etc/asterisk/sip.conf
   ; File Version 080812
    ; Updated Jun 13, 2008 to fix inbound legacy calls
    ; Updated Jul 9, 2008 to migrate to sjc/jfk
    ; Updated Aug 8, 2008 to be more SIP RFC compliant
    ;
    ; Copyright (c) 2003-2008 VoicePulse Inc.
    ; VoicePulse is a registered trademark of VoicePulse Inc.
    ;
    ; =========================================================
    ; QUICKSTART WITH VOICEPULSE CONNECT FOR ASTERISK
    ;
    ; * Login to your VoicePulse for Business & Wholesale account:
    ;   http://connect.voicepulse.com/
    ;
    ; * Go to the Credentials page to see your device login and
    ;   device password.  Your device login and passwords are
    ;   NOT THE SAME AS YOUR WEBSITE LOGIN AND PASSWORD.
    ;
    ; * Do a text search & replace in this file:
    ;   - Replace MY_DEVICE_LOGIN with your device login
    ;   - Replace MY_DEVICE_PASSWORD with your device password
    ;
    ; =========================================================


    ; ---------------------------------------------------------
    ; GENERAL SETTINGS
    ;
    ; ---------------------------------------------------------
   
[general]

    ; .........................................................
    ; Handle unknown calls
    ; .........................................................

context=banned


    ; .........................................................
    ; REGISTER WITH VOICEPULSE
    ;
    ; You should register to the datacenter closest to you.
    ; There are currently two datacenters you may use:
    ; * New York, NY (JFK)
    ; * San Jose, CA (SJC)
    ;
    ; The entire "register =>" line below should be on one line
    ; (with no carriage returns in the middle):
    ; .........................................................

    ; Register to JFK by default
    ; West coast users should use sjc-primary and sjc-backup instead
register => XXXXXXXXX:XXXXXXXXX@sjc-primary.voicepulse.com ; Version 080812
register => XXXXXXXXX:XXXXXXXXX@jfk-backup.voicepulse.com ; Version 080812



    ; ---------------------------------------------------------
    ; SIP PEERS
    ;
    ; These are the primary and backup peers for calls to/from:
    ; JFK (New York, NY) or SJC (San Jose, CA)
    ; ---------------------------------------------------------

[voicepulse-primary] ; Version 080812
type=peer
context=voicepulse-in   ; <-- the context in extensions.conf
                        ; that you want these calls to go to
host=sjc-primary.voicepulse.com  ; <-- west coast users should
                                 ; use sjc-primary instead
username=XXXXXXXXXXX
secret=XXXXXXXXXXX
qualify=yes
allow=all
canreinvite=no
dtmfmode=rfc2833
rfc2833compensate=yes
insecure=port,invite
trustrpid=yes

[voicepulse-backup] ; Version 080812
type=peer
context=voicepulse-in   ; <-- the context in extensions.conf
                        ; that you want these calls to go to
host=jfk-backup.voicepulse.com   ; <-- west coast users should
                                 ; use sjc-backup instead
username=XXXXXXXXXX
secret=XXXXXXXXX
qualify=yes
allow=all
canreinvite=no
dtmfmode=rfc2833
rfc2833compensate=yes
insecure=port,invite
trustrpid=yes



    ; ---------------------------------------------------------
    ; REGISTERED USER -- FOR TESTING SIP ENDPOINTS
    ;
    ; This is a test user.  You can use Counterpath's X-Lite
    ; Phone to test your Asterisk configuration.  Configure the
    ; following settings:
    ;
    ;   Menu > System Settings > Sip Proxy > [default]
    ;
    ;   Enabled: Yes
    ;   Display Name: sipuser
    ;   User Name: sipuser
    ;   Authorization User: sipuser
    ;   Password: sippassword
    ;   SIP Proxy: <your Asterisk server IP address>
    ;
    ; You can get X-Lite at:
    ; http://www.counterpath.com/
    ; ---------------------------------------------------------

[sipuser]
type=friend
host=dynamic
secret=sippassword
context=outgoing
canreinvite=no
allow=all




extensions.conf


Code: Select all
     ; Sample /etc/asterisk/extensions.conf
    ; File Version 080812
    ; Created September 1, 2004
    ; Updated Jun 24, 2008 to fix bug with int'l calls
    ; Updated Jul 9, 2008 to support jfk/sjc
    ; Updated Aug 8, 2008 to reflect changes in sip.conf
    ;
    ; Copyright (c) 2003-2008 VoicePulse Inc.
    ; VoicePulse is a registered trademark of VoicePulse Inc.
    ;
    ; =========================================================
    ; QUICKSTART WITH VOICEPULSE CONNECT FOR ASTERISK
    ;
    ; * Login to your VoicePulse for Business & Wholesale account:
    ;   http://connect.voicepulse.com/
    ;
    ; * Go to the API page to see your API key
    ;
    ; * Do a text search & replace in this file:
    ;   - Replace MY_API_KEY with your API key
    ;   - There should be 1 occurrence
    ;   - Don't replace VOICEPULSE_API_KEY by mistake!
    ;
    ; * Test your incoming and outgoing calls using the test
    ;   programs mentioned in sip.conf
    ;
    ; * Incoming calls should read back your number and any
    ;   digits you press
    ;
    ; * After testing, modify the OUTGOING CONTEXT and
    ;   INCOMING CONTEXT per your requirements.
    ;
    ; =========================================================


    ; ---------------------------------------------------------
    ; GENERAL SETTINGS
    ;
    ; ---------------------------------------------------------
   
[general]
static=yes
writeprotect=no




    ; ---------------------------------------------------------
    ; GLOBAL SETTINGS
    ;
    ; ---------------------------------------------------------

[globals]

    ; .........................................................
    ; API Settings
    ;
    ; MY_API_KEY is the key found in your Account Center.
    ;
    ; VOICEPULSE_API_PREFIX is to prevent naming conflicts
    ; between your own variables and the ones returned by the
    ; VoicePulse API.  When you run an API macro, like
    ; [macro-voicepulseflexrate], it will set a number of local
    ; variables based on the response.  These variable names
    ; will be prefixed with the VOICEPULSE_API_PREFIX that is
    ; defined below.
    ;
    ; To access the variables set by the API, you can refer to
    ; them by doing:
    ;
    ; ${VOICEPULSE_FLEXRATE}
    ;
    ; This is a variable "FLEXRATE" returned by the API and
    ; prefixed with "VOICEPULSE_" defined below.
    ;
    ; .........................................................

VOICEPULSE_API_KEY=LONGAPIKEYGOESHERE
VOICEPULSE_API_PREFIX=VOICEPULSE_

    ; .........................................................
    ; Peers
    ; .........................................................

VOICEPULSE_GATEWAY_OUT_A=voicepulse-primary
VOICEPULSE_GATEWAY_OUT_B=voicepulse-backup




    ; ---------------------------------------------------------
    ; VOICEPULSE FLEXRATE MACRO
    ;
    ; This macro will return realtime pricing so you may do
    ; your own least cost routing between VoicePulse and your
    ; other termination providers.
    ;
    ; To use this macro, use the following line in your
    ; outgoing context:
    ;
    ; exten => _XX.,n,Macro(voicepulseflexrate,${VOICEPULSE_API_KEY},${EXTEN})
    ;
    ; The macro will set the VOICEPULSE_FLEXRATE variable to
    ; a decimal value.  Test the value of that variable against
    ; your other providers' flat rate value to determine if the
    ; VoicePulse rate is lower and where to send the call.  One
    ; way to do this is using the GotoIf() command:
    ;
    ; exten => _XX.,n,GotoIf($[${VOICEPULSE_FLEXRATE} < 0.013]?outgoing|${EXTEN}|1:otheritsp-outgoing|${EXTEN}|1)
    ;
    ; This statement assumes you are using a provider with a
    ; flat $0.013 rate to the US.  The statement checks if the
    ; VOICEPULSE_FLEXRATE is lower.  If so, send the call through
    ; VoicePulse using the [outgoing] context (as configured
    ; in this sample file).  Otherwise, send the call through
    ; some other ITSP using the [otheritsp-outgoing] context
    ; (which does not exist in this sample file).
    ;
    ; Copyright (c) 2008 V-o-i-c-e-P-u-l-s-e Inc.
    ;
    ; ---------------------------------------------------------

[macro-voicepulseflexrate]
exten => s,1,Set(${VOICEPULSE_API_PREFIX}FLEXRATE=999)
exten => s,2,Set(${VOICEPULSE_API_PREFIX}FLEX_RATE=999)
exten => s,n,Set(VoicePulsePostData=ApiKey=${ARG1}&PhoneNumber=${ARG2})
exten => s,n,Set(VoicePulseResponse=${CURL(https://connect.voicepulse.com/secure/services/Api0605.asmx/AstGetFlexRate|${VoicePulsePostData})})
exten => s,n,Macro(voicepulseparseresponse,${VoicePulseResponse})

[macro-voicepulseparseresponse]
exten => s,1,Set(VoicePulseTemp=${ARG1})
exten => s,n,Set(VoicePulseTemp=${CUT(VoicePulseTemp,>,2-)})
exten => s,n,Set(VoicePulseTemp=${CUT(VoicePulseTemp,>,2-)})
exten => s,n,Set(VoicePulseTemp=${CUT(VoicePulseTemp,<,1)})
exten => s,n,Set(VoicePulseCounter=${FIELDQTY(VoicePulseTemp,~)})
exten => s,n,While($[${VoicePulseCounter} > 0])
exten => s,n,Set(VoicePulsePair=${CUT(VoicePulseTemp,~,${VoicePulseCounter})})
exten => s,n,Set(VoicePulseKey=${CUT(VoicePulsePair,=,1)})
exten => s,n,Set(VoicePulseValue=${CUT(VoicePulsePair,=,2)})
exten => s,n,Set(${VOICEPULSE_API_PREFIX}${VoicePulseKey}=${VoicePulseValue})
exten => s,n,Set(VoicePulseCounter=$[${VoicePulseCounter}-1])
exten => s,n,EndWhile()




    ; ---------------------------------------------------------
    ; OUTGOING CONTEXT
    ;
    ; [outgoing] is the context referred to by the test user
    ; [sipuser] in sip.conf. 
    ; This is where your custom outgoing call processing should
    ; go.
    ;
    ; Outgoing calls should be dialed in proper e164 format:
    ;   +<countrycode><number>
    ;
    ; For example:
    ;   +17323395100 or
    ;   +441234567890
    ; ---------------------------------------------------------

[outgoing]

    ; .........................................................
    ; NANPA calls
    ; .........................................................
   
    ; Set your CallerID number
    ; Setting both the name and number is required due to
    ; non-standard SIP behavior by previous versions of Asterisk.
    ;
    ; The CallerID number must be a 10-digits.

exten => _1NXXNXXXXXX,1,Set(CALLERID(num)=0000000000)
exten => _1NXXNXXXXXX,2,Set(CALLERID(name)=0000000000)

    ; Print the SIP Call-ID to the CLI for troubleshooting.
    ; You can send this Call-ID to customer service when asked
    ; for a call example that may have experienced an issue.
   
exten => _1NXXNXXXXXX,n,NoOp(SIPCALLID: ${SIPCALLID})

    ; .........................................................
    ; LEAST COST ROUTING
    ;
    ; Uncommenting the lines below will:
    ; - Tell Asterisk that your non-VoicePulse flat rate for
    ;   calls is $0.013
    ; - Look up the realtime rate VoicePulse will charge for
    ;   this call
    ; - Print the rate to the Asterisk CLI
    ; - Check which rate is lower
    ; - If the non-VoicePulse rate is lower, it will send your
    ;   call through the other provider
    ; - If the VoicePulse rate is lower, it will go to the next
    ;   priority below and send the call through VoicePulse
    ;
    ; exten => _1NXXNXXXXXX,n,Set(OTHER_PROVIDERS_FLAT_RATE=0.013)
    ; exten => _1NXXNXXXXXX,n,Macro(voicepulseflexrate,${VOICEPULSE_API_KEY},${EXTEN})
    ; exten => _1NXXNXXXXXX,n,Verbose(The rate is ${VOICEPULSE_FLEXRATE})
    ; exten => _1NXXNXXXXXX,n,GotoIf($[${VOICEPULSE_FLEXRATE} > ${OTHER_PROVIDERS_FLAT_RATE}]?${EXTEN}|SomeOtherProvider)
    ; exten => _1NXXNXXXXXX,n(SomeOtherProvider),Dial(SIP/SomeOtherProvider)
    ; .........................................................

    ; Send your call to VoicePulse using SIP
    ; VoicePulse recommends using SIP due to its ability to
    ; separate signalling and media traffic, resulting in a more
    ; robust and reliable architecture.  Using SIP will allow you
    ; to take full advantage of VoicePulse's various failover
    ; mechanisms now and in the future.
   
exten => _1NXXNXXXXXX,n,Dial(SIP/+${EXTEN}@${VOICEPULSE_GATEWAY_OUT_A})
exten => _1NXXNXXXXXX,n,GotoIf($[${DIALSTATUS}=CHANUNAVAIL]?${EXTEN}|GatewayB)
exten => _1NXXNXXXXXX,n(GatewayB),Dial(SIP/+${EXTEN}@${VOICEPULSE_GATEWAY_OUT_B})


    ; .........................................................
    ; International calls
    ; .........................................................
   
    ; Set your CallerID number
    ; The CallerID number must be a 10-digits.

exten => _011XXXX.,1,Set(CALLERID(num)=0000000000)

    ; Print the SIP Call-ID to the CLI for troubleshooting.
    ; You can send this Call-ID to customer service when asked
    ; for a call example that may have experienced an issue.
   
exten => _011XXXX.,n,NoOp(SIPCALLID: ${SIPCALLID})

    ; .........................................................
    ; LEAST COST ROUTING
    ;
    ; Uncommenting the lines below will:
    ; - Tell Asterisk that your non-VoicePulse flat rate for
    ;   international calls is $0.50
    ; - Look up the realtime rate VoicePulse will charge for
    ;   this call
    ; - Print the rate to the Asterisk CLI
    ; - Check which rate is lower
    ; - If the non-VoicePulse rate is lower, it will send your
    ;   call through the other provider
    ; - If the VoicePulse rate is lower, it will go to the next
    ;   priority below and send the call through VoicePulse
    ;
    ; exten => _011XXXX.,n,Set(OTHER_PROVIDERS_FLAT_RATE=0.50)
    ; exten => _011XXXX.,n,Macro(voicepulseflexrate,${VOICEPULSE_API_KEY},${EXTEN})
    ; exten => _011XXXX.,n,Verbose(The rate is ${VOICEPULSE_FLEXRATE})
    ; exten => _011XXXX.,n,GotoIf($[${VOICEPULSE_FLEXRATE} > ${OTHER_PROVIDERS_FLAT_RATE}]?${EXTEN}|SomeOtherProvider)
    ; exten => _011XXXX.,n(SomeOtherProvider),Dial(SIP/SomeOtherProvider)
    ; .........................................................

    ; Send your call to VoicePulse using SIP
    ; VoicePulse recommends using SIP due to its ability to
    ; separate signalling and media traffic, resulting in a more
    ; robust and reliable architecture.  Using SIP will allow you
    ; to take full advantage of VoicePulse's various failover
    ; mechanisms now and in the future.
   
exten => _011XXXX.,n,Dial(SIP/+${EXTEN:3}@${VOICEPULSE_GATEWAY_OUT_A})
exten => _011XXXX.,n,GotoIf($[${DIALSTATUS}=CHANUNAVAIL]?${EXTEN}|GatewayB)
exten => _011XXXX.,n(GatewayB),Dial(SIP/+${EXTEN:3}@${VOICEPULSE_GATEWAY_OUT_B})


    ; ---------------------------------------------------------
    ; INCOMING CONTEXT
    ;
    ; [voicepulse-in] is the context referred to by the
    ; [voicepulse-primary] peer in sip.conf or the
    ; [voicepulse-backup] peer in sip.conf
    ;
    ; This is where your custom incoming call processing should
    ; go.
    ;
    ; IMPORTANT: Incoming calls from VoicePulse will have an
    ; extension of country code + number, so calls from US
    ; numbers will be 1 + area code + number (11 digits).
    ; ---------------------------------------------------------

[voicepulse-in]

    ; .........................................................
    ; This section catches calls coming from VoicePulse.
    ;
    ; The extension used below will catch your incoming calls
    ; regardless of what phone numbers are on your VoicePulse
    ; Connect for Asterisk account:
    ;
    ; exten => _XX.
    ;
    ; If you would like to route your calls based on different
    ; incoming phone numbers (YOUR numbers, not the caller's
    ; number), use:
    ;
    ; exten => _17325550000,1,Dial(SIP/sipuser)
    ; exten => _17325550001,1,Dial(SIP/john)
    ; ...
    ; ...
    ; ...
    ;
    ; Copyright (c) 2008 V-o-i-c-e-P-u-l-s-e Inc.
    ;
    ; For sample purposes, this section will ring your test
    ; SIP phone.  For this to
    ; work:
    ; - You must have a test phone setup using the test user
    ;   found at the end of sip.conf
    ; - You must order a phone number on your account
    ; - You must dial that phone number from a different phone
    ;
    ; .........................................................

exten => _XX.,1,NoOp(Call received from VoicePulse)
exten => _XX.,n,Dial(SIP/sipuser)




    ; ---------------------------------------------------------
    ; BANNED CONTEXT
    ;
    ; This context is used by unauthorized incoming or
    ; outgoing calls
    ; ---------------------------------------------------------

[banned]
exten => i,1,Hangup
exten => t,1,Hangup

 

mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby infamoose » Wed Nov 18, 2009 2:13 pm

Thanks!

Plugging this in now. By the way, do I need to comment out any of the sip-vicidial.conf and extensions-vicidial.conf or do I leave the 91XXXNXXX open... I've read otherwise in some support forums?
infamoose
 
Posts: 9
Joined: Mon Nov 16, 2009 2:14 am

Postby mflorell » Wed Nov 18, 2009 7:11 pm

Don't forget to have this before any "Dial" line:

exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)


If it's not in there then ViciDial dialing will not work.
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby infamoose » Wed Nov 18, 2009 7:15 pm

Okay so I am pasting these in now, thanks for the help. One last question at this point. I do no see the # include sip-vicidial.conf or the # include extensions.vicidial.conf? Should these be added to the two files or are they now obsolete?
infamoose
 
Posts: 9
Joined: Mon Nov 16, 2009 2:14 am

Postby infamoose » Wed Nov 18, 2009 7:39 pm

mflorell wrote:Don't forget to have this before any "Dial" line:

exten => _91999NXXXXXX,1,AGI(agi://127.0.0.1:4577/call_log)


If it's not in there then ViciDial dialing will not work.



Okay, that kind of throws a wrench in things. What do "Dial" lines look like? Where will that go and in what files? sip.conf or extensions.conf
infamoose
 
Posts: 9
Joined: Mon Nov 16, 2009 2:14 am

Postby mflorell » Wed Nov 18, 2009 7:46 pm

Anything that dials out your carrier(not phones), like this:

exten => _011XXXX.,n,Dial(SIP/+${EXTEN:3}@${VOICEPULSE_GATEWAY_OUT_A})
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida

Postby infamoose » Wed Nov 18, 2009 8:13 pm

Got it. Adding that now. Also do I need to include the sip-vicidial and extensions-vicidial conf files? I am now only able to see (using the .conf files from the forums) sipuser and the trunks. Should I be included the *-vicidial.conf files in the sip.conf and extensions.conf? Please advise.
infamoose
 
Posts: 9
Joined: Mon Nov 16, 2009 2:14 am

Postby mflorell » Thu Nov 19, 2009 6:19 am

You need to be using the extensions.conf file that ViciDial installs, or working from that file or ViciDial will not work. That file should already have the include in it, same with the default sip.conf file.

You should just be adding what you need into your Web-based Carriers entry in admin.php, not editing the conf files directly.
mflorell
Site Admin
 
Posts: 18406
Joined: Wed Jun 07, 2006 2:45 pm
Location: Florida


Return to Support

Who is online

Users browsing this forum: Google [Bot] and 85 guests