Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread Filip Drągowski
I think that context=incoming-[number] in firends definion is used 
rather for determinig context for outgoing calls.
In sip.conf [general] section there is context=  and 
register=/[extension]
i think that extension in register line should be in context specified 
in [general] context=[context]
 


register = :[EMAIL PROTECTED]/
register = :[EMAIL PROTECTED]/

[]
type=friend
context=incoming-

[]
type=friend
context=incoming-




___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread Benjamin Stocker
2006/7/20, voiplist [EMAIL PROTECTED]:
On 7/20/06, Mat Stace [EMAIL PROTECTED] wrote: I'm not exactly sure on the /how/ * mathes items from the sip.conf (I suspect it goes to the latter for whichever provider), but the way
 configured my extenions.conf to handle multiple incoming accounts from sipgate is like this (obviously much simplified for ease of explanation): [incoming_sipgate] exten = ,1,Answer
 exten = ,2,Dial(SIP/ciscophone,12) exten = ,1,Answer exten = ,2,Dial(SIP/pcsoftphone,12) Also, in the sip.conf, each peer has context=incoming_sipgate in it.
 HTH, Mat-Original Message- From: [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED]] On Behalf Of Benjamin Stocker Sent: 20 July 2006 16:05 To: Asterisk Users Mailing List Subject: [asterisk-users] Two phone numbers, one SIP provider
 Hi I have two phone numbers from my SIP provider sippro.com, say  and . I use two sip.conf entries to register this phone numbers:
 register = :[EMAIL PROTECTED]/ register = :[EMAIL PROTECTED]/ []
 type=friend username= secret=pass insecure=very host= sip.sippro.com context=incoming- [] type=friend
 username= secret=pass insecure=very host=sip.sippro.com context=incoming- Now, from my dialplan I can use them to do outgoing calls, like
 Dial(SIP/[EMAIL PROTECTED]). That works pretty fine. The problem are incoming calls. According to [1] asterisk should lookup a match in sip.conf when somebody (outside sippro.com
) calls  or . For example, a call to  should look for a extension in context 'incoming-'. A call for  should go to context incoming-. But in the above scenario, asterisk always gets a
 match on ''. As a result, context 'incoming-' is always used. How does asterisk search for a match in sip,conf for incoming calls and how can I get it to use the context specified in the account settings?
 1. http://www.voip-info.org/wiki/view/Asterisk+config+sip.confI think it might be finding a match on the host= field.
I could be totally wrong here but this might be worth a try.If it IS the host which is matching, you might try splitting up theincoming and outgoing context. This way, you can remove the host entry
from the incoming context completely.So something like this:[]type=friendusername=secret=passinsecure=verycontext=incoming-[]type=friendusername=
secret=passinsecure=verycontext=incoming-[sippro_out]type=peerhost=sip.sippro.comusername=;OR secret=passThen in your dial string use:
Dial(SIP/[EMAIL PROTECTED])Let us know how it works out..Removing the 'host=' directive has a effect, but not the expected one: Context is always 'default' when no host is specified. There are some comments on [1] discussing the same problem, see the comment from rodriguez_chapa.
1. http://www.voip-info.org/wiki/view/Asterisk+SIP+user+vs+peer
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread David Cook

From: Filip Dr?gowski [EMAIL PROTECTED]

Subject: Re: [asterisk-users] Two phone numbers, one SIP provider
To: Asterisk Users Mailing List - Non-Commercial Discussion
asterisk-users@lists.digium.com
Message-ID: [EMAIL PROTECTED]
Content-Type: text/plain; charset=ISO-8859-2; format=flowed

I think that context=incoming-[number] in firends definion is used 
rather for determinig context for outgoing calls.
In sip.conf [general] section there is context=  and 
register=/[extension]
i think that extension in register line should be in context specified 
in [general] context=[context]
  
 


register = :[EMAIL PROTECTED]/
register = :[EMAIL PROTECTED]/
  


I am only using inbound IAX but I do have multiple DID's from the same 
provider and I hope the action of parsing the files is the same. I don't 
think you want the extensions listed after the host. The following is 
what I have for my IAX trunks


; Registrations for remote IAX servers (dynamic config)
register = 416xxx:[EMAIL PROTECTED]   ; Home line
register = 416yyy:[EMAIL PROTECTED]   ; Business line

