Channel Problem

I have two SIP channels (Vonage) set up on my asterisk@home installation. No matter which channel I dial into, it always appears as xxx-xxx-4531 even when dialing into xxx-xxx-4530. Any ideas? Below is my ext-did settings as well as a call log.

[ext-did]
include => ext-did-custom
exten => xxxxxxx4530,1,SetVar(FROM_DID=xxxxxxx4530) ;
exten => xxxxxxx4530,2,SetVar(Incoming=aa_4)
exten => xxxxxxx4530,3,Goto(from-pstn,s,1) ;
exten => xxxxxxx4531,1,SetVar(FROM_DID=xxxxxxx4531) ;
exten => xxxxxxx4531,2,SetVar(Incoming=aa_2)
exten => xxxxxxx4531,3,Goto(from-pstn,s,1) ;

Call Log - Inbound to xxxxxxx4530

Nov 11 09:53:01 VERBOSE[1960]: – Executing SetVar(“SIP/xxxxxxx4531-7a0e”, “FROM_DID=xxxxxxx4530”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Executing SetVar(“SIP/xxxxxxx4531-7a0e”, “Incoming=aa_4”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Executing Goto(“SIP/xxxxxxx4531-7a0e”, “from-pstn|s|1”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Goto (from-pstn,s,1)
Nov 11 09:53:01 DEBUG[1960]: Expression is '0’
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIf(“SIP/xxxxxxx4531-7a0e”, “0?from-pstn-reghours|s|1:”) in new stack
Nov 11 09:53:01 DEBUG[1960]: Not taking any branch
Nov 11 09:53:01 DEBUG[1960]: Expression is '0’
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIf(“SIP/xxxxxxx4531-7a0e”, “0?from-pstn-afthours|s|1:”) in new stack
Nov 11 09:53:01 DEBUG[1960]: Not taking any branch
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIfTime(“SIP/xxxxxxx4531-7a0e”, “8:30-17:00|mon-thu||?from-pstn-timecheck|s|5:”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Executing Goto(“SIP/xxxxxxx4531-7a0e”, “from-pstn-afthours|s|1”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Goto (from-pstn-afthours,s,1)
Nov 11 09:53:01 DEBUG[1960]: Expression is '1’
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIf(“SIP/xxxxxxx4531-7a0e”, “1?from-pstn-afthours-nofax|s|1:2”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Goto (from-pstn-afthours-nofax,s,1)
Nov 11 09:53:01 VERBOSE[1960]: – Executing SetVar(“SIP/xxxxxxx4531-7a0e”, “intype=aa_8”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Executing Cut(“SIP/xxxxxxx4531-7a0e”, “intype=intype|-|1”) in new stack
Nov 11 09:53:01 DEBUG[1960]: Expression is '0’
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIf(“SIP/xxxxxxx4531-7a0e”, “0?4:5”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Goto (from-pstn-afthours-nofax,s,5)
Nov 11 09:53:01 DEBUG[1960]: Expression is '0’
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIf(“SIP/xxxxxxx4531-7a0e”, “0?6:7”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Goto (from-pstn-afthours-nofax,s,7)
Nov 11 09:53:01 DEBUG[1960]: Expression is '0’
Nov 11 09:53:01 VERBOSE[1960]: – Executing GotoIf(“SIP/xxxxxxx4531-7a0e”, “0?8:11”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Goto (from-pstn-afthours-nofax,s,11)
Nov 11 09:53:01 VERBOSE[1960]: – Executing Answer(“SIP/xxxxxxx4531-7a0e”, “”) in new stack
Nov 11 09:53:01 VERBOSE[1960]: – Executing Wait(“SIP/xxxxxxx4531-7a0e”, “1”) in new stack

As can be seen above, it is using the proper FROM_DID but the channel is incorrect. Where should I be looking to correct this problem? Any ideas what is causing this problem? Any assistance you may offer is greatly appreciated.

Thanks,

Zach

What’s in the relevant register => statements in your sip.conf?

Willkemp,

Thank you for the reply. The register lines are below.

register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061
register=xxxxxxx4531:password@sphone.vopr.vonage.net:5061

Here is the entire sip_additional settings for the two Vonage trunks.

register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061
register=xxxxxxx4531:password@sphone.vopr.vonage.net:5061

[xxxxxxx4530]
username=xxxxxxx4530
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4530
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4531]
username=xxxxxxx4531
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4531
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

Please let me know if you have any ideas.

Try these instead:

register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061/4530
register=xxxxxxx4531:password@sphone.vopr.vonage.net:5061/4531

SIP calls can be directed to either SIP:host.address or SIP:extension@host.address. In the latter case, the local extension is supplied and there’s no ambiguity about what to do with the call. In the former case, if there’s an ‘s’ extension in the destination context, the call goes there. If there isn’t an ‘s’ extension, i’m not sure what’s supposed to happen - but whatever it is, it probably won’t be what you want to happen.

SIP service providers generally seem to use the first of those address formats and if you want the call to go to a specific extension (rather than the ‘s’ extension), you have to append the extension as above in the register statement.

Willkemp,

Thank you very much for the reply. I posted it a second time as some of the config changed.

I tried your suggested idea, and it did not work. I added both /4530 to the end of the register as well as the entire phone number /xxxxxxx4530 and neither one of these worked.

One small item I did discover, which ever context is the last one in the sip_additional settings, is the channel that it ends up using. As an example, below, it will be incoming on Channel 4531

[xxxxxxx2574]
username=xxxxxxx2574
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2574
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx2575]
username=xxxxxxx2575
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2575
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4530]
username=xxxxxxx4530
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4530
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4531]
username=xxxxxxx4531
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4531
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

When I then change it to the following, 2574 is the incoming channel being used

[xxxxxxx2575]
username=xxxxxxx2575
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2575
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4530]
username=xxxxxxx4530
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4530
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4531]
username=xxxxxxx4531
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4531
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx2574]
username=xxxxxxx2574
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2574
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

This is very strange to me and it seems to be an * problem possibly. Any further ideas?

The context from-pstn in the items above, is that telling it where to send the call upon arrival? I tried changing it to context-custom-xxxxxxx4530 for the 4530 number, and it did not work. Below were the settings I tried for the context custom-xxxxxxx4530.

[custom-xxxxxxx4530]
exten => xxxxxxx4530,1,Ringing
exten => xxxxxxx4530,2,Wait(2)
exten => xxxxxxx4530,3,SetVar(FROM_DID=xxxxxxx4530) ;
exten => xxxxxxx4530,4,SetVar(Incoming=aa_4)
exten => xxxxxxx4530,5,Goto(from-pstn,s,1) ;

With these settings, I just got a message stating the number is temporarily out of service. Any ideas?

Thanks Again,

Zach

[quote=“cdrx”]I tried your suggested idea, and it did not work. I added both /4530 to the end of the register as well as the entire phone number /xxxxxxx4530 and neither one of these worked.
[/quote]
Did you have extensions with those names in the relevant context?

If so, it suggests to me that the call is coming in addressed to an extension.

[quote]
One small item I did discover, which ever context is the last one in the sip_additional settings, is the channel that it ends up using.[/quote]
That is very weird! It’s so weird that i find it hard to believe (although i’m not doubting what you say is true).

[quote]
context=from-pstn
canreinvite=no
auth=md5

The context from-pstn in the items above, is that telling it where to send the call upon arrival?[/quote]
Yes. That determines where it will look for the extension to send the call to. So if you have, for example, a register statement like this

register => user:secret@sip.server/1234

and an account stanza that includes

[sipserver]
username=user
secret=secret
host=sip.server
context=from-pstn

etc…

then the call should be directed to extension 1234 in the [from-pstn] context - so long as it’s not arriving addressed to an extension (or maybe even then, i can’t remember now, but you can find out by reading the sip.conf page at voip-info.org/wiki/index.php … g+sip.conf )

WillKemp

Thanks once again for the reply. As I am new to *, I wanted to confirm one thing. From what I understand, if I use a register statement like

register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061/4530

Then I need to have a context created for 4530. Therefore, the context could look something like the following.

[4530]
exten => xxxxxxx4530,1,Ringing
exten => xxxxxxx4530,2,Wait(2)
exten => xxxxxxx4530,3,SetVar(FROM_DID=xxxxxxx2575)
exten => xxxxxxx4530,4,SetVar(Incoming=aa_4)
exten => xxxxxxx4530,5,Goto(from-pstn,s,1)

Is this correct? If so, then this means when a call comes into the registration above, it will then send it to the 4530 context directly above, correct? I appreciate your clarification on this matter for me, I just want to understand it fully before I make any modifications as it is a live system.

Thanks again, as always. If anyone else has any input on the previous posts regarding the problems I am experiencing, please do not hesitate to offer any assistance. LOL.

Thanks,

Zach

[quote=“cdrx”]From what I understand, if I use a register statement like

register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061/4530

Then I need to have a context created for 4530. Therefore, the context could look something like the following.

[4530]
exten => xxxxxxx4530,1,Ringing
exten => xxxxxxx4530,2,Wait(2)
exten => xxxxxxx4530,3,SetVar(FROM_DID=xxxxxxx2575)
exten => xxxxxxx4530,4,SetVar(Incoming=aa_4)
exten => xxxxxxx4530,5,Goto(from-pstn,s,1)

Is this correct?[/quote]
No, it’s not.

For the that to work, you’d have to use the following register line:

register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061/xxxxxxx4530

and - if you’re using the sip.conf stanza for that connection that you quoted in an earlier message - this in extensions.conf:

[from-pstn]
exten => xxxxxxx4530,1,Ringing
exten => xxxxxxx4530,2,Wait(2)
exten => xxxxxxx4530,3,SetVar(FROM_DID=xxxxxxx2575)
exten => xxxxxxx4530,4,SetVar(Incoming=aa_4)
exten => xxxxxxx4530,5,Goto(from-pstn,s,1)

WillKemp,

You have been extremely helpful. However, I am still having the same problems and it appears to me that the above has nothing to do with the incoming channel. Of course, I am trying to figure out why the Channel is always that of the last outbound registration context. This is very strange to me.

Once again, below are all of my settings from the Sip_additional.conf:

register=xxxxxxx2574:password@sphone.vopr.vonage.net:5061
register=xxxxxxx2575:password@sphone.vopr.vonage.net:5061
register=xxxxxxx4530:password@sphone.vopr.vonage.net:5061
register=xxxxxxx4531:password@sphone.vopr.vonage.net:5061

[xxxxxxx2574]
username=xxxxxxx2574
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2574
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx2575]
username=xxxxxxx2575
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2575
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4530]
username=xxxxxxx4530
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4530
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[xxxxxxx4531]
username=xxxxxxx4531
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx4531
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

[756]
username=756
type=friend
secret=xxxx
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=never
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid="" <756>

[770]
username=770
type=friend
secret=xxxx
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=yes
mailbox=770@default
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid="" <770>

[771]
username=771
type=friend
secret=xxxx
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=yes
mailbox=771@default
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid="" <771>

[772]
username=772
type=friend
secret=xxxx
record_out=On-Demand
record_in=On-Demand
qualify=no
port=5060
nat=never
host=dynamic
dtmfmode=rfc2833
context=from-internal
canreinvite=no
callerid="" <772>

When using the settings above, all calls come in on Channel xxxxxxx4531. If I then move the following

[xxxxxxx2574]
username=xxxxxxx2574
type=friend
secret=password
port=5061
nat=yes
insecure=very
host=sphone.vopr.vonage.net
fromuser=xxxxxxx2574
fromdomain=sphone.vopr.vonage.net
dtmfmode=rfc2833
context=from-pstn
canreinvite=no
auth=md5

from the first to fourth position, all calls come in oh the xxxxxxx2574 channel. This is extremely strange to me and I really would like to get it corrected. Replies from anybody are greatly appreciated.

Does anybody see anything that jumps out at them as to what could be causing this problem? * recognizes the correct FROM_DID but the channel is incorrect.

Thanks Again,

Zach

i reckon that if you ask your provider they’ll suggest you register each account on it’s own port-pairs, and not all on the same.

baconbuttie,

Thank you very much for the reply. I greatly appreciate the help you have offered.

Using vonage, I can register on either port 5060 or 5061. I set the xxxxxxx4530 number to register on port 5060 instead of 5061 and calls to xxxxxxx4530 still came in using the xxxxxxx4531 channel. Therefore, it seems the port does not have anything to do with the problem I am experiencing. Any other ideas?

Thanks,

Zach