SipSorcery with Asterisk

Getting started with the SIP Sorcery
Post Reply
BWilson21
Posts: 4
Joined: Thu Oct 13, 2011 4:29 am

SipSorcery with Asterisk

Post by BWilson21 » Thu Oct 13, 2011 4:36 am

I hoping I've posted this in the right place. I wasn't sure if it belonged under this board or the Technical Support area.

I'm looking for a way to connect my existing in-house Asterisk box with SipSorcery. I have my SipSorcery account setup, have it integrated with Google Voice and IPComms, and have confirmed that I am able to place call directly through it using a softphone. The problem is, when I setup my SipSorcery credentials in my Asterisk box, every call I place dies immediately with an error of

Spawn extension (default, ##########, 3) exited non-zero on 'SIP/cc100-00000004'

I realize that this is not an Asterisk support forum, but if anyone has been successful in connect an Asterisk box with SipSorcery, could you please let me know? Thanks in advance for your help.

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: SipSorcery with Asterisk

Post by Aaron » Thu Oct 13, 2011 9:01 am

There shouldn't be anything special required to get your Asterisk server working with sipsorcery. My guess would be a problem with your sipsorcery configuration in your sip.conf. Can you post it minus the sensitive buts like your username and password.

BWilson21
Posts: 4
Joined: Thu Oct 13, 2011 4:29 am

Re: SipSorcery with Asterisk

Post by BWilson21 » Thu Oct 13, 2011 1:44 pm

I wasn't quite sure how kosher it was to post asterisk information on here since this forum isn't devoted to that. I've provided the details from sip.conf below (user name and password removed).

[sipsorcery]
allow=all
type=friend
username=user
secret=secret
host=sipsorcery.com
fromuser=user

I confirmed in the console by running 'sip show peers' that the connection is made, the call is just denied immediately. To be a little more clear, here is the output from the console:


[Oct 13 09:42:13] -- Executing [1##########@default:1] AGI("SIP/user-00000000", "agi://127.0.0.1:4577/call_log") in new stack
[Oct 13 09:42:13] -- AGI Script agi://127.0.0.1:4577/call_log completed, returning 0
[Oct 13 09:42:13] -- Executing [1##########@default:2] Dial("SIP/user-00000000", "SIP/##########@sipsorcery") in new stack
[Oct 13 09:42:13] -- Called ##########@sipsorcery
[Oct 13 09:42:14] -- SIP/sipsorcery-00000001 is circuit-busy
[Oct 13 09:42:14] == Everyone is busy/congested at this time (1:0/1/0)
[Oct 13 09:42:14] -- Executing [1##########@default:3] Hangup("SIP/user-00000000", "") in new stack
[Oct 13 09:42:14] == Spawn extension (default, 1##########, 3) exited non-zero on 'SIP/user-00000000'
[Oct 13 09:42:14] -- Executing [h@default:1] DeadAGI("SIP/user-00000000", "agi://127.0.0.1:4577/call_log--HVcauses--PRI-----NODEBUG-----1-----CONGESTION----------") in new stack

BWilson21
Posts: 4
Joined: Thu Oct 13, 2011 4:29 am

Re: SipSorcery with Asterisk

Post by BWilson21 » Thu Oct 13, 2011 2:56 pm

Progress made, but not totally done. After some further digging, I found in the Asterisk forum where another user had a similar problem and was able to resolve it using the following entry in sip.conf:

[sipsorcery]
context=sipsorcery
fromdomain=sipsorcery.com
fromuser=user
host=sipsorcery.com
insecure=port,invite
secret=secret
type=peer
defaultuser=user

I changed my configuration to match this, and the call went through. Now, when the other side answers, there is no sound on either end. I realize this is a separate issue, but for completeness, I'll continue working on this and post the outcome in case someone else down the line come across this thread with the same questions.

BWilson21
Posts: 4
Joined: Thu Oct 13, 2011 4:29 am

[SOLVED] SipSorcery with Asterisk

Post by BWilson21 » Thu Oct 13, 2011 8:02 pm

It was without a question an asterisk problem. I changed the content in sip.conf to what is listed below, and it works. Awesome telephony service, Aaron!

[sipsorcery]
type=friend
insecure=invite
nat=yes
username=user
fromuser=user
fromdomain=sipsorcery.com
secret=secret
host=sipsorcery.com
qualify=yes
canreinvite=no
dtmfmode=rfc2833
context=sipsorcery

Aaron
Site Admin
Posts: 4652
Joined: Thu Jul 12, 2007 12:13 am

Re: SipSorcery with Asterisk

Post by Aaron » Fri Oct 14, 2011 11:23 am

Glad you got it working. Just as an fyi in the configuration you've shown you don't need the fromuser and fromhost setting since they will only serve to overrule username and host and in your case they are the same. You do need to be especially careful when you set the fromuser field as it will replace the username in the From header and potentially break authentication. Typically it would only be used when you have a SIP trunk set up by IP address or where you are sending calls to a end user agent that doesn't require authentication.

Post Reply