5

I've read every forum on here, asterisk.org and google about this matter and still can't get it right. Here are the the SIP details. SIP Domain sip.provider.com:5060 Outbound Proxy sip10.provider.com:5090 User Name 1386269xxxx Password 123456789 Authorization ID 123456789 (Auth ID and Password are the same)

As i said i tried to google it but all the tutorials show example without different host names and auth id. I do not know how to describe it in sip.conf. Also have to use this sip trunk to inbound and outbound calling both. And these tutorials are saying type=peer. So i am puzzled because i think it shoud be type=friend. Please help.

Harsh
  • 53
  • 1
  • 6

1 Answers1

3

Here's what I would set in sip.conf

register => username:[email protected]

[myprovidername]
host=sip10.provider.com
outboundproxy=sip10.provider.com:5090
type=friend
fromuser=username
defaultuser=username
secret=password
context=myproviderinbound
  1. Regarding "register =>" I don't know if your sip provider requires it, but... My guess is that it will. So add this line, that's how your sip provider will call you (so it knows your IP)

Now, you should be able to call now, originate a call from the command line:

asterisk*CLI> channel originate SIP/myprovidername/8005551212 application playback demo-congrats

To receive a call, now add a context in extensions.conf with the name from your sip.conf and answer the call, like:

[myproviderinbound]
exten => _X.,1,Answer()
same =>      n,Playback(demo-congrats)
same =>      n,Hangup()

When you're done, make sure to reload sip.conf & extensions.conf by issuing:

asterisk*CLI> sip reload
asterisk*CLI> dialplan reload
dougBTV
  • 2,494
  • 1
  • 17
  • 17
  • Thnx for the reply, and i am really very sry that i am reverting today only. Was out of town for last some days and also had lost a hope to an answer here. Thnx again. I will try this really quick tomorrow and get back to you with the final result. Really appretiate that thnx. Also the settings i mentioned in question are the one i got from my sip provider and they are meant to be used in X-lite type of softphones. Just a quick question.. Can these setting be really used in Asterisk as i do not have any other details apart form the one mentioned above, like no reg string & nothing else as well – Harsh May 12 '13 at 14:12
  • Also in the sip.conf as you mentioned above.. Will it be host=sip.provider.com or host=sip10.provider.com – Harsh May 12 '13 at 14:15
  • My guess is that it will wind up being host=sip10.provider.com – dougBTV May 13 '13 at 12:58
  • Awesome that is working now and getting registered. Thnx for this really. You have saved my soul. I was trying to get this thing registered from last two months now and no one was helping me. Although it's getting registerd now but when i dial that number from my mobile it says "this number is not in service", but i can see the call coming in Asterisk CLI mode. Thnx for this. I think i have to work on my FreePBX incoming and outgoing routes that i will try to find out even harder now. – Harsh May 13 '13 at 23:38
  • Do you have any idea why is it saying that? Even if no still thnx thnx thnx – Harsh May 13 '13 at 23:38
  • @Harsh -- what do you see in the Asterisk CLI when the call comes inbound? I'm very glad this helped :) !!! At least getting this far. – dougBTV May 14 '13 at 14:25
  • i can send you an screen shot for that. How will you like it?? Debug On or OFF? @dougBTV – Harsh May 14 '13 at 14:59
  • Copy and paste from your terminal, delete any sensitive information, paste here http://www.pasteall.org/ and then send the link here. Debug can be off. My guess is it's a dialplan problem. Or, it's my best guess. – dougBTV May 14 '13 at 15:07
  • Can i email you that later if that is possible and you won't mind. Don't worry i will not flood your email account with messages. – Harsh May 14 '13 at 15:47
  • here is the [link](http://www.pasteall.org/42230) Also FYI i am using FREEPBX GUI. – Harsh May 14 '13 at 15:52
  • I think you're really close! Asterisk is indeed taking your inbound call, but... Something with FreePBX is saying there's no open lines. Check your configuration for outbound calls. I'm more of a pure Asterisk guy, I don't use FreePBX, so specifically, I can't say. – dougBTV May 14 '13 at 17:38
  • Yup same is i think as well. I will try to configure it into Asterisk directly and see if it works. BTW can i contact you again if i face any difficulties while i am doing that on Asterisk directly. Also is there a tutorial that i can look for to clear "context". I am still puzzled that what is context? – Harsh May 14 '13 at 17:53
  • Join #laboratoryb on Freenode if you'd like. I would highly recommend you read the book "Asterisk: The Future of Telephony" -- it's a quick read and there's LOTS of great examples. Also! It's free, just google it you'll find it right away. A context is just an organized block of code in your dialplan (extensions.conf), for each line/trunk/phone (e.g. something in sip.conf) you'll need to set a context=THING and then THING will be in your dialplan (extensions.conf) as [THING] -- that will be the code executed when an incoming call comes in on that line/trunk/phone etc. – dougBTV May 14 '13 at 18:50
  • ooh.. i was thinking of something else. Thnx for that, i will just download that book and go through it. Thnx and i really appretiate it. Also one out of box question... Is linux a goof field to future? I mean i think linux is a good way for career rather than going for CCNA or MCSE kind of fields as there are already a lot of people in that and i am just 21, is that so? – Harsh May 14 '13 at 19:53
  • Is there a way i can capture the incoming call CLI on my softphone and use it to search in my PHP-MySQl based local CRM to display result on a browser on the same computer?? Any guess would help. – Harsh May 15 '13 at 11:19