Both calls happily go to contexts [416xxx] and [416] 
respectively.


dbc.

___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread Benjamin Stocker
2006/7/21, David Cook [EMAIL PROTECTED]:
From: Filip Dr?gowski [EMAIL PROTECTED] Subject: Re: [asterisk-users] Two phone numbers, one SIP provider To: Asterisk Users Mailing List - Non-Commercial Discussion
 asterisk-users@lists.digium.com Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-2; format=flowed
 I think that context=incoming-[number] in firends definion is used rather for determinig context for outgoing calls. In sip.conf [general] section there is context=and register=/[extension]
 i think that extension in register line should be in context specified in [general] context=[context] register = 
:[EMAIL PROTECTED]/ register = :[EMAIL PROTECTED]/I am only using inbound IAX but I do have multiple DID's from the same
provider and I hope the action of parsing the files is the same. I don'tthink you want the extensions listed after the host. The following iswhat I have for my IAX trunks; Registrations for remote IAX servers (dynamic config)
register = 416xxx:[EMAIL PROTECTED] ; Home lineregister = 416yyy:[EMAIL PROTECTED] ; Business line
Both calls happily go to contexts [416xxx] and [416]respectively.That won't help either. Context is always 'default', but what I want is a different context on any number. Maybe oej's peermatch branch solves the problem. But I cannot compile it, There are lots of ' merge right' tags in chan_sip.c.

___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread Filip Drągowski




Diffrent context:
[default]
 = goto(|s|1)
 = goto(|s|1)
then You can hadle incoming calls in diffrent contexts

  
  
  
register = 
:[EMAIL PROTECTED]/
register = :[EMAIL PROTECTED]/

  
  
  
That won't help either. Context is always 'default', but what I want is
a different context on any number. Maybe oej's peermatch branch solves
the problem. But I cannot compile it, There are lots of
' merge right' tags in chan_sip.c.
  
  





___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread Benjamin Stocker

2006/7/21, Filip Drągowski [EMAIL PROTECTED]:



 Diffrent context:
 [default]
  = goto(|s|1)
  = goto(|s|1)
 then You can hadle incoming calls in diffrent contexts


Thanks for the solution. This would be really a way to solve the
problem. Storing number=context pairs in the Asterisk database could
be another solution:

 DBPut(numtocontext/=incoming-)
 DBPut(numtocontext/=incoming-)
 ...

and then retrieve the context in the dialplan:

 DBGet(TARGETCONTEXT=numtocontext/${EXTEN})

Anyway, I stil won't give up trying to relay incoming calls *directly*
to a context by defining a sip account similar to this:

[]
type=friend ; (or peer or user)
username=
...
context=incoming- ; = = Go to this context on incoming calls

According to [1], it should work:

context= context_name : If type=user, the Context for the inbound
call from this SIP user definition. If type=peer, the Context in the
dialplan for outbound calls from this SIP peer definition. If
type=friend the context used for both inbound and outbound calls
through the SIP entities definition. If no type=user entry matches an
inbound call, then a type=peer or type=friend will match if the
hostname or IP address defined in host= matches.

1. http://www.voip-info.org/wiki-Asterisk+config+sip.conf
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [asterisk-users] Two phone numbers, one SIP provider

2006-07-21 Thread Mat Stace
Title: Message



That won't help either. Context is 
always 'default', but what I want is a different context on any number. Maybe 
oej'speermatch branch solves the problem. But I cannot compile it, There are lots 
of ' merge right' tags in 
chan_sip.c.

How about a slight modification of my 
solution:

extensions.conf

[incoming_sip_provider]


exten = 
,1,Goto(_context,s,1)

exten 
=,1,Goto(_context,s,1)

That should seperate out the two incoming calls, and 
give each one access to what they need access 
to?

Cheers

Mat
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


RE: [asterisk-users] Two phone numbers, one SIP provider

2006-07-20 Thread Mat Stace
Title: Message



I'm 
not exactly sure on the /how/ * mathes items from the sip.conf (I suspect it 
goes to the latter for whichever provider), but the way configured my 
extenions.conf to handle multiple incoming accounts from sipgate is like this 
(obviously much simplified for ease of explanation):


[incoming_sipgate]

exten 
= ,1,Answer
exten 
= ,2,Dial(SIP/ciscophone,12)


