SIP originate anonymous.invalid

Hi,
My Asterisk version is 1.8.13.0
I Have a outbond voip service that works normally when i use a softphone.

I trying do make a outbound call with asterisk cli but there is a error:

Cli command:
originate SIP/vono/04701010101 extension playback

and get this output

[Jun 29 16:42:43] WARNING[23592]: chan_sip.c:20285 handle_response_invite: Received response: “Forbidden” from ‘“Anonymous” sip:usuario@anonymous.invalid;tag=as7ffefeb0’

Seens like the fromdomain variable is not loading from sip.conf
Anyone know how to resolve this?

sip.conf

[code][general]
context=default
allowguest=no
allowoverlap=yes
udpbindaddr=0.0.0.0
tcpenable=no
tcpbindaddr=0.0.0.0
transport=udp
srvlookup=yes

register => usuario:senha@vono.net.br/vono

[vono]
fromdomain=vono.net.br
disallow=all
username=usuario
type=peer
secret=senha
port=5060
insecure=port,invite
allow=ilbc
allow=gsm
allow=g729
allow=g711
allow=ulaw
allow=alaw
host=vono.net.br
fromuser=usuario
context=rotadesaida
outboundproxy=vono.net.br
dtmfmode=rfc2833
canreinvite=no[/code]

extensions.conf

[code]
[general]
static=yes
writeprotect=no
clearglobalvars=no

[globals]
CONSOLE=Console/dsp ; Console interface for demo
IAXINFO=guest ; IAXtel username/password
TRUNK=DAHDI/G2 ; Trunk interface
TRUNKMSD=1 ; MSD digits to strip (usually 1 or 0)

[dundi-e164-canonical]

[dundi-e164-customers]

[dundi-e164-via-pstn]

[dundi-e164-local]
include => dundi-e164-canonical
include => dundi-e164-customers
include => dundi-e164-via-pstn

[dundi-e164-switch]
switch => DUNDi/e164

[dundi-e164-lookup]
include => dundi-e164-local
include => dundi-e164-switch
[macro-dundi-e164]
exten => s,1,Goto(${ARG1},1)
include => dundi-e164-lookup

[iaxtel700]
exten => _91700XXXXXXX,1,Dial(IAX2/${GLOBAL(IAXINFO)}@iaxtel.com/${EXTEN:1}@iaxtel)

[iaxprovider]

[trunkint]
exten => _9011.,1,Macro(dundi-e164,${EXTEN:4})
exten => _9011.,n,Dial(${GLOBAL(TRUNK)}/${FILTER(0-9,${EXTEN:${GLOBAL(TRUNKMSD)}})})

[trunkld]
exten => _91NXXNXXXXXX,1,Macro(dundi-e164,${EXTEN:1})
exten => _91NXXNXXXXXX,n,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunklocal]
exten => _9NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[trunktollfree]
exten => _91800NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91888NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91877NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})
exten => _91866NXXXXXX,1,Dial(${GLOBAL(TRUNK)}/${EXTEN:${GLOBAL(TRUNKMSD)}})

[international]
ignorepat => 9
include => longdistance
include => trunkint

[longdistance]
ignorepat => 9
include => local
include => trunkld

[outbound-freenum]
exten => _XX!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XX
X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXX!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXX
X!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXX!,1,Goto(outbound-freenum2,${EXTEN},1)
exten => _XXXXXX
X!,1,Goto(outbound-freenum2,${EXTEN},1)

[outbound-freenum2]
exten => _X!,1,Verbose(2,Performing ISN lookup for ${EXTEN})
same => n,Set(SUFFIX=${CUT(EXTEN,*,2-)}) ; make sure the suffix is all digits as well
same => n,GotoIf($["${FILTER(0-9,${SUFFIX})}" != “${SUFFIX}”]?fn-CONGESTION,1)
same => n,Set(TIMEOUT(absolute)=10800)
same => n,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,1,freenum.org)}) ; perform our lookup with freenum.org
same => n,GotoIf($["${isnresult}" != “”]?from)
same => n,Set(DIALSTATUS=CONGESTION)
same => n,Goto(fn-CONGESTION,1)
same => n(from),Set(__SIPFROMUSER=${CALLERID(num)})
same => n,GotoIf($["${GLOBAL(FREENUMDOMAIN)}" = “”]?dial) ; check if we set the FREENUMDOMAIN global variable in [global]
same => n,Set(__SIPFROMDOMAIN=${GLOBAL(FREENUMDOMAIN)}) ; if we did set it, then we’ll use it for our outbound dialing domain
same => n(dial),Dial(SIP/${isnresult},40)
same => n,Goto(fn-${DIALSTATUS},1)

