[asterisk-dev] 403 for SUBSCRIBE methos

isshed isshed.sip at gmail.com
Thu Jan 10 07:04:33 CST 2013


Hi All,


I want to test dnd sevice using openims and asterisk. I have registered my
sip client with openims server. I have configured asterisk as an
application server on openims server. When I register my client with
openims server it sends subscription for reg event and ua-profile event for
registration and dnd respectively. scscf sends 200 ok fir reg eevet
subscribe and sends notification but for for ua-profile event scscf
forwords the subscribe to asterisk. Asterisk sends 401 and my client sends
resubscribe for the ssame with auth data. to which asterisk responds 403
forbidden.

below is the sip.conf entry.
-------------------------------------------------------------------------------
[general]
port=5060
bindport=5060
bindaddr=0.0.0.0
realm=open-ims.test
disallow=all
allowsubscribe=yes
subscribecontext=default
subscribewmi=yes
notifyringing=yes
notifyhold=yes
allow=ulaw
context=users
svrlookup=yes
canreinvite=no
dynamic_exclude_static=yes
[7200000001]
username=7200000001
type=peer
host=dynamic
secret=7200000001
context=users
mailbox=7200000001 at default
callerid=7200000001
-------------------------------------------------------------------------------
extension.conf
=============================================
exten => 7200000001,1,Macro(stdexten)


[app-dnd-activate]
; create list
exten => s,1,Set(i=1)
exten => s,n,while($[${i}<10])
exten => s,n,Set(DB(DND_LIST${i}/${CALLERID(NUM)})=999)
exten => s,n,Set(i=$[${i}+1])
exten => s,n,EndWhile()
exten => s,n,Set(DB(DND/${CALLERID(NUM)})=1)
exten => s,n,Playback(do-not-disturb&activated)
exten => s,n,Hangup
[app-dnd-deactivate]
exten => s,1,dbDel(DND/${CALLERID(NUM)})
exten => s,n,Playback(do-not-disturb&de-activated)
exten => s,n,Hangup

[app-dnd-list-add]
exten => s,1,Playback(extension-toadd)
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=60)
exten => s,n,Read(blacknr,then-press-pound,,,,)
exten => s,n,SayDigits(${blacknr})
exten => s,n,Playback(if-correct-press&digits/1)
exten => s,n,Noop(Waiting for input)
exten => s,n(end),WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)
;addlist
exten => 1,1,Set(i=1)
exten => 1,n,while($[${i}<10])
exten => 1,n,Set(extn=${DB(DND_LIST${i}/${CALLERID(NUM)})})
exten => 1,n,GotoIf($["${extn}"="999"]?add:next)
exten => 1,n(add),Set(DB(DND_LIST${i}/${CALLERID(NUM)})=${blacknr})
exten => 1,n,Playback(num-was-successfully&added)
exten => 1,n,Wait(1)
exten => 1,n,Return()
exten => 1,n(next),Set(i=$[${i}+1])
exten => 1,n,EndWhile()
exten => 1,n,Return()
[app-dnd-list-remove]
exten => s,1,Playback(extension-toremove)
exten => s,n,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=60)
exten => s,n,Read(blacknr,then-press-pound,,,,)
exten => s,n,SayDigits(${blacknr})
exten => s,n,Playback(if-correct-press&digits/1)
exten => s,n,Noop(Waiting for input)
exten => s,n(end),WaitExten(60,)
exten => s,n,Playback(sorry-youre-having-problems&goodbye)
;removelist
exten => 1,1,Set(i=1)
exten => 1,n,while($[${i}<10])
exten => 1,n,Set(extn=${DB(DND_LIST${i}/${CALLERID(NUM)})})
exten => 1,n,GotoIf($["${extn}"="${blacknr}"]?remove:next)
exten => 1,n(remove),Set(DB(DND_LIST${i}/${CALLERID(NUM)})=999)
exten => 1,n,Playback(num-was-successfully&removed)
exten => 1,n,Wait(1)
exten => 1,n,Return()
exten => 1,n(next),Set(i=$[${i}+1])
exten => 1,n,EndWhile()
exten => 1,n,Return()

[app-dnd-list-review]
;exten => s,1,Playback(entries-present-in-list)
exten => s,1,Set(i=1)
exten => s,n,while($[${i}<10])
exten => s,n,Set(extn=${DB(DND_LIST${i}/${CALLERID(NUM)})})
exten => s,n,GotoIf($["${extn}"="999"]?next:process)
exten => s,n(process),Playback(extension)
exten => s,n,SayNumber(${extn})
exten => s,n(next),Set(i=$[${i}+1])
exten => s,n,EndWhile()


[app-dnd-total-list-entries]
;total-list-member
exten => s,1,Set(i=1)
exten => s,n,Set(count=0)
exten => s,n,while($[${i}<10])
exten => s,n,Set(extn=${DB(DND_LIST${i}/${CALLERID(NUM))})
exten => s,n,GotoIf($["${extn}"="999"]?next:count)
exten => s,n(count),Set(count=$[${count}+1])
exten => s,n(next),Set(i=$[${i}+1])
exten => s,n,EndWhile()
exten => s,n,SayNumber(${count})
exten => s,n,Return()
=============================================
could anyone please help me to subscribe the dnd with asterisk.

Thanks in advance!!

tTanks.
Isshed
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130110/76b32aec/attachment-0001.htm>


More information about the asterisk-dev mailing list