| 265 | } |
| 266 | |
| 267 | int b2b_msg_get_from(struct sip_msg* msg, str* from_uri, str* from_dname) |
| 268 | { |
| 269 | struct to_body *pfrom; |
| 270 | |
| 271 | pfrom = get_b2bl_from(msg); |
| 272 | if (pfrom) |
| 273 | { |
| 274 | *from_uri = pfrom->uri; |
| 275 | *from_dname = pfrom->display; |
| 276 | return 0; |
| 277 | } |
| 278 | |
| 279 | /* examine the from header */ |
| 280 | if (!msg || !msg->from || !msg->from->body.s) |
| 281 | { |
| 282 | LM_ERR("cannot find 'from' header!\n"); |
| 283 | return -1; |
| 284 | } |
| 285 | if (msg->from->parsed == NULL) |
| 286 | { |
| 287 | if ( parse_from_header( msg )<0 ) |
| 288 | { |
| 289 | LM_ERR("cannot parse From header\n"); |
| 290 | return -1; |
| 291 | } |
| 292 | } |
| 293 | pfrom = (struct to_body*)msg->from->parsed; |
| 294 | *from_uri = pfrom->uri; |
| 295 | *from_dname = pfrom->display; |
| 296 | |
| 297 | return 0; |
| 298 | } |
| 299 | |
| 300 | int b2b_msg_get_maxfwd(struct sip_msg *msg) |
| 301 | { |
no test coverage detected