exten 
= ,1,Answer
exten 
= ,2,Dial(SIP/pcsoftphone,12)



Also, 
in the sip.conf, each peer has context=incoming_sipgate in 
it.
HTH,

Mat

-Original Message-From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Benjamin 
StockerSent: 20 July 2006 16:05To: Asterisk Users Mailing 
ListSubject: [asterisk-users] Two phone numbers, one SIP 
provider
HiI 
  have two phone numbers from my SIP provider sippro.com, say  and . I use two sip.conf 
  entries to register this phone numbers:register = :[EMAIL PROTECTED]/register 
  = :[EMAIL PROTECTED]/[]type=friendusername=secret=passinsecure=veryhost= 
  sip.sippro.comcontext=incoming-[]type=friendusername=secret=passinsecure=veryhost=sip.sippro.comcontext=incoming-Now, 
  from my dialplan I can use them to do outgoing calls, like 
  Dial(SIP/[EMAIL PROTECTED]). That works pretty fine. The problem are incoming calls. 
  According to [1] asterisk should lookup a match in sip.conf when somebody 
  (outside sippro.com) calls  or . For 
  example, a call to  should look for a extension in context 
  'incoming-'. A call for  should go to context incoming-. But in 
  the above scenario, asterisk always gets a match on ''. As a result, 
  context 'incoming-' is always used. How does asterisk search for a 
  match in sip,conf for incoming calls and how can I get it to use the context 
  specified in the account settings?1. http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf
  --No virus found in this incoming message.Checked by 
  AVG Free Edition.Version: 7.1.394 / Virus Database: 268.10.2/393 - Release 
  Date: 19/07/2006
  
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


Re: [asterisk-users] Two phone numbers, one SIP provider

2006-07-20 Thread voiplist

On 7/20/06, Mat Stace [EMAIL PROTECTED] wrote:



I'm not exactly sure on the /how/ * mathes items from the sip.conf (I
suspect it goes to the latter for whichever provider), but the way
configured my extenions.conf to handle multiple incoming accounts from
sipgate is like this (obviously much simplified for ease of explanation):


[incoming_sipgate]

exten = ,1,Answer
exten = ,2,Dial(SIP/ciscophone,12)


exten = ,1,Answer
exten = ,2,Dial(SIP/pcsoftphone,12)



Also, in the sip.conf, each peer has context=incoming_sipgate in it.
HTH,

Mat


 -Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf
Of Benjamin Stocker
Sent: 20 July 2006 16:05
To: Asterisk Users Mailing List
Subject: [asterisk-users] Two phone numbers, one SIP provider



Hi

I have two phone numbers from my SIP provider sippro.com, say  and .
I use two sip.conf entries to register this phone numbers:

register = :[EMAIL PROTECTED]/
register = :[EMAIL PROTECTED]/

[]
type=friend
username=
secret=pass
insecure=very
host= sip.sippro.com
context=incoming-

[]
type=friend
username=
secret=pass
insecure=very
host=sip.sippro.com
context=incoming-

Now, from my dialplan I can use them to do outgoing calls, like
Dial(SIP/[EMAIL PROTECTED]). That works pretty fine. The problem are incoming 
calls.
According to [1] asterisk should lookup a match in sip.conf when somebody
(outside sippro.com) calls  or . For example, a call to  should
look for a extension in context 'incoming-'. A call for  should go
to context incoming-. But in the above scenario, asterisk always gets a
match on ''. As a result, context 'incoming-' is always used.

How does asterisk search for a match in sip,conf for incoming calls and how
can I get it to use the context specified in the account settings?

1.
http://www.voip-info.org/wiki/view/Asterisk+config+sip.conf



I think it might be finding a match on the host= field.

I could be totally wrong here but this might be worth a try.

If it IS the host which is matching, you might try splitting up the
incoming and outgoing context. This way, you can remove the host entry
from the incoming context completely.

So something like this:

[]
type=friend
username=
secret=pass
insecure=very
context=incoming-

[]
type=friend
username=
secret=pass
insecure=very
context=incoming-

[sippro_out]
type=peer
host=sip.sippro.com
username=  ;OR 
secret=pass

Then in your dial string use:
Dial(SIP/[EMAIL PROTECTED])

Let us know how it works out..
___
--Bandwidth and Colocation provided by Easynews.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users