Ignore:
Timestamp:
Feb 22, 2007 2:52:24 PM (17 years ago)
Author:
bennylp
Message:

Fixed ticket #132: dialog automatically insert Contact header when sending 3xx response (thanks Hozjan Vladimir for the report)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c

    r974 r995  
    22852285 
    22862286            } else { 
     2287                int st_code; 
     2288                char contact[120]; 
     2289                pj_str_t hname = { "Contact", 7 }; 
     2290                pj_str_t hvalue; 
     2291                pjsip_generic_string_hdr hcontact; 
     2292                pjsua_msg_data msg_data; 
     2293 
    22872294                if (!simple_input("Answer with code (100-699)", buf, sizeof(buf))) 
    22882295                    continue; 
    22892296                 
    2290                 if (my_atoi(buf) < 100) 
     2297                st_code = my_atoi(buf); 
     2298                if (st_code < 100) 
    22912299                    continue; 
     2300 
     2301                pjsua_msg_data_init(&msg_data); 
     2302 
     2303                if (st_code/100 == 3) { 
     2304                    if (!simple_input("Enter URL to be put in Contact",  
     2305                                      contact, sizeof(contact))) 
     2306                        continue; 
     2307                    hvalue = pj_str(contact); 
     2308                    pjsip_generic_string_hdr_init2(&hcontact, &hname, &hvalue); 
     2309 
     2310                    pj_list_push_back(&msg_data.hdr_list, &hcontact); 
     2311                } 
    22922312 
    22932313                /* 
     
    23022322                } 
    23032323 
    2304                 pjsua_call_answer(current_call, my_atoi(buf), NULL, NULL); 
     2324                pjsua_call_answer(current_call, st_code, NULL, &msg_data); 
    23052325            } 
    23062326 
Note: See TracChangeset for help on using the changeset viewer.