[solved] issue of asterisk with openser (as redirect server)

Hi All,

When I tested Asterisk 1.4.5 with OpenSER (redirect server), I met a problem.

OpenSER returns 300 Multiple Choice with “Contact: sip:172.16.4.10, sip: 172.16.4.11”. It looks fine except there was a space after “,”. Asterisk thought the Contact header was wrong and parsed it as “SIP/172.16.4.10, sip:172.16.4.11”. The call failed.

If OpenSER returns 300 message with “Contact: sip:172.16.4.10, <sip: 172.16.4.11>;q=0”. Asterisk only tried the 2nd address.

If OpenSER returns 300 message with “Contact: sip:172.16.4.10, <sip: 172.16.4.11>”. Asterisk only tried the 1st failing gateway address.

Would anybody tell me if the format of 300 Multiple Choice with “Contact: sip:172.16.4.10, sip: 172.16.4.11” is correct?

Thanks,

Di-Shi Sun.

Please post your asterisk sip.conf and openser.cfg files

Thanks,
Suresh

Frankly, I do not think the configuration is a problem.

openser.cfg

------------------ module loading ----------------------------------

loadmodule “modules/sl/sl.so”

------------------------- request routing logic -------------------

route{
# for testing purposes, simply okay all REGISTERs
if (method==“REGISTER”) {
log(“REGISTER”);
sl_send_reply(“200”, “ok”);
break;
};
# rewrite current URI, which is always part of destination ser
rewriteuri("sip:1111111111@172.16.4.10");
# append one more URI to the destination ser
append_branch("sip:1111111111@172.16.4.11");
# redirect now
sl_send_reply(“300”, “Multiple Choice”);
}

sip.conf

[general]
context=default
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=no
promiscredir=yes

[1001]
context=Redirect
type=friend
host=dynamic
secret=1001
nat=yes
canreinvite=no
disallow=all
allow=ulaw

extensions.conf

[Redirect]
exten => _XXXX.,1,NoOp(Redirect)
exten => _XXXX.,n,Dial(SIP/${EXTEN}@172.16.4.21,30,o)
exten => _XXXX.,n,Hangup

The softphone registers on Asterisk. 172.16.4.21 is OpenSER redirect server. 172.16.4.10 is a failing gateway. 172.16.4.11 is a real gateway.

BTW, the contact header of 300 from OpenSER should be “Contact: sip:1111111111@172.16.4.10, sip:1111111111@172.16.4.11

Thanks,

Di-Shi Sun.

This is an Asterisk bug. I had posted a patch to fix part of them. To use all the destinations in a 300 message, need more work.