Multiple SIP client channels & s extension forwarding

Hello everybody.

I’m new in Asterisk world, and I have a question.

I want to have an Asterisk PBX which will be connected to another running Asterisk PBX (from my phone provider).

As my phone provider don’t want to deliver a SIP trunk for me, I want to rgister three or four SIP extensions on my PBX as SIP client and forward each one for diferent incoming contexts.

It is possible?

Actually, I have:

[quote]in sip.conf:

[general]

register => op1_line_user:op1_line_password@op_domain
register => op2_line_user:op2_line_password@op_domain

[conex-line1]
type=friend
host=xxx
username=yyy
secret=zzz
qualify=yes
insecure=invite
dtmfmode=auto
disallow=all
allow=alaw
canreinvite=no
context=IncomingLine1Context

[conex-line2]
type=friend
host=xxx
username=yyy
secret=zzz
qualify=yes
insecure=invite
dtmfmode=auto
disallow=all
allow=alaw
canreinvite=no
context=IncomingLine2Context

In extensions.conf:

[IncomingLine1Context]
exten => s,1,Verbose(2,Any text…)
same => n,GotoIfTime(,,1,jan?label1)
;more priorities for the s extension in IncomingLine1Context

[IncomingLine2Context]
exten => s,1,Verbose(2,Any text…)
same => n,GotoIfTime(,,1,jan?label2)
;more priorities for the s extension in IncomingLine2Context
…[/quote]

Is this configuration OK?
Is not possible to have the s extension in both incoming contexts??
I don’t know which is the problem, but any call incoming to the PBX (indiferent to the incoming channel) go always to the first incoming context.

Thanks in advanced!

Regards.

Probably not. You will certainly not have calling line ID. I can’t remember if Asterisk checks address or From: first. In the former case it definitely won’t work.

You may be able to do it by using one context.

I was sniffing sip traffic in the Asterisk PBX, and I checked that:

  • The SIP From header is: sip:caller_id@voip_provider_ip
  • The SIP To header is: sip:s@my_asterisk_ip

Then, in my oppinion, I haven’t any information to identify the destination and use only one incoming context. Any idea to do it?

I have only one idea which is not working:

  • One registered extension in voip provider = one channel for my PBX => one incoming context for any channel.
    With this configuation, I think that s@my_asterisk_ip signaling packets must be forwarded to the incoming context associated with the each channel, because the channel must dump all his calls in the selected context.

Has anybody another idea to do it, please?

Regards.

If the From header is the real caller ID you should not be using friend, you should be using peer. Once you realise that peers match on IP address, it should be clear that only the context for the first matching peer will ever be used. If you want to distinguish, you must register with different callback extensions. If the provider won’t allow this, and won’t allow the caller ID to be the “line” id, you don’t have a solution.

OK david55, thanks!!!
I will try your idea.

Regards.