Configure to accept inbound SIP w/o registration

evanb
Posts: 4
Member Since:
2010-07-20

I'm using trixbox v2.8.0.3 with Asterisk v1.6.0.10-FONCORE-r40. I need to create a configuration that will accept any incoming SIP call to a given phone number/extension and execute that number's dialplan. Using the GUI I have created a generic SIP device extension to which I added the phone number as an inbound DID (which apparently caused it to be named after that DID). I left the default settings, except that I created a blank secret. It uses the default context of 'from-internal'. I also created an inbound route with no associated DID or CID number, and set its destination to be the extension.

The extension settings, from sip_additional.conf (I've obfuscated the phone number):

[9995551212]
deny=0.0.0.0/0.0.0.0
type=friend
secret=
qualify=yes
port=5060
pickupgroup=
permit=0.0.0.0/0.0.0.0
nat=yes
mailbox=9995551212@device
host=
dtmfmode=rfc2833
dial=SIP/9995551212
context=from-internal
canreinvite=no
callgroup=
callerid=device <9995551212>
accountcode=
call-limit=50

In the default extensions.conf, from-internal includes from-internal-xfer, which includes from-internal-custom, which is defined in extensions_custom.conf and contains the following lines:

[from-internal-custom]
exten => s,1,Answer()
exten => s,n,SayDigits(1234)
exten => s,n,Hangup()

When I call the number from a soft-phone I receive a 503 Service Unavailable SIP response. Asterisk run with lots of v's on the command line reports the following:

  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
  == Using SIP VRTP TOS bits 136
  == Using SIP VRTP CoS mark 6
    -- Executing [9995551212@default:1] Macro("SIP/67.151.130.226-098663a0", "exten-vm,novm,9995551212") in new stack
    -- Executing [s@macro-exten-vm:1] Macro("SIP/67.151.130.226-098663a0", "user-callerid") in new stack
    -- Executing [s@macro-user-callerid:1] Set("SIP/67.151.130.226-098663a0", "AMPUSER=67151130226") in new stack
    -- Executing [s@macro-user-callerid:2] GotoIf("SIP/67.151.130.226-098663a0", "0?report") in new stack
    -- Executing [s@macro-user-callerid:3] ExecIf("SIP/67.151.130.226-098663a0", "1?Set(REALCALLERIDNUM=67151130226)") in new stack
    -- Executing [s@macro-user-callerid:4] Set("SIP/67.151.130.226-098663a0", "AMPUSER=") in new stack
    -- Executing [s@macro-user-callerid:5] Set("SIP/67.151.130.226-098663a0", "AMPUSERCIDNAME=") in new stack
    -- Executing [s@macro-user-callerid:6] GotoIf("SIP/67.151.130.226-098663a0", "1?report") in new stack
    -- Goto (macro-user-callerid,s,10)
    -- Executing [s@macro-user-callerid:10] GotoIf("SIP/67.151.130.226-098663a0", "0?continue") in new stack
    -- Executing [s@macro-user-callerid:11] Set("SIP/67.151.130.226-098663a0", "__TTL=64") in new stack
    -- Executing [s@macro-user-callerid:12] GotoIf("SIP/67.151.130.226-098663a0", "1?continue") in new stack
    -- Goto (macro-user-callerid,s,19)
    -- Executing [s@macro-user-callerid:19] NoOp("SIP/67.151.130.226-098663a0", "Using CallerID "unknown" <67151130226>") in new stack
    -- Executing [s@macro-exten-vm:2] Set("SIP/67.151.130.226-098663a0", "RingGroupMethod=none") in new stack
    -- Executing [s@macro-exten-vm:3] Set("SIP/67.151.130.226-098663a0", "VMBOX=novm") in new stack
    -- Executing [s@macro-exten-vm:4] Set("SIP/67.151.130.226-098663a0", "EXTTOCALL=9995551212") in new stack
    -- Executing [s@macro-exten-vm:5] Set("SIP/67.151.130.226-098663a0", "CFUEXT=") in new stack
    -- Executing [s@macro-exten-vm:6] Set("SIP/67.151.130.226-098663a0", "CFBEXT=") in new stack
    -- Executing [s@macro-exten-vm:7] Set("SIP/67.151.130.226-098663a0", "RT=""") in new stack
    -- Executing [s@macro-exten-vm:8] Macro("SIP/67.151.130.226-098663a0", "record-enable,9995551212,IN") in new stack
    -- Executing [s@macro-record-enable:1] GotoIf("SIP/67.151.130.226-098663a0", "1?check") in new stack
    -- Goto (macro-record-enable,s,4)
    -- Executing [s@macro-record-enable:4] AGI("SIP/67.151.130.226-098663a0", "recordingcheck,20100720-124430,1279655070.9") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/recordingcheck
 recordingcheck,20100720-124430,1279655070.9: Inbound recording not enabled
    -- <SIP/67.151.130.226-098663a0>AGI Script recordingcheck completed, returning 0
    -- Executing [s@macro-record-enable:5] MacroExit("SIP/67.151.130.226-098663a0", "") in new stack
    -- Executing [s@macro-exten-vm:9] Macro("SIP/67.151.130.226-098663a0", "dial,"",tr,9995551212") in new stack
    -- Executing [s@macro-dial:1] GotoIf("SIP/67.151.130.226-098663a0", "1?dial") in new stack
    -- Goto (macro-dial,s,3)
    -- Executing [s@macro-dial:3] AGI("SIP/67.151.130.226-098663a0", "dialparties.agi") in new stack
    -- Launched AGI Script /var/lib/asterisk/agi-bin/dialparties.agi
 dialparties.agi: Starting New Dialparties.agi
 dialparties.agi: Caller ID name is 'unknown' number is '67151130226'
       > dialparties.agi: USE_CONFIRMATION:  'FALSE'
       > dialparties.agi: RINGGROUP_INDEX:   ''
 dialparties.agi: Methodology of ring is  'none'
    -- dialparties.agi: Added extension 9995551212 to extension map
    -- dialparties.agi: Extension 9995551212 cf is disabled
    -- dialparties.agi: Extension 9995551212 do not disturb is disabled
       > dialparties.agi: extnum 9995551212 has:  cw: 1; hascfb: 0 [] hascfu: 0 []
 dialparties.agi: EXTENSION_STATE: 0 (NOT_INUSE)
    -- dialparties.agi: dbset CALLTRACE/9995551212 to 67151130226
    -- dialparties.agi: Filtered ARG3: 9995551212
    -- <SIP/67.151.130.226-098663a0>AGI Script dialparties.agi completed, returning 0
    -- Executing [s@macro-dial:7] Dial("SIP/67.151.130.226-098663a0", "SIP/9995551212,"",tr") in new stack
  == Using SIP RTP TOS bits 184
  == Using SIP RTP CoS mark 5
  == Using SIP VRTP TOS bits 136
  == Using SIP VRTP CoS mark 6
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [s@macro-dial:8] Set("SIP/67.151.130.226-098663a0", "DIALSTATUS=CHANUNAVAIL") in new stack
    -- Executing [s@macro-dial:9] GosubIf("SIP/67.151.130.226-098663a0", "0?CHANUNAVAIL,1") in new stack
    -- Executing [s@macro-exten-vm:10] GotoIf("SIP/67.151.130.226-098663a0", "0?exit,return") in new stack
    -- Executing [s@macro-exten-vm:11] Set("SIP/67.151.130.226-098663a0", "SV_DIALSTATUS=CHANUNAVAIL") in new stack
    -- Executing [s@macro-exten-vm:12] GosubIf("SIP/67.151.130.226-098663a0", "0?docfu,1") in new stack
    -- Executing [s@macro-exten-vm:13] GosubIf("SIP/67.151.130.226-098663a0", "0?docfb,1") in new stack
    -- Executing [s@macro-exten-vm:14] Set("SIP/67.151.130.226-098663a0", "DIALSTATUS=CHANUNAVAIL") in new stack
    -- Executing [s@macro-exten-vm:15] NoOp("SIP/67.151.130.226-098663a0", "Voicemail is 'novm'") in new stack
    -- Executing [s@macro-exten-vm:16] GotoIf("SIP/67.151.130.226-098663a0", "1?s-CHANUNAVAIL,1") in new stack
    -- Goto (macro-exten-vm,s-CHANUNAVAIL,1)
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:1] NoOp("SIP/67.151.130.226-098663a0", "IVR_RETVM:  IVR_CONTEXT: ") in new stack
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:2] GotoIf("SIP/67.151.130.226-098663a0", "0?exit,1") in new stack
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:3] PlayTones("SIP/67.151.130.226-098663a0", "congestion") in new stack
    -- Executing [s-CHANUNAVAIL@macro-exten-vm:4] Congestion("SIP/67.151.130.226-098663a0", "10") in new stack
  == Spawn extension (macro-exten-vm, s-CHANUNAVAIL, 4) exited non-zero on 'SIP/67.151.130.226-098663a0' in macro 'exten-vm'
  == Spawn extension (default, 9995551212, 1) exited non-zero on 'SIP/67.151.130.226-098663a0'