exten => fn-BUSY,1,Busy()

exten => _f[n]-.,1,NoOp(ISN: ${DIALSTATUS})
same => n,Congestion()

[macro-trunkdial]
exten => s,1,Dial(${ARG1})
exten => s,n,Goto(s-${DIALSTATUS},1)
exten => s-NOANSWER,1,Hangup
exten => s-BUSY,1,Hangup
exten => _s-.,1,NoOp

[stdexten]
exten => _X.,50000(stdexten),NoOp(Start stdexten)
exten => _X.,n,Set(LOCAL(ext)=${EXTEN})
exten => _X.,n,Set(LOCAL(dev)=${ARG1})
exten => _X.,n,Set(LOCAL(cntx)=${ARG2})
exten => _X.,n,Set(LOCAL(mbx)=${ext}${IF($[!${ISNULL(${cntx})}]?@${cntx})})
exten => _X.,n,Dial(${dev},20) ; Ring the interface, 20 seconds maximum
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start

exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,Return() ; If they press #, return to start

exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer

exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
exten => a,n,Return()

[stdPrivacyexten]
exten => _X.,60000(stdPrivacyexten),NoOp(Start stdPrivacyexten)
exten => _X.,n,Set(LOCAL(ext)=${ARG1})
exten => _X.,n,Set(LOCAL(dev)=${ARG2})
exten => _X.,n,Set(LOCAL(dontcntx)=${ARG3})
exten => _X.,n,Set(LOCAL(tortcntx)=${ARG4})
exten => _X.,n,Set(LOCAL(cntx)=${ARG5})

exten => _X.,n,Set(LOCAL(mbx)="${ext}"$["${cntx}" ? “@${cntx}” :: “”])
exten => _X.,n,Dial(${dev},20,p) ; Ring the interface, 20 seconds maximum, call screening
; option (or use P for databased call _X.creening)
exten => _X.,n,Goto(stdexten-${DIALSTATUS},1) ; Jump based on status (NOANSWER,BUSY,CHANUNAVAIL,CONGESTION,ANSWER)

exten => stdexten-NOANSWER,1,Voicemail(${mbx},u) ; If unavailable, send to voicemail w/ unavail announce
exten => stdexten-NOANSWER,n,NoOp(Finish stdPrivacyexten NOANSWER)
exten => stdexten-NOANSWER,n,Return() ; If they press #, return to start

exten => stdexten-BUSY,1,Voicemail(${mbx},b) ; If busy, send to voicemail w/ busy announce
exten => stdexten-BUSY,n,NoOp(Finish stdPrivacyexten BUSY)
exten => stdexten-BUSY,n,Return() ; If they press #, return to start

exten => stdexten-DONTCALL,1,Goto(${dontcntx},s,1) ; Callee chose to send this call to a polite “Don’t call again” script.

exten => stdexten-TORTURE,1,Goto(${tortcntx},s,1) ; Callee chose to send this call to a telemarketer torture script.

exten => _stde[x]te[n]-.,1,Goto(stdexten-NOANSWER,1) ; Treat anything else as no answer

exten => a,1,VoicemailMain(${mbx}) ; If they press *, send the user into VoicemailMain
exten => a,n,Return

[macro-page];

exten => s,1,ChanIsAvail(${ARG1},s) ; s is for ANY call
exten => s,n,GoToIf($[${AVAILSTATUS} = “1”]?autoanswer:fail)
exten => s,n(autoanswer),Set(_ALERT_INFO=“RA”) ; This is for the PolyComs
exten => s,n,SIPAddHeader(Call-Info: Answer-After=0) ; This is for the Grandstream, Snoms, and Others
exten => s,n,NoOp() ; Add others here and Post on the Wiki!!!
exten => s,n,Dial(${ARG1})
exten => s,n(fail),Hangup

[demo]
include => stdexten
exten => s,1,Wait(1) ; Wait a second, just for fun
exten => s,n,Answer ; Answer the line
exten => s,n,Set(TIMEOUT(digit)=5) ; Set Digit Timeout to 5 seconds
exten => s,n,Set(TIMEOUT(response)=10) ; Set Response Timeout to 10 seconds
exten => s,n(restart),BackGround(demo-congrats) ; Play a congratulatory message
exten => s,n(instruct),BackGround(demo-instruct) ; Play some instructions
exten => s,n,WaitExten ; Wait for an extension to be dialed.

