AmSdp.cpp currently has this for printing sdp to 200 ok reply:

 236 void AmSdp::print(string& body) const
 237 {
 238   string out_buf = "v="+int2str(version)+"\r\n"
 239     "o="+origin.user+" "+int2str(origin.sessId)+" "+
 240           int2str(origin.sessV)+" IN " + addr_t_2_str(conn.addrType) + " ";

now i noticed that conn.addrType is not set when sems gets this kind of
sdp from pjsua:

v=0.
o=- 3575798801 3575798801 IN IP4 188.67.175.126.
s=pjmedia.
b=AS:84.
t=0 0.
a=X-nat:0.
m=audio 4000 RTP/AVP 98 97 99 104 3 0 8 9 96.
c=IN IP4 188.67.175.126.
b=TIAS:64000.
a=rtcp:4001 IN IP4 188.67.175.126.
a=sendrecv.
...

i guess the reason is that there is no session level c= line in the
sdp.

i then tied to solve the problem by setting origin.conn.addrType in
parse_sdp_origin:

     case ADDR:
        {
          next = parse_until(origin_line, ' ');
          if(next > line_end){
            DBG("parse_sdp_origin: ST_ADDR: Incorrect number of value in o=\n");
            origin_st = UNICAST_ADDR;
            break;
          }
          string addr_type(origin_line, int(next-origin_line)-1);
          if (addr_type == "IP4")
            origin.conn.addrType = 1;
          else if (addr_type == "IP6")
            origin.conn.addrType = 2;
          else {
            INFO("parse_sdp_origin: ST_ADDR: Unknown address type\n");
            origin.conn.addrType = 0;
            origin_st = UNICAST_ADDR;
            break;
          }
          INFO("origin.conn.addrType = %d\n", origin.conn.addrType); 
          origin_line = next;
          origin_st = UNICAST_ADDR;
          break;
        }

and then changed in print conn.addrType to origin.conn.addrType:

 240           int2str(origin.sessV)+" IN " +
               addr_t_2_str(origin.conn.addrType) + " ";

unfortunately that didn't have any effect. i got to syslog:

Apr 24 18:01:56 siika sems[32246]: [#7f3ba9c17700] [parse_sdp_origin, 
AmSdp.cpp:1196] INFO:  origin.conn.addrType = 1

i.e., origin.conn.addrType was set, but for some reason it is not
available in AmSdp::print because i still get this kind of o= line
in to 200 ok:

o=sems 2018467236 250804390 IN <unknown address type 0> 192.98.102.10.

i'm obviously missing something here.  what is the proper way to print
sdp o= line address type in answer so that it matches address type of o=
line in offer when session level c= line is missing?

-- juha
_______________________________________________
Semsdev mailing list
[email protected]
http://lists.iptel.org/mailman/listinfo/semsdev

Reply via email to