The problem is that Asterisk concludes "Everyone is busy/congested at this time", but it's not clear to me what's wrong or missing. I would appreciate any insight.



SkykingOH
Posts: 9678
Member Since:
2007-12-17
What do you mean "run that

What do you mean "run that extensions dialplan"

Do you want anyone to be able to call a peer attached to the trixbox?

--

Scott

aka "Skyking"



evanb
Posts: 4
Member Since:
2010-07-20
I mean execute the

I mean execute the instructions in the context associated with the extension.

I will not be using the box to route calls to any peers; all calls will be handled locally. The application will eventually be more elaborate, but to start all I want it to answer, play a message then hang up.



SkykingOH
Posts: 9678
Member Since:
2007-12-17
Create your custom code in

Create your custom code in /etc/asterisk/extensions_custom.conf

Then create a trunk that is basically a catch all as follows:

host=dynamic
insecure=very
type=friend
disallow=all
allow=ulaw
context=my-context
--

Scott

aka "Skyking"



obeliks
Posts: 878
Member Since:
2010-03-14
1. Do not define any trunks

1. Do not define any trunks or extensions.
2. Put your code in extensions_custom.conf in context from-sip-external:


[from-sip-external]
exten => 9995551212,1,Answer()
exten => 9995551212,n,SayDigits(1234)
exten => 9995551212,n,Hangup()