exten => 2,1,BackGround(demo-moreinfo) ; Give some more information.
exten => 2,n,Goto(s,instruct)

exten => 3,1,Set(LANGUAGE()=fr) ; Set language to french
exten => 3,n,Goto(s,restart) ; Start with the congratulations

exten => 1000,1,Goto(default,s,1)
exten => 1234,1,Playback(transfer,skip) ; “Please hold while…”
; (but skip if channel is not up)
exten => 1234,n,Gosub(${EXTEN},stdexten(${GLOBAL(CONSOLE)}))
exten => 1234,n,Goto(default,s,1) ; exited Voicemail

exten => 1235,1,Voicemail(1234,u) ; Right to voicemail

exten => 1236,1,Dial(Console/dsp) ; Ring forever
exten => 1236,n,Voicemail(1234,b) ; Unless busy

exten => #,1,Playback(demo-thanks) ; "Thanks for trying the demo"
exten => #,n,Hangup ; Hang them up.

exten => t,1,Goto(#,1) ; If they take too long, give up
exten => i,1,Playback(invalid) ; “That’s not valid, try again”

exten => 500,1,Playback(demo-abouttotry); Let them know what’s going on
exten => 500,n,Dial(IAX2/guest@pbx.digium.com/s@default) ; Call the Asterisk demo
exten => 500,n,Playback(demo-nogo) ; Couldn’t connect to the demo site
exten => 500,n,Goto(s,6) ; Return to the start over message.

exten => 600,1,Playback(demo-echotest) ; Let them know what’s going on
exten => 600,n,Echo ; Do the echo test
exten => 600,n,Playback(demo-echodone) ; Let them know it’s over
exten => 600,n,Goto(s,6) ; Start over

exten => 76245,1,Macro(page,SIP/Grandstream1)
exten => _7XXX,1,Macro(page,SIP/${EXTEN})
exten => 7999,1,Set(TIMEOUT(absolute)=60)
exten => 7999,2,Page(Local/Grandstream1@page&Local/Xlite1@page&Local/1234@page/n,d)

exten => 8500,1,VoicemailMain
exten => 8500,n,Goto(s,6)

[page]
exten => _X.,1,Macro(page,SIP/${EXTEN})

[default]
include => demo

					; assuming ${MARK} is something like DAHDI/2
					; Ditto for wil

[internal]
exten => s,1,Answer()
exten => s,n(exten),Background(vm-enter-num-to-call)
exten => s,n,WaitExten(5)
exten => s,n(goodbye),Playback(vm-goodbye)
exten => s,n(end),Hangup()

[time]
exten => _X.,30000(time),NoOp(Time: ${EXTEN} ${timezone})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Set(FUTURETIME=$[${EPOCH} + 12])
exten => _X.,n,SayUnixTime(${FUTURETIME},Zulu,HNS)
exten => _X.,n,SayPhonetic(z)
exten => _X.,n,SayUnixTime(${FUTURETIME},${timezone},HNS)
exten => _X.,n,Playback(spy-local)
exten => _X.,n,WaitUntil(${FUTURETIME})
exten => _X.,n,Playback(beep)
exten => _X.,n,Return()

[ani]
exten => _X.,40000(ani),NoOp(ANI: ${EXTEN})
exten => _X.,n,Wait(0.25)
exten => _X.,n,Answer()
exten => _X.,n,Playback(vm-from)
exten => _X.,n,SayDigits(${CALLERID(ani)})
exten => _X.,n,Wait(1.25)
exten => _X.,n,SayDigits(${CALLERID(ani)}) ; playback again in case of missed digit
exten => _X.,n,Return()

[macro-phone]
exten => s,1,Dial(SIP/${MACRO_EXTEN},25)
exten => s,n,Goto(${DIALSTATUS},1)
exten => ANSWER,1,Hangup
exten => s,1,Playback(teste2)
exten => CANCEL,1,Hangup
exten => NOANSWER,1,Voicemail(${MACRO_EXTEN}@default,u)
exten => BUSY,1,Voicemail(${MACRO_EXTEN}@default,b)
exten => CONGESTION,1,Voicemail(${MACRO_EXTEN}@default,b)
exten => CHANUNAVAIL,1,Voicemail(${MACRO_EXTEN}@default,u)
exten => a,1,VoicemailMain(${MACRO_EXTEN}@default)

[sentinela]
exten => s,1,Playback(teste2)

[stations]

exten => 24,1,Macro(phone)
exten => 2424,1,Macro(phone)
exten => 1234,1,Playback(teste2) ; extensions can dial 1234
exten => 4242,1,VoicemailMain(default)

[users]
include => stations

[rotadesaida]
exten=>_XX.,1,Dial(SIP/${EXTEN}@vono,50)

[recebe_vono]
exten => vono,1,Goto(rotadeentrada,s,1)

[rotadeentrada]
exten => s,1,Dial(SIP/ramal123,50)[/code]

Hello,
I think it could help you to set sendrpid in sip.conf file for your voip provider section as follows:

sendrpid = yes                 ; If Remote-Party-ID should be sent (defaults to no)

sendrpid can help get the CLID through when the From line is being used for authentication, but won’t affect the From line and therefore the authentication problem.

Maybe you have right, but what is strange, I’m running asterisk 1.8.7.1 on gentoo

# eix -I asterisk 
[D] net-misc/asterisk
     Installed versions:  1.8.7.1(07:58:11 AM 01/19/2012)(caps curl iconv samples sqlite sqlite3 ssl -ais -alsa -bluetooth -calendar -dahdi -debug -doc -freetds -gtalk -http -jabber -jingle -ldap -lua -mysql -newt -odbc -osplookup -oss -portaudio -postgres -radius -snmp -span -speex -srtp -static -syslog -usb -vorbis)

I think I have similar problem, all inbound and outbound calls work using VoIP Phones & softphones. When I tried to make a call from CLI using channel originate command, no matter what application was used SIP or MeetMe I got error message in CLI as below:

From: "Anonymous" <sip:MYUSERNAME@anonymous.invalid>;tag=as24c10191

I enabled sip debugging and here is an part of output:

channel originate SIP/gtsenergis2/00517062460 application MeetMe 2000@users
[Jun 28 10:29:43]   == Using SIP RTP TOS bits 184
[Jun 28 10:29:43]   == Using SIP RTP CoS mark 5
[Jun 28 10:29:43] Audio is at 5060
[Jun 28 10:29:43] Adding codec 0x8 (alaw) to SDP
[Jun 28 10:29:43] Adding codec 0x2 (gsm) to SDP
[Jun 28 10:29:43] Adding codec 0x800 (g726) to SDP
[Jun 28 10:29:43] Adding codec 0x1000 (g722) to SDP
[Jun 28 10:29:43] Adding non-codec 0x1 (telephone-event) to SDP
[Jun 28 10:29:43] Reliably Transmitting (NAT) to 217.153.192.36:5060:
INVITE sip:00517062460@217.153.192.36 SIP/2.0
Via: SIP/2.0/UDP 217.149.243.2:5060;branch=z9hG4bK0d73f07c;rport
Max-Forwards: 70
From: "Anonymous" <sip:MYUSERNAME@anonymous.invalid>;tag=as24c10191
To: <sip:00517062460@217.153.192.36>
Contact: <sip:48224275972@217.149.243.2:5060>
Call-ID: 4811fec365f26d3438be23334b797afd@sip.itc.gtsenergis.pl
CSeq: 102 INVITE
User-Agent: Asterisk PBX 1.8.7.1
Date: Thu, 28 Jun 2012 08:29:43 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Type: application/sdp
Content-Length: 315

For me it looks like authentication problem, but after some research I’ve found http://www.voip-info.org/wiki/view/P-Asserted-Identity+and+Remote-Party-ID+header article and tried to set this variable.

When I set sendrpid to yes, then I am able to originate a call from CLI. But the Caller ID is replaced by internal extension, what is not desirable.
I’ve tried to change Remote-Party-ID using CONNECTEDLINE dialplan function but with no success, then I realized that the
func_connectedline.so module is missing.

I’m not advanced asterisk user, so could you please answer few questions?

  1. The problem with “channel originate” and “anonymous.invaild” appears after upgrade asterisk service from 1.6.x to 1.8.x (I tried few 1.8. versions). Do you guys know why is this happening?
  2. Why the func_connectioedline.so module is missing? I 've checked gentoo use flags for asterisk http://gentoo-portage.com/net-misc/asterisk/USE but from my understanding no one could include module required for CONNECTEDLINE() function.