I am not sure why you are using trixbox for your project. The GUI is of no use to you.



evanb
Posts: 4
Member Since:
2010-07-20
Quote: 1. Do not define any
Quote:
1. Do not define any trunks or extensions.
2. Put your code in extensions_custom.conf in context from-sip-external:

It appears that the congestion response I'm getting may be generated by the default [from-sip-external]; my grasp of dialplan syntax isn't good enough for me to be sure. Nevertheless, providing my own in extensions_custom.conf (which, I presume should override the one in extensions.conf) doesn't change Asterisk's response. With or without my customized [from-sip-external], when there is no extension for 9995551212 defined, calling 9995551212@<server ip> on my soft-phone results in a 404 Not Found error from Asterisk. With it defined, I get 503 Service Unavailable (my original problem).

Responding to skykingOH's suggestion, whether or not a trunk exists doesn't seem to have any effect on Asterisk's response to my connection attempts.

Quote:
I am not sure why you are using trixbox for your project. The GUI is of no use to you.

That does seem to be the case. :) I'm using trixbox because it was suggested to me by a former co-worker.

I'm just investigating options at this point. My trixbox development system is a virtual machine, so I can easily try something else. For this kind of project do you think one of the other GUI front-ended systems offers anything useful, or should I just use plain CLI Asterisk?



obeliks
Posts: 878
Member Since:
2010-03-14
Looks like you messed too

Looks like you messed too much with your box. You might have to reinstall.

If you look at the first line of the dialplan execution from your original post,
it shows context default instead of from-sip-external.
That's why the call is not reaching your code.
The default context for sip calls is defined in sip_general_additional.conf
Can you provide output from

# grep -B 15 context= sip*conf

in /etc/asterisk ?

You could also try to change the context from from-sip-external to ext-local-custom for your code to work with your current setup.


[ext-local-custom]
exten => 9995551212,1,Answer()
exten => 9995551212,n,SayDigits(1234)
exten => 9995551212,n,Hangup()



evanb
Posts: 4
Member Since:
2010-07-20
Quote: Looks like you messed
Quote:
Looks like you messed too much with your box.

Probably the first thing I did after installing trixbox, trying to follow an example, was put some settings in sip_general_custom.conf. Among them was context=default. With that gone my incoming calls reach the expected context.

Thanks so much for taking time to look at my issue, obeliks. I've learned something about how trixbox's dialplan framework is constructed over the last few days, but I'm not sure I'd ever have figured this out on my own.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.